Chinaunix首页 | 论坛 | 博客
  • 博客访问: 143570
  • 博文数量: 36
  • 博客积分: 1180
  • 博客等级: 少尉
  • 技术积分: 260
  • 用 户 组: 普通用户
  • 注册时间: 2010-06-30 10:21
文章分类

全部博文(36)

文章存档

2012年(1)

2011年(21)

2010年(14)

分类: LINUX

2011-03-14 19:04:18

今天早上,将前几天在另外一台电脑上建立的虚拟机文件拷贝过来重新打开,系统启动后,发现网卡eth0启动不了!

估计是虚拟机移动之后,虚拟网卡的mac地址发生了变化,所以fc9将旧的网卡eth0变成eth1来启动了,但查看/etc/sysconfig/network-scripts/下面,也没见eth1的配置文件存在,但ifconfig,列出eth1已经启动,并已从dhcp获得ip地址。

经过仔细研究,发现是udev作怪了。发现/etc/udev/rules.d/70-persistent-net.rules这个文件里面有如下记录
QUOTE:
[root@kevin ~]# cat 70-persistent-net.rules

# This file was automatically generated by the /lib/udev/write_net_rules
# program run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single line.

# Advanced Micro Devices [AMD] 79c970 [PCnet32 LANCE] (rule written by anaconda)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:d2:3f:2c", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

# PCI device 0x1022:0x2000 (pcnet32)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:87:43:18", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"

# PCI device 0x1022:0x2000 (pcnet32)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:87:43:22", ATTR{type}=="1", KERNEL=="eth*", NAME="eth2"

# PCI device 0x1022:0x2000 (pcnet32)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:c8:3a:15", ATTR{type}=="1", KERNEL=="eth*", NAME="eth3"

这是udev在发现网卡mac变更之后,自动将接口改名的结果。将这个/etc/udev/rules.d/70-persistent-net.rules删除,重启,网卡eth0成功启动,并重新生成/etc/udev/rules.d/70-persistent-net.rules文件。
阅读(1114) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~