centos6 static ip setting

http://lintut.com/how-to-set-static-ip-address-on-redhat-centos-and-fedora-linux/

# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=static
HWADDR=xx:xx:xx:xx:xx:xx
NM_CONTROLLED=yes
ONBOOT=yes
TYPE=Ethernet
IPADDR=192.168.1.2
NETMASK=255.255.255.0

Configure Default gateway:

# vi /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=host.lintut.com
GATEWAY=192.168.1.1

Configure DNS server:

# vi /etc/resolv.conf
nameserver 8.8.8.8
nameserver 8.8.4.4

Restart Network service:

# service network restart

你可能感兴趣的:(linux)