总结:还是StackOverflow靠谱,查了一下午资料,最后在Overflow上找到了答案。
I had this problem, there's 4 interfaces on my server, which should have been: eth0, eth1, eth2, eth3 but they were renamed to eth4, eth5, eth6, eth7.
I couldn't figure out how to get them back but eventually found out I could just delete the 70-persistent-net.rules
file to make the system reset the interface names back to default
Like so:
rm /etc/udev/rules.d/70-persistent-net.rules
Then a reboot should get everything up and running again:
shutdown -r now
链接:http://stackoverflow.com/questions/10712007/dhcp-on-ubuntu-server-12-04-fails-to-load-eth0
70-persistent-net.rules
Debian/Ubuntu 使用 udev 管理硬體設備,也包括了網路卡。網路卡設備的內容會記錄在 /etc/udev/rules.d/70-persistent-net.rules 。它也會影嚮 NetworkManager 的運作。
當我們使用備份功能將系統複製到新的硬體上之後,會因為新網卡的 MAC address 與 70-persistent-net.rules 內的 MAC address 不相同,導致網路卡未被啟用、網路無法連線。此時,只需要刪除 70-persistent-net.rules ,再重開機,讓系統重新產生 70-persistent-net.rules 即可。
或者,手動編輯 70-persistent-net.rules ,將 ATTR{address}=="..."
的內容刪掉,再重開機。