#首先要保证udev-post 启动 chkconfig --list|grep udev udev-post 0:off 1:on 2:on 3:on 4:on 5:on 6:off service udev-post start #将原有的eth0那一行注释,然后将生成的eth1改为eth0 vim /etc/udev/rules.d/70-persistent-net.rules # PCI device 0x8086:0x100f (e1000) #SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0a:31:75:62:3c", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0" # PCI device 0x8086:0x100f (e1000) SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0a:31:75:62:3c", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0" #最后修改网卡的配置文件 cat /etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE=eth0 TYPE=Ethernet UUID=cs802cs7-087a-af50-812b-f3d20053aa4a ONBOOT=yes NM_CONTROLLED=yes BOOTPROTO=none HWADDR=00:0a:31:75:62:3c #修改MAC地址跟上面配置文件里面一样 IPADDR=192.168.1.100 PREFIX=24 GATEWAY=192.168.1.254 DNS1=202.103.24.68 DEFROUTE=yes IPV4_FAILURE_FATAL=yes IPV6INIT=no NAME="System eth0" #最后reboot系统
本文出自 “吴善强” 博客,请务必保留此出处http://shanqiangwu.blog.51cto.com/8067564/1632245
原文地址:http://shanqiangwu.blog.51cto.com/8067564/1632245