CENTOS 6.2 系统网卡更换后的设置方法
centos6 更换网卡之后,网卡名称都是自增。例如原来是eth1,更换后变成识别eth2,不能使用原来的eth1了,需要修改一下文件:
当网卡变动时.当新加网卡时.或换网卡时.这个文件都会有变化.对应的修改mac 或eth *这个名字.来调整.
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对应的值
转载于:https://blog.51cto.com/lzy821218/1135324