从 20.04 升级到 22.04.1 后,我无法通过以太网或 wifi 访问网络。
我可以通过命令行或 GUI 启动两个接口,它们显示为已连接,并通过 dhcp 获取 ip 地址。
但是,我无法 ping 任何东西(通过地址)——甚至连环回地址都无法 ping 。
防火墙已禁用。路由表与我的另一台运行正常的机器相匹配。
任何可以调试这个问题的想法都非常感谢!
网络管理器状态
● NetworkManager.service - Network Manager
Loaded: loaded (/lib/systemd/system/NetworkManager.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2022-08-17 18:30:16 BST; 1 day 19h ago
Docs: man:NetworkManager(8)
Main PID: 1582 (NetworkManager)
Tasks: 3 (limit: 16572)
Memory: 11.3M
CPU: 5.092s
CGroup: /system.slice/NetworkManager.service
└─1582 /usr/sbin/NetworkManager --no-daemon
Aug 19 13:54:43 deepthought NetworkManager[1582]: <info> [1660913683.8481] dhcp4 (enp34s0): activation: beginning transaction (timeout in 45 seconds)
Aug 19 13:54:43 deepthought NetworkManager[1582]: <info> [1660913683.8654] dhcp4 (enp34s0): state changed new lease, address=192.168.0.225
Aug 19 13:54:43 deepthought NetworkManager[1582]: <info> [1660913683.8679] device (enp34s0): state change: ip-config -> ip-check (reason 'none', sys-iface-state: 'managed')
Aug 19 13:54:43 deepthought NetworkManager[1582]: <info> [1660913683.9135] device (enp34s0): state change: ip-check -> secondaries (reason 'none', sys-iface-state: 'managed')
Aug 19 13:54:43 deepthought NetworkManager[1582]: <info> [1660913683.9140] device (enp34s0): state change: secondaries -> activated (reason 'none', sys-iface-state: 'managed')
Aug 19 13:54:43 deepthought NetworkManager[1582]: <info> [1660913683.9146] manager: NetworkManager state is now CONNECTED_LOCAL
Aug 19 13:54:43 deepthought NetworkManager[1582]: <info> [1660913683.9150] manager: NetworkManager state is now CONNECTED_SITE
Aug 19 13:54:43 deepthought NetworkManager[1582]: <info> [1660913683.9151] policy: set 'netplan-enp34s0' (enp34s0) as default for IPv4 routing and DNS
Aug 19 13:54:43 deepthought NetworkManager[1582]: <info> [1660913683.9158] device (enp34s0): Activation: successful, device activated.
Aug 19 13:54:53 deepthought NetworkManager[1582]: <info> [1660913693.3834] agent-manager: agent[438527325db3dfb9,:1.82/org.gnome.Shell.NetworkAgent/1000]: agent registered
解决
systemd-resolved 看起来也不好,尽管我现在还不能使用名称。
● systemd-resolved.service - Network Name Resolution
Loaded: loaded (/lib/systemd/system/systemd-resolved.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2022-08-17 18:30:15 BST; 1 day 19h ago
Docs: man:systemd-resolved.service(8)
man:org.freedesktop.resolve1(5)
https://www.freedesktop.org/wiki/Software/systemd/writing-network-configuration-managers
https://www.freedesktop.org/wiki/Software/systemd/writing-resolver-clients
Main PID: 1278 (systemd-resolve)
Status: "Processing requests..."
Tasks: 1 (limit: 16572)
Memory: 9.4M
CPU: 517ms
CGroup: /system.slice/systemd-resolved.service
└─1278 /lib/systemd/systemd-resolved
Aug 19 14:19:16 deepthought systemd-resolved[1278]: Using degraded feature set UDP instead of TCP for DNS server 192.168.0.2.
Aug 19 14:19:26 deepthought systemd-resolved[1278]: Using degraded feature set TCP instead of UDP for DNS server 192.168.0.2.
Aug 19 14:19:57 deepthought systemd-resolved[1278]: Using degraded feature set UDP instead of TCP for DNS server 192.168.0.2.
Aug 19 14:20:08 deepthought systemd-resolved[1278]: Using degraded feature set TCP instead of UDP for DNS server 192.168.0.2.
Aug 19 14:23:35 deepthought systemd-resolved[1278]: Using degraded feature set UDP instead of TCP for DNS server 192.168.0.2.
Aug 19 14:23:45 deepthought systemd-resolved[1278]: Using degraded feature set TCP instead of UDP for DNS server 192.168.0.2.
Aug 19 14:24:16 deepthought systemd-resolved[1278]: Using degraded feature set UDP instead of TCP for DNS server 192.168.0.2.
Aug 19 14:24:26 deepthought systemd-resolved[1278]: Using degraded feature set TCP instead of UDP for DNS server 192.168.0.2.
Aug 19 14:24:57 deepthought systemd-resolved[1278]: Using degraded feature set UDP instead of TCP for DNS server 192.168.0.2.
Aug 19 14:25:08 deepthought systemd-resolved[1278]: Using degraded feature set TCP instead of UDP for DNS server 192.168.0.2.
答案1
我花了一天时间,尝试了很多方法。最后,我发现这是防火墙的问题。我禁用了防火墙,它很快就能连接到互联网。
但是,我还没弄清楚防火墙设置中的哪些部分导致了这种情况。
sudo ufw 禁用
----------------
我遇到的问题是:从 20.04 升级到 22.04 后,以太网连接没有互联网!
- ping 127.0.0.1 不工作,100%丢失
- ping 192.168.68.1 路由器,不工作,100% 丢失
- 但本地网络工作正常,其他设备可以访问网络共享硬盘
- 我可以从其他设备 ssh 到 PC,甚至可以从家庭网络外部使用 openvpn 在家庭网络外部工作
答案2
跟踪耿洁与ufw的选项,发现了真正的问题
netfilter-persistent 包和 ufw 之间存在冲突。
您必须删除 netfilter-persistent
sudo apt purge netfilter-persistent
然后重新启动系统。
如果这样做,则不需要停止 ufw 服务。
事实上,当你运行 ufw 检查要求测试脚本时,你会发现它会说 netfilter-persistent 可能会发生冲突。在 Launchpad 错误跟踪器中发现的想法。
sudo /usr/share/ufw/check-requirements