標籤:web
一.故障現象:
[[email protected] ~]#service network restart
Shutting downloopback insterface: [ OK ]
Bringing uploopback insterface: [ OK ]
Bringing upinterface eth0: Device eth0 does notseem to be present,delaying initialization. [FAILED]
二、解決辦法
法一:
解決辦法:
[[email protected] ~]#rm -rf /etc/udev/rules.d/70-persistent-net.rules
[[email protected] ~]#reboot ………………
[[email protected] ~]#service network restart
Shutting downloopback insterface: [ OK ]
Bringing uploopback insterface: [ OK ]
Bringing up interfaceeth0: [ OK ]
法二:
安裝完一個centos虛擬機器,又拷貝一份,開機後網卡無法正常啟動,報錯:Device eth0 does not seem to be present,
delayinginitialization
解決:# mv/etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth1
vim /etc/sysconfig/network-scripts/ifcfg-eth1
修改DEVICE="eth0"
為DEVICE="eth1"
然後重啟啟動網卡嘗試下
法三:
在RHEL5裡也發生類似事情,因為複製虛擬機器MAC會重建,但是作業系統的MAC卻寫在ifcfg-ethx裡,造成了不一致,所以不能啟動網路介面,在RHEL5裡可以使用kudzu或者注釋網卡設定檔的MAC欄位來解決這個問題。但是在RHEL6裡,kudzu已經被hal服務取代了。雖然lspci能夠正常認到網卡,但是卻無法使用/etc/init.d/networkrestart來啟動服務。嘗試注釋ifcfg-eth0的MAC欄位,還是報錯。查看了下udev的規則,發現了問題的所在。
[[email protected]~]# 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.
#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″
#net device ()
SUBSYSTEM==”net”, ACTION==”add”, DRIVERS==”?*”,ATTR{address}==”08:00:27:32:66:63″, ATTR{type}==”1″, KERNEL==”eth*”,NAME=”eth1″
[[email protected] ~]#
原來UDEV這裡把複製前的MAC當成了當前虛擬機器的eth0MAC,而重建的08:00:27:32:66:63是eth1的MAC。
解決這個問題,只要刪除舊的UDEV配置,修改為:
[[email protected] ~]# 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.
#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!試過多次!
[[email protected] ~]# /etc/init.d/network restart
Shutting down interface eth0: [ OK ]
Shutting down loopback interface: [ OK ]
Bringing up loopback interface: [ OK ]
Bringing up interface eth0: [ OK ]
實在不行就reboot重啟,我就是這樣解決問題的。
本文出自 “Try to be brave” 部落格,謝絕轉載!
centos 6.4 複製無法載入網卡的問題解決方案