Chinaunix首页 | 论坛 | 博客
  • 博客访问: 3017480
  • 博文数量: 535
  • 博客积分: 15788
  • 博客等级: 上将
  • 技术积分: 6507
  • 用 户 组: 普通用户
  • 注册时间: 2007-03-07 09:11
文章分类

全部博文(535)

文章存档

2016年(1)

2015年(1)

2014年(10)

2013年(26)

2012年(43)

2011年(86)

2010年(76)

2009年(136)

2008年(97)

2007年(59)

分类: LINUX

2011-09-23 14:56:40

启动KVM虚拟机,发现eth0变成了eth5.

dmesg |grep eth
发现下面的日志
udev: renamed network interface eth1 to eth4

因为在部署虚拟机时,更改了网卡的MAC地址。
udev有个规则文件,那里边包含了对那些动态dev的处理,当新加网卡时.或换网卡时.这个文件都会有变化。

解决办法:
删除这个文件或注释掉里面的内容即可,重启虚拟机,问题解决。

规则文件为:/etc/udev/rules.d/70-persistent-net.rules

  1. # PCI device 0x10ec:0x8139 (8139cp)
  2. SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="52:54:00:04:65:ea", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
  3. # PCI device 0x1af4:0x1000 (virtio-pci)
  4. SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="52:54:00:27:56:4e", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
  5. # PCI device 0x1af4:0x1000 (virtio-pci)
  6. SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="52:54:00:e6:88:fd", ATTR{type}=="1", KERNEL=="eth*", NAME="eth2"
  7. # PCI device 0x1af4:0x1000 (virtio-pci)
  8. SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="52:54:00:e9:04:8c", ATTR{type}=="1", KERNEL=="eth*", NAME="eth3"
  9. # PCI device 0x1af4:0x1000 (virtio-pci)
  10. SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="52:54:00:5a:b7:d4", ATTR{type}=="1", KERNEL=="eth*", NAME="eth4"
  11. # PCI device 0x1af4:0x1000 (virtio-pci)
  12. SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="52:54:00:55:52:e9", ATTR{type}=="1", KERNEL=="eth*", NAME="eth5"
阅读(3146) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~