Pages

Friday, December 18, 2015

Working with Network on CentOS/RHEL 07 - Part 11

Home

Configure DHCP IP address using Command Line UI (nmtui)

- In this section of document we will have a look on how we can configure an interface to get the DHCP IP address assignment done (IPV4) in RHEL/CENTOS 7
- First execute below command to get into command line UI provided by OS
[root@myserver2 ~]# nmtui

- Post execution of command “nmtui” on putty itself you will be given an user interface which will help you step wise for the configuration of network interface details.


- Select the desired physical connection profile to which IP address details are to be modified.




- Now keep the IPV4 Configuration section to Automatic  and get same disabled for the IPV6 as we don’t need it for now.




- Once all changes are saved IP address details can be seen in the below command and file outputs,
[root@myserver2 ~]# ip addr show enp0s8
3: enp0s8: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 08:00:27:74:9d:4b brd ff:ff:ff:ff:ff:ff
[root@myserver2 ~]# ifup enp0s8
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/6)
[root@myserver2 ~]# ip addr show enp0s8
3: enp0s8: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 08:00:27:74:9d:4b brd ff:ff:ff:ff:ff:ff
    inet 192.168.248.201/24 brd 192.168.248.255 scope global dynamic enp0s8
       valid_lft 1203sec preferred_lft 1203sec
    inet 192.168.248.11/24 brd 192.168.248.255 scope global secondary enp0s8
       valid_lft forever preferred_lft forever
    inet6 fe80::a00:27ff:fe74:9d4b/64 scope link
       valid_lft forever preferred_lft forever
[root@myserver2 ~]# nmtui
[root@myserver2 ~]# ifdown enp0s8
[root@myserver2 ~]# ifup enp0s8
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/7)
[root@myserver2 ~]# ^C
[root@myserver2 ~]# ip addr show enp0s8
3: enp0s8: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 08:00:27:74:9d:4b brd ff:ff:ff:ff:ff:ff
    inet 192.168.248.201/24 brd 192.168.248.255 scope global dynamic enp0s8
       valid_lft 1200sec preferred_lft 1200sec
    inet6 fe80::a00:27ff:fe74:9d4b/64 scope link
       valid_lft forever preferred_lft forever
[root@myserver2 network-scripts]# cat ifcfg-Wired_connection_2
TYPE=Ethernet
BOOTPROTO=dhcp
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=no
NAME=Wired_connection_2
UUID=ba922995-30c0-4494-899c-d9bdc92d068e
DEVICE=enp0s8
ONBOOT=yes
HWADDR=08:00:27:74:9D:4B
PEERDNS=yes
PEERROUTES=yes

No comments:

Post a Comment