查看完整版本: Virtualbox複製Linux虛擬機,eth0網卡啟動失敗


kkman 2016-5-17 15:56

Virtualbox複製Linux虛擬機,eth0網卡啟動失敗

利用 VirtualBox 的"再製"功能,複製一台 Linux 虛擬主機,結果開機後發現網路卡未啟動,執行 ifup eth0 出現下列訊息。<br><br># ifup eth0<br>Device eth0 does not seem to be present, delaying initialization.<br><br> 經查詢發現因為"再製"出來的虛擬機會變更新的 MAC Address,所以造成 Linux 判斷成另一張網卡,下列兩種方法任選一種就可以解決。<br><br>方法一:<br>(1) 我們可以先用下列指令查看系統目前抓到哪幾張網卡<br># cat /proc/net/dev<br>Inter-|&nbsp; &nbsp;Receive&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;|&nbsp;&nbsp;Transmit<br> face |bytes&nbsp; &nbsp; packets errs drop fifo frame compressed multicast|bytes&nbsp; &nbsp; packets errs drop fifo colls carrier compressed<br>&nbsp; &nbsp; lo:&nbsp; &nbsp;&nbsp; &nbsp; 0&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;0&nbsp; &nbsp; 0&nbsp; &nbsp; 0&nbsp; &nbsp; 0&nbsp; &nbsp;&nbsp;&nbsp;0&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; 0&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;0&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;0&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;0&nbsp; &nbsp; 0&nbsp; &nbsp; 0&nbsp; &nbsp; 0&nbsp; &nbsp;&nbsp;&nbsp;0&nbsp; &nbsp;&nbsp; &nbsp; 0&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; 0<br>&nbsp;&nbsp;eth1:&nbsp; &nbsp;&nbsp;&nbsp;0&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;0&nbsp; &nbsp; 0&nbsp; &nbsp; 0&nbsp; &nbsp; 0&nbsp; &nbsp;&nbsp;&nbsp;0&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; 0&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;0&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;0&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;0&nbsp; &nbsp; 0&nbsp; &nbsp; 0&nbsp; &nbsp; 0&nbsp; &nbsp;&nbsp;&nbsp;0&nbsp; &nbsp;&nbsp; &nbsp; 0&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; 0<br>這裡可以發現網卡代號已經變成 eth1<br><br>(2) 編輯 /etc/udev/rules.d/70-persistent-net.rules<br># vi /etc/udev/rules.d/70-persistent-net.rules<br># PCI device 0x8086:0x100e (e1000)<br>SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="08:00:27:64:f9:37", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"<br><br># PCI device 0x8086:0x100e (e1000)<br>SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="08:00:27:64:f9:39", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"<br><br>可以將 eth1 修改為 eth0,重新開機。<br><br>(3) 編輯 /etc/sysconfig/network-scripts/ifcfg-eth0<br># vi /etc/sysconfig/network-scripts/ifcfg-eth0<br><br>將"HWADDR="參數修改成正確的 MAC Address,或刪除此參數,若沒有這個參數應該在上一個步驟重新開機後會自動啟動網卡。<br><br>(4) 修改完成後,就可以順利啟動網卡。<br># ifup eth0<br><br>文章引用自: http://blog.yam.com/gavint/article/66227531<br>
頁: [1]
查看完整版本: Virtualbox複製Linux虛擬機,eth0網卡啟動失敗