vi /etc/sysconfig/network-scripts/ifcfg-eth0
动态:
DEVICE=eth0
BOOTPROTO=dhcp
HWADDR=00:0C:29:A2:5C:3F
ONBOOT=yes
TYPE=Ethernet
静态:
DEVICE=eth0
BOOTPROTO=static
IPADDR=192.168.0.124
NETMASK=255.255.255.0
GATEWAY=192.168.0.1
HWADDR=00:0C:29:A2:5C:3F
ONBOOT=yes
TYPE=Ethernet
重启,使生效
service network restart