centos 6.4 複製無法載入網卡的問題解決方案

來源:互聯網
上載者:User

標籤: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 複製無法載入網卡的問題解決方案

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.