RedHat Linux Tutorials

This tutorial explains how to configure IP address in Linux step by step with examples.

This tutorial is prepared for Centos / RHEL 6 or lower version. A lot of things have been changed in RHEL 7. Some features explained in this tutorial will not work in RHEL 7.0 or higher. If you have RHEL 7 or higher version of RHEL /Centos, please use this tutorial.

How to assign IP address in Redhat Linux 7

The most essential part of networking is assigning IP address, default gateway and DNS server IP address. An IP address is the unique identity of a computer in network. Without it computer will not be able to communicate with other computers in network. Before we learn how to assign an IP address, let’s learn how to view the current IP configuration.

In RHEL you can assign these parameters in two ways.

  • Static configuration
  • Dynamic configuration

Static configuration

In static configuration you have to assign all these parameters manually. Static configuration does not change automatically. Static configuration generally used with servers or network resources like printer, router etc. Static configuration uses set parameters for the configuration, which is known by the system and the network.

Dynamic configuration

Dynamic configurations are handled by DHCP server. In dynamic configuration DHCP service on the network provides all these parameters to a system when it joins the network.

Dynamic configuration generally used with workstations. Dynamic configuration configures network parameters on the boot.

Red Hat provides two tools to configure the network device.

  • Network configuration tool
  • Network manager

Network configuration tool

This is a command line network configuration tool. Use this tool to configure IP address on console. This tool can be invoked by running system-config-network command.



Key control

  • TAB Key :- To switch between options
  • Enter /Space :- Select the highlighted options

Select Device Configuration if other option is selected press TAB key until device configuration is selected and press ENTER


On Select A Device screen select first network card (eth0) and press ENTER


Now we are on Network configuration screen. As we mentions above IP configuration can be set in two ways static or dynamic.

To set IP configuration dynamically Select DHCP


To use static IP configuration press TAB key to highlight DHCP option and press SPACEBAR to deselect it. Fill necessary parameters and select Ok by pressing TAB key. Once OK is highlighted press ENTER


Select Save by pressing TAB key and press ENTER


Select Save & Quit by pressing TAB key and press ENTER


To put the configuration customized with this tool into effect we need to reactivate the associated device. Until we reactivate associated device it would run with old configuration. You can check it with ifconfig command


Use ifdown command to deactivate and ifup to activate.


Check again with ifconfig command. The configuration of the network card should reflect the new configuration.


Network manager tool

This is a GUI tool to configure IP address. It is also default network management tool for RHEL6. Use this tool to configure IP address on GUI. To invoke this tool click System | Preferences | Network Connections.


You can also invoke this tool form terminal. Run following command



This command may return with following error


This error triggered when NetwrokManager service is disabled.


Start NetworkManager service


Now try to invoke network manager again. From open window select eth0 and click on edit


Click on IPv4 tab. For dynamic configuration select DHCP from method drop down


For static configuration select Manual from drop down and click on Add button, fill IP configuration and click on apply button


We are back on Network Connection window click on close


Reactivate network adaptor so new configuration can take effect.


You can also invoke Network Manager directly from panel .Right click on Network icon and click on edit connection


To deactivate do left click on network icon and click on Disconnect


To activate do left click on network icon and click on network adaptor


Both tools are available during the exam. Do practice with both.