CENTOS 6.2 系统网卡更换后的设置方法centos
centos6 更换网卡以后,网卡名称都是自增。例如原来是eth1,更换后变成识别eth2,不能使用原来的eth1了,须要修改一下文件:app
当网卡变更时.当新加网卡时.或换网卡时.这个文件都会有变化.对应的修改mac 或eth *这个名字.来调整.ide
1、Vi /etc/udev/rules.d/70-persistent-net.rules
物理机设置:
# PCI device 0x10ec:0x8139 (8139too)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:e0:4c:90:06:83", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
# PCI device 0x10ec:0x8168 (r8169)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:e0:4c:10:cd:ab", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
虚机设置:
# PCI device 0x1022:0x2000 (pcnet32)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:37:f8:69", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
# PCI device 0x1022:0x2000 (pcnet32)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:37:f8:73", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
2、 vi /etc/sysconfig/network-scripts/ifcfg-eth* 中的device=eth* 也修改为与MAC对应的值