device "eth0" does not seem to be present问题解决

VM下ESXI5.5平台下,一台虚拟机重启,报如下信息:
device "eth0" does not seem to be present, delaying initialization
通过分析,原因是Centos6使用udev动态管理设备文件将MAC地址和网卡名称对应记录在udev的规则脚本中,VMware升级后虚拟机网卡MAC会改变,这样系统会认为网卡是新增的并命名为eth1,查看如下:
ip add
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 1000
link/ether 00:0c:29:ce:c0:1e brd ff:ff:ff:ff:ff:ff
inet 192.168.1.13/24 brd 192.168.1.255 scope global eth1
inet6 fe80::20c:29ff:fece:c01e/64 scope link

解决方法1,修改网络配置文件设备eth0为eth1:


cat /etc/sysconfig/network-scripts/ifcfg-eth0 
DEVICE="eth1"
BOOTPROSTO=static
IPADDR=192.168.1.13
NETMASK=255.255.255.0
GATEWAY=192.168.1.1
ONBOOT="yes"

解决方法2,修改udev记录的mac与网卡名称对应规则:


cat /etc/udev/rules.d/70-persistent-net.rules 
# PCI device 0x1022:0x2000 (pcnet32)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?[i]", ATTR{address}=="00:0c:29:ce:c0:1e", ATTR{type}=="1", KERNEL=="eth[/i]", NA

解决方法3,删除规则文件,重启虚拟机


 # rm -rf /etc/udev/rules.d/70-persistent-net.rules
# reboot

2 个评论

解决方法3,是重启虚拟机吧
是的

要回复文章请先登录注册