(Last Updated On: August 12, 2018)

How to Configure Network Static IP Address, Configuring Static IP address on CentOS 7.0 and RHEL 7.0, CentOS Server  Static and Manual IP address configuration.


If you don’t have a Network Manager already installed on Your Graphical CentOS server, then the only way to get around with a working Internet connection is to configure IP Address Manually using the terminal.Editing Network Network Configurations on CentOS 7.0 is the same as for RHEL, you edit Network interfaces configuration file located in network scripts folder. I will also show you how to change host-name and add default route. Network Manager With the Text User Interface called nmtui is also available and we are going to install it as well. Nmtui is used to edit System Network Settings and to do things like Bonding, bridging, Team and Working With VLAN interfaces.

  • Your attention and basic knowledge of Linux Command Line
  • Running Version of RHEL 7.0
  • CentOS 7.0 or 6.5

Step 1:
Navigate to /etc/sysconfig/network-scripts/ifcfg-eth0 | em1|p3p1. eth0, em1 and p3p1 indicate the device name or network interface name. You can use nano or Vi text editor that comes preinstalled on most Linux distros.

sudo vim /etc/sysconfig/network-scripts/ifcfg-enop3  

 Edit the configuration file, set the ONBOOT statement option to YES and change the BOOTPROTO to static.
Then add the following lines at the end of the configuration file, of course replacing the network configuration settings with yours.

[email protected]

 You can add secondary DNS servers by editing the /etc/resolv.conf file as well or via echo nameserver>> /etc/reslov.conf.
Your network interface now has a static IP address. Next thing is to restart your network interface

# service network restart
# systemctl restart network

An alternative and another smooth way to  change your hostname is by

# echo mycentos > /etc/hostname

NOTE: CentOs 7.0 and Redhat have implemented systemd process and service management so start getting used to systemctl command for starting, stopping, enabling, disabling and restarting all system daemons.
The Hostname and DNS services can also be configured at /etc/sysconfig/network file.

sudo vim /etc/sysconfig/network

then add

HOSTNAME= kim.example.com

To install nmtui type:

sudo  yum install NetworkManager-tui

Start nmtui by typing nmtui followed by the name of the interface, example,

sudo nmtui edit eth0

To connect to the network interface with nmtui you type:

# nmtui connect p3p1 | etho | em0

If you are wondering how can I install Gnome Desktop Manager on My CentOS server??, then execute this command to get Gnome desktop manager and Other GUI graphical Network Management Tools.

sudo yum groupinstall "Gnome Desktop" "Graphical Administration Tools"


sudo ln -sf /lib/systemd/system/runlevel5.target  /etc/systemd/system/default.target

That’s all. Thanks for Visiting.
Search Tags
Configuring static IP address in CentOS, Fedora, and RHEL
How to add a static IP address to /etc/sysconfig/network file.
CentOS 7.0 and RHEL 7.0 Static IP, hostname and Default route configuration.