升级到 17.04 后,我无法通过网络管理器连接到有线以太网。指示器网络显示:以太网网络 - 设备未管理。系统设置 > 网络 > 有线显示:有线未管理。
Wifi 连接运行良好,通过 ifup/ifdown 管理的有线连接也运行良好(当我将 eth0 放入 /etc/network/interfaces 时)。
我的网络配置文件如下所示:
$ cat /etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback
$ cat /etc/NetworkManager/NetworkManager.conf
[main]
plugins=ifupdown,keyfile
[ifupdown]
managed=true
这是我的 ifconfig -a 输出:
docker0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 172.17.0.1 netmask 255.255.0.0 broadcast 0.0.0.0
ether 02:42:1c:34:04:c4 txqueuelen 0 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
eth0: flags=4098<BROADCAST,MULTICAST> mtu 1500
ether 54:be:f7:76:35:32 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 18
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 352 bytes 25966 (25.9 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 352 bytes 25966 (25.9 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
wlan0: flags=4098<BROADCAST,MULTICAST> mtu 1500
ether 7e:de:d9:4c:d6:4f txqueuelen 1000 (Ethernet)
RX packets 2170 bytes 1604327 (1.6 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 2108 bytes 416467 (416.4 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
答案1
作为佐尔坦·拉茨科提到,从 NetworkManager 1.2.4(ubuntu 16.10)开始,所有非 wifi/wwan 设备都被视为不受管理的(参见他在类似问题中的回答网络管理员拒绝管理有线接口)。一个解决方案是创建一个空文件:
sudo touch /etc/NetworkManager/conf.d/10-globally-managed-devices.conf
...这将会覆盖/覆盖 /usr/lib 中的内容,然后重新启动网络管理器。