最近我的 MacBook 时不时会断网,这让我很头疼。大约每 5 分钟一次。所以我一直在尝试确定故障发生在哪里。昨天,Virgin Media 帮我将 SuperHub 恢复出厂设置,问题似乎暂时解决了,但今天早上同样的问题又出现了。
我的诊断已达到以下命令:
ping -c 5 127.0.0.1 && ping -c 5 192.168.0.1 && ping -c 5 8.8.8.8 && ping -c 5 www.reddit.com
输出结果如下:
PING 127.0.0.1 (127.0.0.1): 56 data bytes
64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.057 ms
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.071 ms
64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.126 ms
64 bytes from 127.0.0.1: icmp_seq=3 ttl=64 time=0.120 ms
64 bytes from 127.0.0.1: icmp_seq=4 ttl=64 time=0.077 ms
--- 127.0.0.1 ping statistics ---
5 packets transmitted, 5 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 0.057/0.090/0.126/0.028 ms
PING 192.168.0.1 (192.168.0.1): 56 data bytes
Request timeout for icmp_seq 0
Request timeout for icmp_seq 1
Request timeout for icmp_seq 2
Request timeout for icmp_seq 3
--- 192.168.0.1 ping statistics ---
5 packets transmitted, 0 packets received, 100.0% packet loss
由于这会停止 bash 命令,因此我会单独运行其余命令。
ping -c 5 8.8.8.8 && ping -c 5 www.reddit.com
并得到:
PING 8.8.8.8 (8.8.8.8): 56 data bytes
64 bytes from 8.8.8.8: icmp_seq=0 ttl=54 time=17.944 ms
64 bytes from 8.8.8.8: icmp_seq=1 ttl=54 time=18.489 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=54 time=19.976 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=54 time=17.432 ms
64 bytes from 8.8.8.8: icmp_seq=4 ttl=54 time=15.882 ms
--- 8.8.8.8 ping statistics ---
5 packets transmitted, 5 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 15.882/17.945/19.976/1.337 ms
PING www.reddit.com (198.41.208.138): 56 data bytes
64 bytes from 198.41.208.138: icmp_seq=0 ttl=58 time=10.835 ms
64 bytes from 198.41.208.138: icmp_seq=1 ttl=58 time=40.317 ms
64 bytes from 198.41.208.138: icmp_seq=2 ttl=58 time=12.355 ms
64 bytes from 198.41.208.138: icmp_seq=3 ttl=58 time=12.904 ms
64 bytes from 198.41.208.138: icmp_seq=4 ttl=58 time=18.540 ms
--- www.reddit.com ping statistics ---
5 packets transmitted, 5 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 10.835/18.990/40.317/10.978 ms
为什么我无法 ping 通我的路由器192.168.0.1
,但可以 ping 通谷歌8.8.8.8
?这是否表明可能存在什么问题?
需要确认的是,我理解 192.168.0.1 是路由器,因为网络偏好设置显示的连接路由器 IP 就是这个,也是 Virgin Media SuperHubs 上的默认 IP。
en0 的 ifconfig 输出为:
en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
ether 34:36:3b:cb:22:9c
inet 192.168.0.4 netmask 0xffffff00 broadcast 192.168.0.255
nd6 options=1<PERFORMNUD>
media: autoselect
status: active
我删除了有关 inet6 地址的行,因为这篇文章。
答案1
ICMP 请求可以在多个级别被拒绝 - 主机、消费者网络设备以及更高级别(上游)。很多原因这样做,并且某些设备/操作系统默认以这种方式运行是很常见的。
如果您对帖子中提供的 IP 地址有信心,您可以检查设备是否有这样的配置。