Configure Static IP in Centos 6.5

In this tutorial, I will show you how to convert from DHCP to Static IP address in CentOS 6.5. In CentOS, Fedora or RHEL, you can configure network interfaces by using configuration files located in:

nano /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
HWADDR=08:00:27:76:4c:d5
TYPE=Ethernet
ONBOOT=yes
BOOTPROTO=none
IPV6INIT=no
USERCTL=no
NM_CONTROLLED=yes
PEERDNS=yes
IPADDR=192.168.174.128
NETMASK=255.255.255.0

Configure Default Gateway:

Edit the network file:

/etc/sysconfig/network
NETWORKING=yes
HOSTNAME=centos6.5
GATEWAY=192.168.1.1

Configure DNS Server:

nano /etc/resolv.conf
nameserver 8.8.8.8 # Replace with your DNS1
nameserver 192.168.1.1 # Replace with your DNS2

Restart Network Interface:

# /etc/init.d/network restart

Check it now:

# ifconfig

Now check the connectivity:

ping google.com

Done, This was all about setting static IP in CentOS 6.5.

You may also like to know how to reset forgotten root password in CentOS . So, do check it out.

Give your opinion below if you experience any issues or to discuss your ideas and experiences.

Leave a Reply

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