就像我的标题一样,我无法 ping 通我的网络之外的网络,我在一台迷你电脑上使用 Ubuntu Server 22.04.2 LTS 有一段时间了,我在一年前安装操作系统时设置了机器上的 wifi 设置,从今天早上开始,我就无法连接到我的网络之外的网络,我的网关也无法访问
平 Cloudlare
PING 1.1.1.1 (1.1.1.1) 56(84) bytes of data.
From 192.168.2.26 icmp_seq=1 Destination Host Unreachable
--- 1.1.1.1 ping statistics ---
6 packets transmitted, 0 received, +4 errors, 100% packet loss, time 5060ms
pipe 3
Ping 网关
PING 192.168.2.1 (192.168.2.1) 56(84) bytes of data.
From 192.168.2.26 icmp_seq=1 Destination Host Unreachable
--- 192.168.2.1 ping statistics ---
9 packets transmitted, 0 received, +6 errors, 100% packet loss, time 8123ms
pipe 3
我想我的网络配置出了问题,但由于我不记得在我的网络配置中更改了任何内容,所以我有点迷茫,在配置网络设置方面我还是个新手。
我检查了我的服务,发现有一个服务失败了。
× systemd-networkd-wait-online.service - Wait for Network to be Configured
Loaded: loaded (/etc/systemd/system/systemd-networkd-wait-online.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Thu 2023-08-03 01:37:12 UTC; 1h 53min ago
Docs: man:systemd-networkd-wait-online.service(8)
Process: 683 ExecStart=/lib/systemd/systemd-networkd-wait-online --timeout=10 (code=exited, status=1/FAILURE)
Main PID: 683 (code=exited, status=1/FAILURE)
CPU: 36ms
Aug 03 01:37:01 bwd-server systemd[1]: Starting Wait for Network to be Configured...
Aug 03 01:37:05 bwd-server systemd-networkd-wait-online[683]: managing: wlp1s0
Aug 03 01:37:11 bwd-server systemd-networkd-wait-online[683]: managing: wlp1s0
Aug 03 01:37:12 bwd-server systemd-networkd-wait-online[683]: Timeout occurred while waiting for network connectivity.
Aug 03 01:37:12 bwd-server systemd[1]: systemd-networkd-wait-online.service: Main process exited, code=exited, status=1/FAILURE
Aug 03 01:37:12 bwd-server systemd[1]: systemd-networkd-wait-online.service: Failed with result 'exit-code'.
Aug 03 01:37:12 bwd-server systemd[1]: Failed to start Wait for Network to be Configured.
所以如果这是准确的,那我的配置就有问题。我只是找不到问题出在哪里。我已经用谷歌查过了,但我得到的大部分结果是设备 ip 和网关不在同一网络上的问题,我怀疑情况并非如此
我启动了一些网络服务,它们都是可访问的,我可以通过 ssh 进入服务器,而且我可以从我的电脑 ping 我的服务器,也可以从我的服务器 ping 我的电脑,这样我的路由器就可以将它们路由到一起。
知识产权
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: ens1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN group default qlen 1000
link/ether 84:39:4c:00:31:05 brd ff:ff:ff:ff:ff:ff
altname enp2s0
3: wlp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 84:c5:a6:7a:d3:de brd ff:ff:ff:ff:ff:ff
inet 192.168.2.26/24 metric 600 brd 192.168.2.255 scope global dynamic wlp1s0
valid_lft 257633sec preferred_lft 257633sec
inet6 fd24:3316:d46c:66f2:86c5:a6ff:fe7a:d3de/64 scope global dynamic mngtmpaddr noprefixroute
valid_lft 250sec preferred_lft 250sec
inet6 fe80::86c5:a6ff:fe7a:d3de/64 scope link
valid_lft forever preferred_lft forever
4: br-3ad3df7e63f4: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default
link/ether 02:42:f3:66:93:14 brd ff:ff:ff:ff:ff:ff
inet 172.18.0.1/16 brd 172.18.255.255 scope global br-3ad3df7e63f4
valid_lft forever preferred_lft forever
5: br-823e7568d7d4: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default
link/ether 02:42:92:28:93:c5 brd ff:ff:ff:ff:ff:ff
inet 172.21.0.1/16 brd 172.21.255.255 scope global br-823e7568d7d4
valid_lft forever preferred_lft forever
6: br-921e84efdc37: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default
link/ether 02:42:e1:d0:9b:30 brd ff:ff:ff:ff:ff:ff
inet 172.19.0.1/16 brd 172.19.255.255 scope global br-921e84efdc37
valid_lft forever preferred_lft forever
inet6 fe80::42:e1ff:fed0:9b30/64 scope link
valid_lft forever preferred_lft forever
7: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default
link/ether 02:42:09:95:f5:63 brd ff:ff:ff:ff:ff:ff
inet 172.17.0.1/16 brd 172.17.255.255 scope global docker0
valid_lft forever preferred_lft forever
8: br-c60aef3af76a: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default
link/ether 02:42:c9:e1:af:7f brd ff:ff:ff:ff:ff:ff
inet 172.24.0.1/16 brd 172.24.255.255 scope global br-c60aef3af76a
valid_lft forever preferred_lft forever
inet6 fe80::42:c9ff:fee1:af7f/64 scope link
valid_lft forever preferred_lft forever
14: veth92f0294@if13: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-c60aef3af76a state UP group default
link/ether ae:f0:a4:f2:43:3c brd ff:ff:ff:ff:ff:ff link-netnsid 3
inet6 fe80::acf0:a4ff:fef2:433c/64 scope link
valid_lft forever preferred_lft forever
62: veth33540bb@if61: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-c60aef3af76a state UP group default
link/ether 6e:29:9b:d1:ba:e3 brd ff:ff:ff:ff:ff:ff link-netnsid 1
inet6 fe80::6c29:9bff:fed1:bae3/64 scope link
valid_lft forever preferred_lft forever
66: vethff333e0@if65: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-921e84efdc37 state UP group default
link/ether 56:57:7a:ed:ee:b5 brd ff:ff:ff:ff:ff:ff link-netnsid 0
inet6 fe80::5457:7aff:feed:eeb5/64 scope link
valid_lft forever preferred_lft forever
路由
default via 192.168.2.1 dev wlp1s0 proto dhcp src 192.168.2.26 metric 600
172.17.0.0/16 dev docker0 proto kernel scope link src 172.17.0.1 linkdown
172.18.0.0/16 dev br-3ad3df7e63f4 proto kernel scope link src 172.18.0.1 linkdown
172.19.0.0/16 dev br-921e84efdc37 proto kernel scope link src 172.19.0.1
172.21.0.0/16 dev br-823e7568d7d4 proto kernel scope link src 172.21.0.1 linkdown
172.24.0.0/16 dev br-c60aef3af76a proto kernel scope link src 172.24.0.1
192.168.2.0/24 dev wlp1s0 proto kernel scope link src 192.168.2.26 metric 600
192.168.2.1 dev wlp1s0 proto dhcp scope link src 192.168.2.26 metric 600
207.164.234.129 via 192.168.2.1 dev wlp1s0 proto dhcp src 192.168.2.26 metric 600
邻居
172.24.0.3 dev br-c60aef3af76a lladdr 02:42:ac:18:00:03 STALE
192.168.2.1 dev wlp1s0 INCOMPLETE
192.168.2.43 dev wlp1s0 lladdr a0:a4:c5:22:2f:c7 REACHABLE
172.19.0.2 dev br-921e84efdc37 lladdr 02:42:ac:13:00:02 STALE
192.168.2.44 dev wlp1s0 lladdr d4:3a:2c:a7:ba:69 REACHABLE
172.24.0.2 dev br-c60aef3af76a lladdr 02:42:ac:18:00:02 REACHABLE
172.24.0.4 dev br-c60aef3af76a lladdr 02:42:ac:18:00:04 STALE
192.168.2.16 dev wlp1s0 lladdr f2:ee:ce:93:b3:4c STALE
192.168.2.10 dev wlp1s0 lladdr b2:00:b8:ab:66:cc REACHABLE
fe80::6666:24ff:fefa:9ba0 dev wlp1s0 lladdr 64:66:24:fa:9b:a0 router STALE
这是我在研究中看到的最常用命令的输出。我知道我拥有的大多数接口都来自docker。如果我忘记了某些可以帮助您找到问题的东西,请告诉我
编辑
我的网关可以通过其他设备(例如我的笔记本电脑)访问:
PING 192.168.2.1 (192.168.2.1) 56(84) bytes of data.
64 bytes from 192.168.2.1: icmp_seq=1 ttl=62 time=6.19 ms
--- 192.168.2.1 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
rtt min/avg/max/mdev = 2.790/4.123/6.185/1.478 ms
答案1
您的路由器地址为 192.168.2.1,看起来好像该路由器已死机或其接口已断开连接。通过 ping 该地址以及对该命令的响应可以确认这一点ip neigh
,请参阅INCOMPLETE
子句中的这一行:
192.168.2.1 dev wlp1s0 INCOMPLETE
同一 192.168.2.0/24 网络上的其他设备可用,请参阅下一行命令ip neigh
:
192.168.2.44 dev wlp1s0 lladdr d4:3a:2c:a7:ba:69 REACHABLE
192.168.2.10 dev wlp1s0 lladdr b2:00:b8:ab:66:cc REACHABLE
该故障很可能与路由器有关。从网络上的其他设备测试路由器 192.168.2.1 的可用性。