Popular Posts

Tuesday, 30 October 2012

How to setup static ip address in CentOS 6

Go to /etc/sysconfig/network-scripts and edit with your favorite editor ifcfg-eth0 ( in this example my interface is ifcfg-eth0 )
  • vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=”eth0″
BOOTPROTO=”dhcp”
HWADDR=”00:0C:29:EB:C4:57″
IPV6INIT=”yes”
NM_CONTROLLED=”yes”
ONBOOT=”yes”
TYPE=”Ethernet”
UUID=”be5349a9-78cb-4d5b-ba02-f9d01c42d7ab”
Change BOOTPROTO=”dhcp” to BOOTPROTO=”static”

Under UUID add the following
IPADDR=192.168.1.10
NETMASK=255.255.255.0
save and exit ifcfg-eth0
Now do the following to configure Default Gateway , edit /etc/sysconfig/network
  • vi /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=localhost
GATEWAY=192.168.1.1
Restart ifcfg-eth0 and network
  • service network restart
  • ifdown ifcfg-eth0
  • ifup ifcfg-eth0

0 comments

Post a Comment