更改 MAC 地址后 ubuntu 中缺少网络接口

4 networking mac-address ubuntu

嗨,我在 VirtualBox 上使用 Ubuntu Server。但是我从虚拟机设置中更改了 NIC 的 MAC 地址。但是现在输入ifconfig就找不到界面了。我该怎么办?

use*_*307 6

你跑了ifconfig -a吗?

现在 ubuntu 和 debian 使用 udev 持久地为相同的 nic 分配相同的设备名称。这很好用,除非它不做你想让它做的事情。

justin@media:~$ cat /etc/udev/rules.d/70-persistent-net.rules 
...
# PCI device 0x8086:0x100e (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:08:74:f2:83:e2", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
Run Code Online (Sandbox Code Playgroud)

如果您在 VM 上运行它,您很可能会看到两行,一行用于 eth0,另一行用于 eth1。修复它的简单方法是删除 eth0 行,并将剩余的 eth1 更改为 eth0。