Configure IP address (Networking) in RHEL/CentOS 7

First thing that we do after installing an operating system is to configure the IP address i.e. networking on the machine. Whether we want to connect to internet or only to our local area network (LAN), we must provide information regarding our network to the machine. In this tutorial, we are going to discuss to configure an IP address in RHEL/CentOS 7 using three different methods,

(Recommended Read: IP Aliasing : Assigning multiple IP addresses to single NIC)


Method 1- By editing Network Interface file

This method works on all Linux distributions. To configure IP address, we need to open the network configuration file & pass our network information in the file. In RHEL/CentOS 7, location for all network interfaces is ‘/etc/sysconfig/network-scripts‘, in our case name of network interface is ‘ifcfg-en0s3’. We will now edit the file to configure a static IP address for our system. Open the network interface file,

$ cd /etc/sysconfig/network-scripts
$ vi ifcfg-en0s3

configuring ip adress

To configure a static IP address, change the ‘BOOTPROTO‘ to ‘none‘ (it’s DHCP by default) & enter IP address, gateway & DNS information.  Also change ‘ONBOOT‘ to ‘yes‘ so that we don’t have to start networking services everytime we restart our system.

configure ip address

After making all the changes, save the file & then restart the networking services to implement the changes.

$ systemctl restart network
$ vi ifcfg-en0s3


Method 2 – Using graphical interface

If we are using RHEL/CentOS with GUI then we can easily configure IP address graphically.  Open ‘Network’ either by clicking network icon & then selecting ‘Network Settings‘ on top-left corner of the screen or goto Applications-> System Tools-> Settings-> Network.

configuring ip address

Next, click on the settings icon (on bottom right corner of the opened window) & select IPV4 then mention you network information on the opened window.

configuring ip address

After the IP information has been edited, click on apply & exit from the menu. Lastly restart network services for implementing the changes.


Method 3- Using NMTUI command

This method can be used in GUI as well as in CLI. For using it in GUI mode, open a terminal and enter the command ‘nmtui’ & press enter or if using CLI , just enter the command ‘nmtui’ & press enter. This will open a new window with 3 options i.e. we can edit our network interface, activate a network interface or set a hostname for our system  (read our tutorial on setting hostname HERE ).

$ nmtui


To setup networking for the system, select ‘Edit a connection’, select your network interface & then select ‘Edit’ using the arrow keys. In the ‘IPv4 Configuration’ select ‘manual’ & then enter your network information.

configuring ip address

After making changes, press ‘OK’ to save the file & on the next screen press ‘Quit’ to exit from the menu. Restart your network services for changes to take effect.

Apart from these three methods, you can also configure IP address when installing operating system & also there are two more methods through which we can configure our network on RHEL/CentOS 7 machines i.e. by using ‘nmcli command & ifconfig command. This wraps up our tutorial on how to configure IP address. For any queries/questions, please use comment box below.


If you think we have helped you or just want to support us, please consider these :-

Connect to us: Facebook | Twitter | Google Plus

Donate us some of you hard earned money:

Linux TechLab is thankful for your continued support.


Passionate about Linux & open source. Loves to learn, read & write about Linux as well as new technologies.

You may also like...

Leave a Reply

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