天天看點

ubuntu 網卡突然無法連接配接

今天要用到VM BT的Namp掃描伺服器端口,發現橋接後無法使用。

ifconfig 隻看到 lo位址,看不到以太網網卡位址

使用lspci 檢視是否安裝了以太網網卡驅動

lscpi | grep Ethernet

02:01.0 Ethernet controller: Advanced Micro Devices [AMD] 79c970 [PCnet32 LANCE] (rev 10)

看到文章中是克隆或者複制其他虛拟機開機出現此類問題,操作以下步驟就解決了。

sudo rm /etc/udev/rules.d/70-persistent-net.rules  删除相關檔案

reboot  重新開機

問題的原因是MAC位址被緩存出了問題導緻的。

    但是我的虛拟機開機用了一段時間是可以的,是過了好長時間才出現了這個問題,這究竟是為什麼?

    我多次添加删除虛拟網卡并執行重新開機都沒有反應。

    猜測是不是支援的緩存網卡數量達到了三個,而且目前使用的網卡有沒有辦法頂上去,沒有辦法繼續緩存導緻無法跟新網卡裝置。進而導緻無法識别網絡裝置。

After cloning a virtual machine running Ubuntu Server 10.04 found that it didn

’t have any network available.

Restarting networking gave:

sudo /etc/init.d/networking restart * Reconfiguring network interfaces... eth0

: ERROR

while getting interface flags:

No such device SIOCSIFADDR: No such device eth0: ERROR

No such device SIOCSIFNETMASK: No such device SIOCSIFBRDADDR: No such device

eth0: ERROR

No such device eth0: ERROR while getting interface flags: No such device

Failed to bring up eth0.

The problem lies in the fact that ethernet MAC addresses are cached.

You need to remove a file to clear the cached value:

sudo rm /etc/udev/rules.d/70-persistent-net.rules

After a restart of your server you should have networking back again.