启动KVM虚拟机,发现eth0变成了eth5.
dmesg |grep eth
发现下面的日志
udev: renamed network interface eth1 to eth4
因为在部署虚拟机时,更改了网卡的MAC地址。
udev有个规则文件,那里边包含了对那些动态dev的处理,当新加网卡时.或换网卡时.这个文件都会有变化。
解决办法:
删除这个文件或注释掉里面的内容即可,重启虚拟机,问题解决。
规则文件为:/etc/udev/rules.d/70-persistent-net.rules
- # PCI device 0x10ec:0x8139 (8139cp)
-
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="52:54:00:04:65:ea", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
-
-
# PCI device 0x1af4:0x1000 (virtio-pci)
-
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="52:54:00:27:56:4e", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
-
-
# PCI device 0x1af4:0x1000 (virtio-pci)
-
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="52:54:00:e6:88:fd", ATTR{type}=="1", KERNEL=="eth*", NAME="eth2"
-
-
# PCI device 0x1af4:0x1000 (virtio-pci)
-
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="52:54:00:e9:04:8c", ATTR{type}=="1", KERNEL=="eth*", NAME="eth3"
-
-
# PCI device 0x1af4:0x1000 (virtio-pci)
-
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="52:54:00:5a:b7:d4", ATTR{type}=="1", KERNEL=="eth*", NAME="eth4"
-
-
# PCI device 0x1af4:0x1000 (virtio-pci)
-
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="52:54:00:55:52:e9", ATTR{type}=="1", KERNEL=="eth*", NAME="eth5"
阅读(3188) | 评论(0) | 转发(0) |