Network setting(NIC)

Network setting(NIC)

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

clip_image001[4]   clip_image002[4]

 

Then you can edit or put new IP address and more information like Gateway DNS…..

clip_image003[4]

For hostname follow bellow steps.

clip_image004[4]  clip_image005[4]

Then restart network service.

clip_image006

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

 

Leave a Reply

Your email address will not be published. Required fields are marked *