在VMware中克隆完成後,開啓系統,啓動網卡時出現錯誤,提示這樣的失敗:網絡
Bringing up interface eth0: Device eth0 does not seem to be present, delaying initialization. [FAILED]
ide
是由於網卡mac地址寫入硬件致使問題
oop
在RHEL5裏也發生相似事情,由於複製虛擬機MAC會從新生成,可是操做系統的MAC卻寫在ifcfg-ethx裏,形成了不一致,因此不能啓動 網絡接口,在RHEL5裏能夠使用kudzu或者註釋網卡配置文件的MAC字段來解決這個問題。可是在RHEL6裏,kudzu已經被hal服務取代了。 雖然lspci可以正常認到網卡,可是卻沒法使用/etc/init.d/network restart來啓動服務。嘗試註釋ifcfg-eth0的MAC字段,仍是報錯。查看了下udev的規則,發現了問題的所在。操作系統
[root@Oracle ~]# cat /etc/udev/rules.d/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, and change only the value of the NAME= key.rest
# net device () (custom name provided by external tool)
SUBSYSTEM==」net」, ACTION==」add」, DRIVERS==」?*」, ATTR{address}==」08:00:27:16:31:11″, ATTR{type}==」1″, KERNEL==」eth*」, NAME=」eth0″code
# net device ()
SUBSYSTEM==」net」, ACTION==」add」, DRIVERS==」?*」, ATTR{address}==」08:00:27:32:66:63″, ATTR{type}==」1″, KERNEL==」eth*」, NAME=」eth1″
[root@Oracle ~]#接口
原來UDEV這裏把克隆前的MAC當成了當前虛擬機的eth0 MAC,而從新生成的08:00:27:32:66:63是eth1的MAC。ci
解決這個問題,只要刪除舊的UDEV配置,修改成:
[root@Oracle ~]# cat /etc/udev/rules.d/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, and change only the value of the NAME= key.generator
# net device () (custom name provided by external tool)
SUBSYSTEM==」net」, ACTION==」add」, DRIVERS==」?*」, ATTR{address}==」08:00:27:32:66:63″, ATTR{type}==」1″, KERNEL==」eth*」, NAME=」eth0″虛擬機
重啓network服務有時能夠有時不行,重啓系統就一切OK!試過屢次![root@Oracle ~]# /etc/init.d/network restartShutting down interface eth0: [ OK ]Shutting down loopback interface: [ OK ]Bringing up loopback interface: [ OK ]Bringing up interface eth0: [ OK ][root@Oracle ~]# ifconfig eth0eth0 Link encap:Ethernet HWaddr 08:00:27:32:66:63inet addr:172.16.100.3 Bcast:172.16.100.255 Mask:255.255.255.0inet6 addr: fe80::a00:27ff:fe32:6663/64 Scope:LinkUP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1RX packets:206 errors:0 dropped:0 overruns:0 frame:0TX packets:203 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:1000RX bytes:21157 (20.6 KiB) TX bytes:24515 (23.9 KiB)