網絡卡eth0,未識別的埠
原文地址:
用service network restart 後,有時會得到這樣的提示
Shutting down loopback interface: [ OK ]
Bringing up loopback interface: [ OK ]
Bringing up interface eth0: Error: No suitable device found: no device found for connection ' System eth0'.
[FAILED]
用ifconfig eth0 up 提示eth0: unknown interface: No such device
網路在啟動的時候會去配置檔案 /etc/udev/rules.d/70-persistent-net.rules 讀取相應的資訊,如:
# PCI device 0x8086:0x100e (e1000) (custom name provided by external tool)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="08:00:27:25:d3:1c", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
# PCI device 0x8086:0x100e (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="08:00:27:37:20:1e", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
表明在 setup 網路設定中設定了兩個網絡卡,eth0 和 eth1,系統看到這個資訊會自動去讀取網絡卡對應的檔案
etc/sysconfig/network-script/ifcfg-eth0 和 etc/sysconfig/network-script/ifcfg-eth1
會發現這 eth0 檔案的網絡卡實體地址和電腦的網絡卡不匹配,才會出現開始的錯誤資訊提示,可以把 eth1 中資訊 copy 到 eth0中,這樣在啟動時,eth0就可以找到與之匹配的網絡卡裝置。