目前的eth0地址:
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 192.168.101.104 netmask 255.255.255.0 broadcast 192.168.101.255 inet6 fe80::5099:46ff:fe57:603e prefixlen 64 scopeid 0x20<link> ether 52:99:46:57:60:3e txqueuelen 1000 (Ethernet) RX packets 267860 bytes 295712013 (282.0 MiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 233105 bytes 26260005 (25.0 MiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
编辑eth0的文件
vi /etc/sysconfig/network-scripts/ifcfg-eth0
修改前
修改后
NAME=eth0 DEVICE=eth0 ONBOOT=yes BOOTPROTO=static NM_CONTROLLED=yes IPADDR=192.168.101.104 NETMASK=255.255.255.0 GATEWAY=192.168.101.255