Sunday, March 8, 2015

RHEL7 - How to assign ip address

How to assign static ip to RHEL 7 host.

Note: Network Manager is installed by default.

To verify the status of Network Manager service:

$ systemctl status NetworkManager.service
under Active section, you will see active (running)

Find out the active interface managed by Network Manager
$ nmcli dev status

You will find the output with status.

Assigning static IP without Network Manager

Go to network config location
# cd /etc/sysconfig/network-scripts
# vi ifcfg-interface

Now change the following parameter

other stuff,  you can leave as it is not you can remove all reference to ipv6

Restart netwok service
# systemctl restart network.service

Verify if ip is assigned
# ip add

Using Network Manager to set up ip address

nmtui (Network Manager Text User Interface) can be used to configure on terminal window.

# yum search NetworkManager
# yum install NetworkManager-tui

find your interface and use nmtui to configure it.
# nmtui edit interface
it infact allow you to make changes to /etc/sysconfig/network-scripts/ifcfg.interface file.

make changes based on your requirement options.
and restart your service
# systemctl restart network.service

Please remember to add gateway info either on ifcfg-interface or /etc/sysconfig/network file

No comments:

Post a Comment