昨天,我将桌面上的操作系统从 Ubuntu 16.04 重新安装到 Ubuntu 22.04。但我注意到我没有互联网连接。NetworkManager 说它连接到以太网大约 30 秒,之后它断开连接并重试。自然而然地,我去了谷歌并开始寻找解决方案,但大多数回复似乎已经过时(例如使用/etc/network/interfaces
而不是netplan
)。我尝试过重新启动NetworkManager
,拔下并重新插入以太网电缆,重新启动路由器,但都无济于事。
输出ip addr
:
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: enp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether bc:5f:f4:0f:ab:dc brd ff:ff:ff:ff:ff:ff
我的 netplan 配置:
# Let NetworkManager manage all devices on this system
network:
version: 2
renderer: NetworkManager
NetworkManager 日志:
січ 18 12:49:56 darky NetworkManager[682]: <info> [1674038996.9743] dhcp4 (enp2s0): canceled DHCP transaction
січ 18 12:49:56 darky NetworkManager[682]: <info> [1674038996.9495] device (enp2s0): state change: failed -> disconnected (reason 'none', sys-iface-state: 'managed')
січ 18 12:49:56 darky NetworkManager[682]: <warn> [1674038996.9474] device (enp2s0): Activation: failed for connection 'Wired connection 1'
січ 18 12:49:56 darky NetworkManager[682]: <info> [1674038996.9463] manager: NetworkManager state is now DISCONNECTED
січ 18 12:49:56 darky NetworkManager[682]: <info> [1674038996.9450] device (enp2s0): state change: ip-config -> failed (reason 'ip-config-unavailable', sys-iface-state: 'managed')
січ 18 12:49:11 darky NetworkManager[682]: <info> [1674038951.9796] dhcp4 (enp2s0): activation: beginning transaction (timeout in 45 seconds)
січ 18 12:49:11 darky NetworkManager[682]: <info> [1674038951.9777] device (enp2s0): state change: config -> ip-config (reason 'none', sys-iface-state: 'managed')
січ 18 12:49:11 darky NetworkManager[682]: <info> [1674038951.9772] device (enp2s0): state change: prepare -> config (reason 'none', sys-iface-state: 'managed')
січ 18 12:49:11 darky NetworkManager[682]: <info> [1674038951.9771] manager: NetworkManager state is now CONNECTING
січ 18 12:49:11 darky NetworkManager[682]: <info> [1674038951.9768] device (enp2s0): state change: disconnected -> prepare (reason 'none', sys-iface-state: 'managed')
січ 18 12:49:11 darky NetworkManager[682]: <info> [1674038951.9767] device (enp2s0): Activation: starting connection 'Wired connection 1' (dfbe8c9e-d38e-364b-9d17-7e3e4cef30a9)
січ 18 12:49:11 darky NetworkManager[682]: <info> [1674038951.9760] policy: auto-activating connection 'Wired connection 1' (dfbe8c9e-d38e-364b-9d17-7e3e4cef30a9)
січ 18 12:49:11 darky NetworkManager[682]: <info> [1674038951.9743] dhcp4 (enp2s0): canceled DHCP transaction
січ 18 12:49:11 darky NetworkManager[682]: <info> [1674038951.9463] device (enp2s0): state change: failed -> disconnected (reason 'none', sys-iface-state: 'managed')
січ 18 12:49:11 darky NetworkManager[682]: <warn> [1674038951.9453] device (enp2s0): Activation: failed for connection 'Wired connection 1'
січ 18 12:49:11 darky NetworkManager[682]: <info> [1674038951.9443] manager: NetworkManager state is now DISCONNECTED
січ 18 12:49:11 darky NetworkManager[682]: <info> [1674038951.9429] device (enp2s0): state change: ip-config -> failed (reason 'ip-config-unavailable', sys-iface-state: 'managed')
січ 18 12:48:26 darky NetworkManager[682]: <info> [1674038906.9838] dhcp4 (enp2s0): activation: beginning transaction (timeout in 45 seconds)
січ 18 12:48:26 darky NetworkManager[682]: <info> [1674038906.9817] device (enp2s0): state change: config -> ip-config (reason 'none', sys-iface-state: 'managed')
січ 18 12:48:26 darky NetworkManager[682]: <info> [1674038906.9812] device (enp2s0): state change: prepare -> config (reason 'none', sys-iface-state: 'managed')
січ 18 12:48:26 darky NetworkManager[682]: <info> [1674038906.9810] manager: NetworkManager state is now CONNECTING
січ 18 12:48:26 darky NetworkManager[682]: <info> [1674038906.9808] device (enp2s0): state change: disconnected -> prepare (reason 'none', sys-iface-state: 'managed')
січ 18 12:48:26 darky NetworkManager[682]: <info> [1674038906.9807] device (enp2s0): Activation: starting connection 'Wired connection 1' (dfbe8c9e-d38e-364b-9d17-7e3e4cef30a9)
січ 18 12:48:26 darky NetworkManager[682]: <info> [1674038906.9798] policy: auto-activating connection 'Wired connection 1' (dfbe8c9e-d38e-364b-9d17-7e3e4cef30a9)
січ 18 12:48:26 darky NetworkManager[682]: <info> [1674038906.9783] dhcp4 (enp2s0): canceled DHCP transaction
січ 18 12:48:26 darky NetworkManager[682]: <info> [1674038906.9368] device (enp2s0): state change: failed -> disconnected (reason 'none', sys-iface-state: 'managed')
січ 18 12:48:26 darky NetworkManager[682]: <warn> [1674038906.9361] device (enp2s0): Activation: failed for connection 'Wired connection 1'
好像我甚至无法 ping 通我的路由器:
darky@darky:~/Desktop$ ping google.com
ping: google.com: Temporary failure in name resolution
darky@darky:~/Desktop$ ping 192.168.1.1
ping: connect: Network is unreachable
darky@darky:~/Desktop$ ping 192.168.1.0
ping: connect: Network is unreachable