vi /etc/sysconfig/network-scripts/ifcfg-em1 (em1为网卡名称)
bootproto=static
onboot=yes
IPADDR=192.168.1.1
NETMASK=255.255.255.0
GATEWAY=192.168.1.254
DNS=8.8.8.8
service network restart