Network setting(NIC)
How to set IP address, Hostname, enable disable NIC in RHEL 7.
To set IP address in RHEL 7 we have “nmtui” command. For setting IP address follow this steps.
[root@feenixdv7 ~]# nmtui
Then you can edit or put new IP address and more information like Gateway DNS…..
For hostname follow bellow steps.
Then restart network service.
Set IP Address manual/DHCP(auto) with command line.
Set IP Address manually.
[root@ansible ~]# nmcli connection modify eth0 ipv4.method manual ipv4.addresses 192.168.1.100/24 connection.autoconnect yes
[root@ansible ~]# nmcli connection up eth0
[root@ansible ~]# ifconfig
enp0s3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.100 netmask 255.255.255.0
Set IP Address from DHCP(auto).
[root@ansible ~]# nmcli connection modify eth0 ipv4.method auto connection.autoconnect yes
[root@ansible ~]# nmcli connection up eth0
[root@ansible ~]# ifconfig
enp0s3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.224.24.246 netmask 255.255.252.0