先执行命令
DEVICE=eth0
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=none
IPADDR=172.16.8.23
PREFIX=24
GATEWAY=172.16.8.2
DNS1=223.5.5.5
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=none
IPADDR=172.16.8.23
PREFIX=24
GATEWAY=172.16.8.2
DNS1=223.5.5.5
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System eth0"
最后执行重启命令
/etc/init.d/network restart