从 20.04 升级到 22.04 后,网络无法正常工作,直到我发出
sudo nmcli networking off && sudo nmcli networking on
这对于以太网/有线和 wifi 以及从终端 ping 都是正确的。我在联想 X230 笔记本电脑上运行 Ubuntu 22.04。
可能相关:使用 Ubuntu 20.04 时,网络会在启动时工作,但当我从有线切换到 wifi 或反之亦然时,我需要使用上述命令重新启动 NetworkManager。在 22.04 下,网络在启动时无法工作,直到重新启动,切换时我需要重新启动。
我可以通过将其添加到登录来破解它,但我确信如果我找不到根本原因,它以后会困扰我。
这是启动后网络不工作时的结果sudo journalctl -b 0 -u NetworkManager
。这是使用有线连接并关闭 wifi 的结果,sw rfkill 已确认:
Aug 23 11:13:19 lenovo-x230u systemd[1]: Starting Network Manager...
Aug 23 11:13:19 lenovo-x230u NetworkManager[1248]: <info> [1661249599.3132] NetworkManager (version 1.36.6) is starting... (for the first time)
Aug 23 11:13:19 lenovo-x230u NetworkManager[1248]: <info> [1661249599.3139] Read config: /etc/NetworkManager/NetworkManager.conf (lib: 10-dns-resolved.conf, 20-connectivity-ubuntu.conf, no-mac-addr-change.conf) (run: 10-globally-managed-devices.conf) (etc: default-wifi-powersave-on.conf, wgpia.conf)
Aug 23 11:13:19 lenovo-x230u NetworkManager[1248]: <info> [1661249599.3384] bus-manager: acquired D-Bus service "org.freedesktop.NetworkManager"
Aug 23 11:13:19 lenovo-x230u systemd[1]: Started Network Manager.
Aug 23 11:13:19 lenovo-x230u NetworkManager[1248]: <info> [1661249599.3524] manager[0x556e30144030]: monitoring kernel firmware directory '/lib/firmware'.
Aug 23 11:13:19 lenovo-x230u NetworkManager[1248]: <info> [1661249599.3525] monitoring ifupdown state file '/run/network/ifstate'.
Aug 23 11:13:20 lenovo-x230u NetworkManager[1248]: <info> [1661249600.1036] hostname: hostname: using hostnamed
Aug 23 11:13:20 lenovo-x230u NetworkManager[1248]: <info> [1661249600.1036] hostname: static hostname changed from (none) to "lenovo-x230u"
Aug 23 11:13:20 lenovo-x230u NetworkManager[1248]: <info> [1661249600.1081] dns-mgr[0x556e3011e2a0]: init: dns=systemd-resolved rc-manager=unmanaged (auto), plugin=systemd-resolved
Aug 23 11:13:20 lenovo-x230u NetworkManager[1248]: <info> [1661249600.1107] rfkill2: found Wi-Fi radio killswitch (at /sys/devices/pci0000:00/0000:00:1c.1/0000:03:00.0/ieee80211/phy0/rfkill2) (driver iwlwifi)
Aug 23 11:13:20 lenovo-x230u NetworkManager[1248]: <info> [1661249600.1111] rfkill1: found WWAN radio killswitch (at /sys/devices/platform/thinkpad_acpi/rfkill/rfkill1) (platform driver thinkpad_acpi)
Aug 23 11:13:20 lenovo-x230u NetworkManager[1248]: <info> [1661249600.1170] manager[0x556e30144030]: rfkill: Wi-Fi hardware radio set disabled
Aug 23 11:13:20 lenovo-x230u NetworkManager[1248]: <info> [1661249600.1192] manager[0x556e30144030]: rfkill: WWAN hardware radio set enabled
Aug 23 11:13:20 lenovo-x230u NetworkManager[1248]: <info> [1661249600.1292] Loaded device plugin: NMTeamFactory (/usr/lib/x86_64-linux-gnu/NetworkManager/1.36.6/libnm-device-plugin-team.so)
Aug 23 11:13:20 lenovo-x230u NetworkManager[1248]: <info> [1661249600.1364] Loaded device plugin: NMBluezManager (/usr/lib/x86_64-linux-gnu/NetworkManager/1.36.6/libnm-device-plugin-bluetooth.so)
Aug 23 11:13:20 lenovo-x230u NetworkManager[1248]: <info> [1661249600.1373] Loaded device plugin: NMWwanFactory (/usr/lib/x86_64-linux-gnu/NetworkManager/1.36.6/libnm-device-plugin-wwan.so)
Aug 23 11:13:20 lenovo-x230u NetworkManager[1248]: <info> [1661249600.1393] Loaded device plugin: NMWifiFactory (/usr/lib/x86_64-linux-gnu/NetworkManager/1.36.6/libnm-device-plugin-wifi.so)
Aug 23 11:13:20 lenovo-x230u NetworkManager[1248]: <info> [1661249600.1414] Loaded device plugin: NMAtmManager (/usr/lib/x86_64-linux-gnu/NetworkManager/1.36.6/libnm-device-plugin-adsl.so)
Aug 23 11:13:20 lenovo-x230u NetworkManager[1248]: <info> [1661249600.1419] manager: rfkill: Wi-Fi enabled by radio killswitch; disabled by state file
Aug 23 11:13:20 lenovo-x230u NetworkManager[1248]: <info> [1661249600.1421] manager: rfkill: WWAN enabled by radio killswitch; enabled by state file
Aug 23 11:13:20 lenovo-x230u NetworkManager[1248]: <info> [1661249600.1423] manager: Networking is enabled by state file
Aug 23 11:13:20 lenovo-x230u NetworkManager[1248]: <info> [1661249600.1510] settings: Loaded settings plugin: ifupdown ("/usr/lib/x86_64-linux-gnu/NetworkManager/1.36.6/libnm-settings-plugin-ifupdown.so")
Aug 23 11:13:20 lenovo-x230u NetworkManager[1248]: <info> [1661249600.1511] settings: Loaded settings plugin: keyfile (internal)
Aug 23 11:13:20 lenovo-x230u NetworkManager[1248]: <info> [1661249600.1511] ifupdown: management mode: managed
Aug 23 11:13:20 lenovo-x230u NetworkManager[1248]: <info> [1661249600.1512] ifupdown: interface-parser: parsing file /etc/network/interfaces
Aug 23 11:13:20 lenovo-x230u NetworkManager[1248]: <info> [1661249600.1512] ifupdown: interface-parser: finished parsing file /etc/network/interfaces
Aug 23 11:13:20 lenovo-x230u NetworkManager[1248]: <info> [1661249600.1718] dhcp-init: Using DHCP client 'internal'
Aug 23 11:13:20 lenovo-x230u NetworkManager[1248]: <info> [1661249600.1719] device (lo): carrier: link connected
Aug 23 11:13:20 lenovo-x230u NetworkManager[1248]: <info> [1661249600.1723] manager: (lo): new Generic device (/org/freedesktop/NetworkManager/Devices/1)
Aug 23 11:13:20 lenovo-x230u NetworkManager[1248]: <info> [1661249600.1747] manager: (enp0s25): new Ethernet device (/org/freedesktop/NetworkManager/Devices/2)
Aug 23 11:13:20 lenovo-x230u NetworkManager[1248]: <info> [1661249600.1784] device (enp0s25): state change: unmanaged -> unavailable (reason 'managed', sys-iface-state: 'external')
Aug 23 11:13:20 lenovo-x230u NetworkManager[1248]: <info> [1661249600.4234] device (wlp3s0): driver supports Access Point (AP) mode
Aug 23 11:13:20 lenovo-x230u NetworkManager[1248]: <info> [1661249600.4245] manager: (wlp3s0): new 802.11 Wi-Fi device (/org/freedesktop/NetworkManager/Devices/3)
Aug 23 11:13:20 lenovo-x230u NetworkManager[1248]: <info> [1661249600.4273] device (wlp3s0): state change: unmanaged -> unavailable (reason 'managed', sys-iface-state: 'external')
Aug 23 11:13:20 lenovo-x230u NetworkManager[1248]: <info> [1661249600.4338] manager: rfkill: Wi-Fi now disabled by radio killswitch
Aug 23 11:13:20 lenovo-x230u NetworkManager[1248]: <info> [1661249600.4612] modem-manager: ModemManager available
Aug 23 11:13:20 lenovo-x230u NetworkManager[1248]: <info> [1661249600.6117] manager: (D0:3F:AA:1D:31:62): new Bluetooth device (/org/freedesktop/NetworkManager/Devices/4)
Aug 23 11:13:20 lenovo-x230u NetworkManager[1248]: <info> [1661249600.6154] device (D0:3F:AA:1D:31:62): state change: unmanaged -> unavailable (reason 'managed', sys-iface-state: 'external')
Aug 23 11:13:20 lenovo-x230u NetworkManager[1248]: <info> [1661249600.6208] device (D0:3F:AA:1D:31:62): state change: unavailable -> disconnected (reason 'none', sys-iface-state: 'managed')
Aug 23 11:13:23 lenovo-x230u NetworkManager[1248]: <info> [1661249603.9315] device (enp0s25): carrier: link connected
Aug 23 11:13:23 lenovo-x230u NetworkManager[1248]: <info> [1661249603.9323] device (enp0s25): state change: unavailable -> disconnected (reason 'carrier-changed', sys-iface-state: 'managed')
Aug 23 11:13:23 lenovo-x230u NetworkManager[1248]: <info> [1661249603.9342] policy: auto-activating connection 'Wired connection 1' (83d94562-7e3b-3ed8-a967-ecbb1533efd1)
Aug 23 11:13:23 lenovo-x230u NetworkManager[1248]: <info> [1661249603.9355] device (enp0s25): Activation: starting connection 'Wired connection 1' (83d94562-7e3b-3ed8-a967-ecbb1533efd1)
Aug 23 11:13:23 lenovo-x230u NetworkManager[1248]: <info> [1661249603.9358] device (enp0s25): state change: disconnected -> prepare (reason 'none', sys-iface-state: 'managed')
Aug 23 11:13:23 lenovo-x230u NetworkManager[1248]: <info> [1661249603.9367] manager: NetworkManager state is now CONNECTING
Aug 23 11:13:23 lenovo-x230u NetworkManager[1248]: <info> [1661249603.9372] device (enp0s25): state change: prepare -> config (reason 'none', sys-iface-state: 'managed')
Aug 23 11:13:23 lenovo-x230u NetworkManager[1248]: <info> [1661249603.9392] device (enp0s25): state change: config -> ip-config (reason 'none', sys-iface-state: 'managed')
Aug 23 11:13:23 lenovo-x230u NetworkManager[1248]: <info> [1661249603.9405] dhcp4 (enp0s25): activation: beginning transaction (timeout in 45 seconds)
Aug 23 11:13:30 lenovo-x230u NetworkManager[1248]: <info> [1661249610.0654] dhcp4 (enp0s25): state changed new lease, address=109.41.187.122
Aug 23 11:13:30 lenovo-x230u NetworkManager[1248]: <info> [1661249610.0697] device (enp0s25): state change: ip-config -> ip-check (reason 'none', sys-iface-state: 'managed')
Aug 23 11:13:30 lenovo-x230u NetworkManager[1248]: <info> [1661249610.0748] device (enp0s25): state change: ip-check -> secondaries (reason 'none', sys-iface-state: 'managed')
Aug 23 11:13:30 lenovo-x230u NetworkManager[1248]: <info> [1661249610.0752] device (enp0s25): state change: secondaries -> activated (reason 'none', sys-iface-state: 'managed')
Aug 23 11:13:30 lenovo-x230u NetworkManager[1248]: <info> [1661249610.0757] manager: NetworkManager state is now CONNECTED_LOCAL
Aug 23 11:13:30 lenovo-x230u NetworkManager[1248]: <info> [1661249610.0763] manager: NetworkManager state is now CONNECTED_SITE
Aug 23 11:13:30 lenovo-x230u NetworkManager[1248]: <info> [1661249610.0764] policy: set 'Wired connection 1' (enp0s25) as default for IPv4 routing and DNS
Aug 23 11:13:30 lenovo-x230u NetworkManager[1248]: <info> [1661249610.0775] device (enp0s25): Activation: successful, device activated.
Aug 23 11:13:30 lenovo-x230u NetworkManager[1248]: <info> [1661249610.0783] manager: NetworkManager state is now CONNECTED_GLOBAL
Aug 23 11:13:30 lenovo-x230u NetworkManager[1248]: <info> [1661249610.0792] manager: startup complete
Aug 23 11:13:31 lenovo-x230u NetworkManager[1248]: <info> [1661249611.5250] manager: (tun0): new Tun device (/org/freedesktop/NetworkManager/Devices/5)
Aug 23 11:13:31 lenovo-x230u NetworkManager[1248]: <info> [1661249611.5372] device (tun0): state change: unmanaged -> unavailable (reason 'connection-assumed', sys-iface-state: 'external')
Aug 23 11:13:31 lenovo-x230u NetworkManager[1248]: <info> [1661249611.5379] device (tun0): state change: unavailable -> disconnected (reason 'connection-assumed', sys-iface-state: 'external')
Aug 23 11:13:31 lenovo-x230u NetworkManager[1248]: <info> [1661249611.5387] device (tun0): Activation: starting connection 'tun0' (701076b1-8a64-43a5-afbe-e8f74c5d1988)
Aug 23 11:13:31 lenovo-x230u NetworkManager[1248]: <info> [1661249611.5389] device (tun0): state change: disconnected -> prepare (reason 'none', sys-iface-state: 'external')
Aug 23 11:13:31 lenovo-x230u NetworkManager[1248]: <info> [1661249611.5392] device (tun0): state change: prepare -> config (reason 'none', sys-iface-state: 'external')
Aug 23 11:13:31 lenovo-x230u NetworkManager[1248]: <info> [1661249611.5394] device (tun0): state change: config -> ip-config (reason 'none', sys-iface-state: 'external')
Aug 23 11:13:31 lenovo-x230u NetworkManager[1248]: <info> [1661249611.5397] device (tun0): state change: ip-config -> ip-check (reason 'none', sys-iface-state: 'external')
Aug 23 11:13:31 lenovo-x230u NetworkManager[1248]: <info> [1661249611.5450] device (tun0): state change: ip-check -> secondaries (reason 'none', sys-iface-state: 'external')
Aug 23 11:13:31 lenovo-x230u NetworkManager[1248]: <info> [1661249611.5453] device (tun0): state change: secondaries -> activated (reason 'none', sys-iface-state: 'external')
Aug 23 11:13:31 lenovo-x230u NetworkManager[1248]: <info> [1661249611.5459] device (tun0): Activation: successful, device activated.
Aug 23 11:13:31 lenovo-x230u NetworkManager[1248]: <info> [1661249611.5806] device (tun0): state change: activated -> unmanaged (reason 'unmanaged', sys-iface-state: 'removed')
Aug 23 11:13:32 lenovo-x230u NetworkManager[1248]: <info> [1661249612.7841] agent-manager: agent[4b5f25c2c3ee9b06,:1.66/org.gnome.Shell.NetworkAgent/120]: agent registered
Aug 23 11:13:42 lenovo-x230u NetworkManager[1248]: <info> [1661249622.1267] manager: (cdc-wdm2): new Broadband device (/org/freedesktop/NetworkManager/Devices/6)
Aug 23 11:13:42 lenovo-x230u NetworkManager[1248]: <info> [1661249622.1269] device (cdc-wdm2): state change: unmanaged -> unavailable (reason 'managed', sys-iface-state: 'external')
Aug 23 11:13:42 lenovo-x230u NetworkManager[1248]: <info> [1661249622.1272] device (cdc-wdm2): modem state 'failed'
Aug 23 11:13:42 lenovo-x230u NetworkManager[1248]: <info> [1661249622.1274] modem-broadband[cdc-wdm2]: failed to retrieve SIM object: No SIM object available
Aug 23 11:13:43 lenovo-x230u NetworkManager[1248]: <info> [1661249623.6756] agent-manager: agent[f9c25a7fcc12b782,:1.105/org.gnome.Shell.NetworkAgent/1000]: agent registered
以下是重新启动并且网络正常工作时添加到 journalctl 的内容:
Aug 23 11:21:04 lenovo-x230uu NetworkManager[1248]: <info> [1661250064.1751] manager: disable requested (sleeping: no enabled: yes)
Aug 23 11:21:04 lenovo-x230uu NetworkManager[1248]: <info> [1661250064.1751] device (wlp3s0): state change: unavailable -> unmanaged (reason 'sleeping', sys-iface-state: 'managed')
Aug 23 11:21:04 lenovo-x230uu NetworkManager[1248]: <info> [1661250064.1761] device (D0:3F:AA:1D:31:62): state change: disconnected -> unmanaged (reason 'sleeping', sys-iface-state: 'managed')
Aug 23 11:21:04 lenovo-x230uu NetworkManager[1248]: <info> [1661250064.1765] device (cdc-wdm2): state change: unavailable -> unmanaged (reason 'sleeping', sys-iface-state: 'managed')
Aug 23 11:21:04 lenovo-x230uu NetworkManager[1248]: <info> [1661250064.1768] manager: NetworkManager state is now ASLEEP
Aug 23 11:21:04 lenovo-x230uu NetworkManager[1248]: <info> [1661250064.1772] audit: op="networking-control" arg="off" pid=3691 uid=0 result="success"
Aug 23 11:21:04 lenovo-x230uu NetworkManager[1248]: <info> [1661250064.1772] device (enp0s25): state change: activated -> deactivating (reason 'sleeping', sys-iface-state: 'managed')
Aug 23 11:21:04 lenovo-x230uu NetworkManager[1248]: <info> [1661250064.2051] device (enp0s25): state change: deactivating -> disconnected (reason 'sleeping', sys-iface-state: 'managed')
Aug 23 11:21:04 lenovo-x230uu NetworkManager[1248]: <info> [1661250064.2290] dhcp4 (enp0s25): canceled DHCP transaction
Aug 23 11:21:04 lenovo-x230uu NetworkManager[1248]: <info> [1661250064.2290] dhcp4 (enp0s25): activation: beginning transaction (timeout in 45 seconds)
Aug 23 11:21:04 lenovo-x230uu NetworkManager[1248]: <info> [1661250064.2291] dhcp4 (enp0s25): state changed no lease
Aug 23 11:21:04 lenovo-x230uu NetworkManager[1248]: <info> [1661250064.2605] device (enp0s25): state change: disconnected -> unmanaged (reason 'sleeping', sys-iface-state: 'managed')
Aug 23 11:21:04 lenovo-x230uu NetworkManager[1248]: <info> [1661250064.3726] manager: enable requested (sleeping: no enabled: no)
Aug 23 11:21:04 lenovo-x230uu NetworkManager[1248]: <info> [1661250064.3726] device (enp0s25): state change: unmanaged -> unavailable (reason 'managed', sys-iface-state: 'external')
Aug 23 11:21:04 lenovo-x230uu NetworkManager[1248]: <info> [1661250064.5898] device (wlp3s0): state change: unmanaged -> unavailable (reason 'managed', sys-iface-state: 'external')
Aug 23 11:21:04 lenovo-x230uu NetworkManager[1248]: <info> [1661250064.5913] device (D0:3F:AA:1D:31:62): state change: unmanaged -> unavailable (reason 'managed', sys-iface-state: 'external')
Aug 23 11:21:04 lenovo-x230uu NetworkManager[1248]: <info> [1661250064.5919] device (cdc-wdm2): state change: unmanaged -> unavailable (reason 'managed', sys-iface-state: 'external')
Aug 23 11:21:04 lenovo-x230uu NetworkManager[1248]: <info> [1661250064.5922] device (cdc-wdm2): modem state 'failed'
Aug 23 11:21:04 lenovo-x230uu NetworkManager[1248]: <info> [1661250064.5922] manager: NetworkManager state is now DISCONNECTED
Aug 23 11:21:04 lenovo-x230uu NetworkManager[1248]: <info> [1661250064.5925] audit: op="networking-control" arg="on" pid=3701 uid=0 result="success"
Aug 23 11:21:04 lenovo-x230uu NetworkManager[1248]: <info> [1661250064.5927] device (D0:3F:AA:1D:31:62): state change: unavailable -> disconnected (reason 'none', sys-iface-state: 'managed')
Aug 23 11:21:07 lenovo-x230uu NetworkManager[1248]: <info> [1661250067.9398] device (enp0s25): carrier: link connected
Aug 23 11:21:07 lenovo-x230uu NetworkManager[1248]: <info> [1661250067.9401] device (enp0s25): state change: unavailable -> disconnected (reason 'carrier-changed', sys-iface-state: 'managed')
Aug 23 11:21:07 lenovo-x230uu NetworkManager[1248]: <info> [1661250067.9412] policy: auto-activating connection 'Wired connection 1' (83d94562-7e3b-3ed8-a967-ecbb1533efd1)
Aug 23 11:21:07 lenovo-x230uu NetworkManager[1248]: <info> [1661250067.9417] device (enp0s25): Activation: starting connection 'Wired connection 1' (83d94562-7e3b-3ed8-a967-ecbb1533efd1)
Aug 23 11:21:07 lenovo-x230uu NetworkManager[1248]: <info> [1661250067.9418] device (enp0s25): state change: disconnected -> prepare (reason 'none', sys-iface-state: 'managed')
Aug 23 11:21:07 lenovo-x230uu NetworkManager[1248]: <info> [1661250067.9421] manager: NetworkManager state is now CONNECTING
Aug 23 11:21:07 lenovo-x230uu NetworkManager[1248]: <info> [1661250067.9423] device (enp0s25): state change: prepare -> config (reason 'none', sys-iface-state: 'managed')
Aug 23 11:21:07 lenovo-x230uu NetworkManager[1248]: <info> [1661250067.9427] device (enp0s25): state change: config -> ip-config (reason 'none', sys-iface-state: 'managed')
Aug 23 11:21:07 lenovo-x230uu NetworkManager[1248]: <info> [1661250067.9446] dhcp4 (enp0s25): activation: beginning transaction (timeout in 45 seconds)
Aug 23 11:21:13 lenovo-x230uu NetworkManager[1248]: <info> [1661250073.3108] dhcp4 (enp0s25): state changed new lease, address=109.41.187.122
Aug 23 11:21:13 lenovo-x230uu NetworkManager[1248]: <info> [1661250073.3141] device (enp0s25): state change: ip-config -> ip-check (reason 'none', sys-iface-state: 'managed')
Aug 23 11:21:13 lenovo-x230uu NetworkManager[1248]: <info> [1661250073.3180] device (enp0s25): state change: ip-check -> secondaries (reason 'none', sys-iface-state: 'managed')
Aug 23 11:21:13 lenovo-x230uu NetworkManager[1248]: <info> [1661250073.3182] device (enp0s25): state change: secondaries -> activated (reason 'none', sys-iface-state: 'managed')
Aug 23 11:21:13 lenovo-x230uu NetworkManager[1248]: <info> [1661250073.3186] manager: NetworkManager state is now CONNECTED_LOCAL
Aug 23 11:21:13 lenovo-x230uu NetworkManager[1248]: <info> [1661250073.3190] manager: NetworkManager state is now CONNECTED_SITE
Aug 23 11:21:13 lenovo-x230uu NetworkManager[1248]: <info> [1661250073.3191] policy: set 'Wired connection 1' (enp0s25) as default for IPv4 routing and DNS
Aug 23 11:21:13 lenovo-x230uu NetworkManager[1248]: <info> [1661250073.3198] device (enp0s25): Activation: successful, device activated.
Aug 23 11:21:13 lenovo-x230uu NetworkManager[1248]: <info> [1661250073.3202] manager: NetworkManager state is now CONNECTED_GLOBAL
Aug 23 11:21:19 lenovo-x230uu NetworkManager[1248]: <info> [1661250079.5315] manager: (tun0): new Tun device (/org/freedesktop/NetworkManager/Devices/7)
Aug 23 11:21:19 lenovo-x230uu NetworkManager[1248]: <info> [1661250079.5457] device (tun0): state change: unmanaged -> unavailable (reason 'connection-assumed', sys-iface-state: 'external')
Aug 23 11:21:19 lenovo-x230uu NetworkManager[1248]: <info> [1661250079.5463] device (tun0): state change: unavailable -> disconnected (reason 'connection-assumed', sys-iface-state: 'external')
Aug 23 11:21:19 lenovo-x230uu NetworkManager[1248]: <info> [1661250079.5472] device (tun0): Activation: starting connection 'tun0' (636e9827-baab-4be7-a7c2-5a85705cb915)
Aug 23 11:21:19 lenovo-x230uu NetworkManager[1248]: <info> [1661250079.5474] device (tun0): state change: disconnected -> prepare (reason 'none', sys-iface-state: 'external')
Aug 23 11:21:19 lenovo-x230uu NetworkManager[1248]: <info> [1661250079.5477] device (tun0): state change: prepare -> config (reason 'none', sys-iface-state: 'external')
Aug 23 11:21:19 lenovo-x230uu NetworkManager[1248]: <info> [1661250079.5479] device (tun0): state change: config -> ip-config (reason 'none', sys-iface-state: 'external')
Aug 23 11:21:19 lenovo-x230uu NetworkManager[1248]: <info> [1661250079.5482] device (tun0): state change: ip-config -> ip-check (reason 'none', sys-iface-state: 'external')
Aug 23 11:21:19 lenovo-x230uu NetworkManager[1248]: <info> [1661250079.5573] device (tun0): state change: ip-check -> secondaries (reason 'none', sys-iface-state: 'external')
Aug 23 11:21:19 lenovo-x230uu NetworkManager[1248]: <info> [1661250079.5575] device (tun0): state change: secondaries -> activated (reason 'none', sys-iface-state: 'external')
Aug 23 11:21:19 lenovo-x230uu NetworkManager[1248]: <info> [1661250079.5582] device (tun0): Activation: successful, device activated.
我不明白为什么一个能工作而另一个不能工作。
当它不工作时ping www.google.com
会导致ping: www.google.com: Name or service not known
/etc/network/interfaces
包含
# The loopback network interface
auto lo
iface lo inet loopback
/etc/network/interfaces.d
是空的
当工作输出sudo ifconfig enp0s25
为
enp0s25: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.122 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::d674:d367:b557:214 prefixlen 64 scopeid 0x20<link>
ether 3c:97:0e:ce:42:5f txqueuelen 1000 (Ethernet)
RX packets 7241 bytes 4999361 (4.9 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 6657 bytes 1431722 (1.4 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 20 memory 0xf1500000-f1520000
当不工作时(以前一直在工作,因此有数据包计数):
enp0s25: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.122 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::d674:d367:b557:214 prefixlen 64 scopeid 0x20<link>
ether 3c:97:0e:ce:42:5f txqueuelen 1000 (Ethernet)
RX packets 37277 bytes 34292203 (34.2 MB)
RX errors 0 dropped 2 overruns 0 frame 0
TX packets 25441 bytes 6275182 (6.2 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 20 memory 0xf1500000-f1520000
uname -a
给出
Linux lenevo-x230u 5.15.0-46-generic #49-Ubuntu SMP Thu Aug 4 18:03:25 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
rfkill list all
给出
0: tpacpi_bluetooth_sw: Bluetooth
Soft blocked: no
Hard blocked: no
1: phy0: Wireless LAN
Soft blocked: yes
Hard blocked: no
2: tpacpi_wwan_sw: Wireless WAN
Soft blocked: no
Hard blocked: no
3: hci0: Bluetooth
Soft blocked: no
Hard blocked: no
wifi 的答案是肯定的,因为我目前正在使用有线网络进行测试。如果我重新打开 wifi,rfkill 的行为与预期一致,网络问题仍然存在。
我使用的是内核 5.15.0-46,所以不是这个问题
软件包 backport-iwlwifi-dkms 未安装,因此不是这个问题
任何帮助都非常感谢
答案1
对我来说,问题似乎出在 VPN 终止开关上。我使用 Proton VPN。
答案2
我遇到了同样的问题,按照你的建议重新启动 nmcli 是让它再次工作的唯一方法。不知道为什么。编辑:更新后的问题报告(我的网络选项也没有显示)
答案3
我在终端和症状上得到了完全相同的输出。我不得不重新启动我的调制解调器 +--+-> 路由器 ----以太网到我的 PC_ubuntu。在浪费了我 4 个小时的故障排除后,它立即就起作用了。
答案4
在装有 Ubuntu 22.04.2 的 Lenovo X280 上也遇到了类似的问题,可能是一样的。启动笔记本电脑时,wifi 无法使用。楼主的解决方案对我有用。以下内容/var/log/syslog
可能对解决这个问题有用。
Mar 18 08:20:31 laptop NetworkManager[904]: <info> [1679127631.1105] device (wlp59s0): driver supports Access Point (AP) mode
Mar 18 08:20:31 laptop NetworkManager[904]: <info> [1679127631.1116] manager: (wlp59s0): new 802.11 Wi-Fi device (/org/freedesktop/NetworkManager/Devices/3)
Mar 18 08:20:31 laptop NetworkManager[904]: <info> [1679127631.1119] device (wlp59s0): state change: unmanaged -> unavailable (reason 'managed', sys-iface-state: 'external')
Mar 18 08:20:31 laptop NetworkManager[904]: <info> [1679127631.1133] failed to open /run/network/ifstate
Mar 18 08:20:31 laptop NetworkManager[904]: <info> [1679127631.1195] modem-manager: ModemManager available