Setting up the network and bringing servers into the network is the primary administration task for any system administrator.


In some cases, these tasks are automated using DHCP (Dynamic Network Configuration Protocol) which takes care of assigning IP Address to Desktop/Servers.


But, if you go to the bigger organizations they use static (manual) IP to avoid network issues due non-availability of DHCP servers.


Configure Static IP Address in CentOS 7 / RHEL 7/ Fedora 27


Let us configure our system for the following information.

IP Address =
Netmask =
DNS Server 1 =
DNS Server 2 =
Domain Name = itzgeek.local


Find the available network interfaces on your system


You can use any one of the below commands to list down the available network interfaces on the system.

ifconfig -a


ip a


Choose the desired network interface


The output of ifconfig -a may look like below. I wish to change the IP address of  enp0s3.

enp0s3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet  netmask  broadcast
        inet6 fd50:1d9:9fe3:1400:a00:27ff:fe98:676  prefixlen 64  scopeid 0x0
        inet6 fe80::a00:27ff:fe98:676  prefixlen 64  scopeid 0x20
        ether 08:00:27:98:06:76  txqueuelen 1000  (Ethernet)
        RX packets 2997  bytes 3497708 (3.3 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1487  bytes 135487 (132.3 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet  netmask
        inet6 ::1  prefixlen 128  scopeid 0x10
        loop  txqueuelen 0  (Local Loopback)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0


Configure the Static IP Address


Method 1


In this method, we will edit the network interface file found under /etc/sysconfig/network-scripts/directory. For enp0s3, the file would be ifcfg-enp0s3.

vi /etc/sysconfig/network-scripts/ifcfg-enp0s3


Update the interface file as per the requirement.

# Static IP Address #
# Server IP #
# Netmask #
# Default Gateway IP #
# DNS Servers #
# Disable ipv6 #
# Device Name #
# Optional - This is system specific and can be created using 'uuidgen enp0s3' command #
# Activate on Boot #
# Default Domain Search #


Method 2


You can also use nmtui, a text-based user interface for configuring network interfaces. You would need to install NetworkManager-tui package for the nmtui tool.



Select Edit a connection and press Enter.



Choose the network interface and then Edit.



Set the IP Address and enter OK.



Restart Network


Finally, restart the network service using the following command to have these changes take effect.

systemctl restart network


Verify Static IP Address


Use ifconfig -a command to verify the static ip address.


Also, verify the DNS server entries.

cat /etc/resolv.conf



# Generated by NetworkManager
search itzgeek.local


That’s All. 


Was this answer helpful? 0 Users Found This Useful (0 Votes)