所有设备只能 ping 自己和路由器(lan)

所有设备只能 ping 自己和路由器(lan)

当我尝试 ping 我的局域网中的任何设备时,我得到以下输出:

ping 192.168.1.104     

PING 192.168.1.104 (192.168.1.104) 56(84) bytes of data.
From 192.168.1.108 icmp_seq=1 Destination Host Unreachable
From 192.168.1.108 icmp_seq=2 Destination Host Unreachable
From 192.168.1.108 icmp_seq=3 Destination Host Unreachable
From 192.168.1.108 icmp_seq=4 Destination Host Unreachable
From 192.168.1.108 icmp_seq=5 Destination Host Unreachable
From 192.168.1.108 icmp_seq=6 Destination Host Unreachable

只有当 ping 通自身和路由器时,ping 才会成功:

本身

ping 192.168.1.108                                                                                                                                            

PING 192.168.1.108 (192.168.1.108) 56(84) bytes of data.
64 bytes from 192.168.1.108: icmp_seq=1 ttl=64 time=0.029 ms
64 bytes from 192.168.1.108: icmp_seq=2 ttl=64 time=0.042 ms
64 bytes from 192.168.1.108: icmp_seq=3 ttl=64 time=0.065 ms
64 bytes from 192.168.1.108: icmp_seq=4 ttl=64 time=0.063 ms

路由器 -

ping 192.168.1.1  

PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=2.92 ms
64 bytes from 192.168.1.1: icmp_seq=2 ttl=64 time=3.17 ms
64 bytes from 192.168.1.1: icmp_seq=3 ttl=64 time=1.05 ms
64 bytes from 192.168.1.1: icmp_seq=4 ttl=64 time=1.38 ms

用 3 台设备(2 台 Linux 和 1 台 Android)进行了测试,得到了相同的输出。所有设备都通过 wifi 连接到路由器。所有主机都已启动。

一些故障排除的输出:

是否配置

路由 -n,sudo iptables -L,arp -a,nmap -Sn 192.168.1.1/24

我试过了sudo ip route add 192.168.1.104/32 via 192.168.1.1 dev wlan0sudo ip route add 192.168.1.104 via 192.168.1.1 dev wlan0但输出结果如下:

ping 192.168.1.104

PING 192.168.1.104 (192.168.1.104) 56(84) bytes of data.
From 192.168.1.1: icmp_seq=2 Redirect Host(New nexthop: 192.168.1.104)
From 192.168.1.1: icmp_seq=3 Redirect Host(New nexthop: 192.168.1.104)
From 192.168.1.1: icmp_seq=4 Redirect Host(New nexthop: 192.168.1.104)
From 192.168.1.1: icmp_seq=5 Redirect Host(New nexthop: 192.168.1.104)
From 192.168.1.1: icmp_seq=6 Redirect Host(New nexthop: 192.168.1.104)
From 192.168.1.1: icmp_seq=8 Redirect Host(New nexthop: 192.168.1.104)
From 192.168.1.1: icmp_seq=11 Redirect Host(New nexthop: 192.168.1.104)
From 192.168.1.1: icmp_seq=17 Redirect Host(New nexthop: 192.168.1.104)
From 192.168.1.108 icmp_seq=26 Destination Host Unreachable
From 192.168.1.108 icmp_seq=27 Destination Host Unreachable
From 192.168.1.108 icmp_seq=28 Destination Host Unreachable
From 192.168.1.108 icmp_seq=29 Destination Host Unreachable
From 192.168.1.108 icmp_seq=30 Destination Host Unreachable
From 192.168.1.108 icmp_seq=31 Destination Host Unreachable
From 192.168.1.108 icmp_seq=32 Destination Host Unreachable

由于这是一个常见问题,我确实尝试了一些其他解决方案,但由于它们都不起作用,所以我决定对此提出另一个问题。

答案1

由于这是在同一个子网中,因此 IP 路由在这里完全不相关。不需要路由。

我注意到这是一个 WiFi 接口。有些 WiFi 路由器有“隔离客户端”或类似设置。这可能是罪魁祸首。请查看并禁用它(如果已打开)。

除此之外,我只能想象这是 192.168.1.104 的错误……也许它的网络掩码错误?你能再检查一下它是否是 255.255.255.0 吗?

相关内容