vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=static
IPADDR=192.168.0.22
NETMASK=255.255.255.0
GATEWAY=192.168.0.1
#HWADDR=
ONBOOT=yes
TYPE=Ethernet
生效命令
/sbin/ifdown eth0
然后
/sbin/ifup eth0
/etc/init.d/network restart