1.修改/etc/sysconfig/network-scripts/ifcfg-eth0配置文件,添加如下内容
DEVICE=eth0 HWADDR=00:0C:29:96:01:6B TYPE=Ethernet UUID=41cbd943-024b-4341-ac7a-e4d2142b4938 ONBOOT=yes NM_CONTROLLED=yes BOOTPROTO=none IPADDR=xxx.xxx.x.xxx #例如:IPADDR=192.168.2.140 NETMASK=255.255.255.0 GATEWAY=192.168.2.2
2.修改/etc/resolv.conf配置文件,85);">nameserver192.168.2.2
3.重新启动
servicenetworkrestart
4.查看地址
ifconfig
5.检查配置结果
pingwww.baidu.com