如何解决Ubuntu和Mac在同一个家庭网络中找不到对方
这里是设置:
我有 4 台设备连接到我的家庭 Wifi,我可以确认它们的 IP 地址:
ipad : 192.168.1.19
phone : 192.168.1.5
PC with Ubuntu 18.04 : 192.168.1.14
Macbook Pro : 192.168.1.3
所有 4 个设备都通过 wifi 连接。没有以太网电缆连接
在我的 PC (Ubuntu 18.04) 上,我可以使用 arp -a
来发现 ipad 和手机:
john@home:~$ arp -a
? (192.168.1.19) at 92:c4:78:3c:46:16 [ether] on wlo1
_gateway (192.168.1.1) at e4:7e:66:1f:bf:4c [ether] on wlo1
? (192.168.1.5) at 26:36:46:f9:69:83 [ether] on wlo1
但无法扫描 Macbook Pro。
在 Macbook Pro 上,arp -a
给出以下结果:
john@macbook:~$ arp -a
? (192.168.1.1) at e4:7e:66:1f:bf:4c on en0 ifscope [ethernet]
? (192.168.1.3) at 98:5a:eb:8d:ef:e2 on en0 ifscope permanent [ethernet]
? (192.168.1.5) at 26:36:46:f9:69:83 on en0 ifscope [ethernet]
? (192.168.1.14) at 4:33:c2:c4:2:a2 on en0 ifscope [ethernet]
? (192.168.1.19) at 92:c4:78:3c:46:16 on en0 ifscope [ethernet]
? (224.0.0.251) at 1:0:5e:0:0:fb on en0 ifscope permanent [ethernet]
? (224.0.0.252) at 1:0:5e:0:0:fc on en0 ifscope permanent [ethernet]
? (239.255.255.250) at 1:0:5e:7f:ff:fa on en0 ifscope permanent [ethernet]
如您所见,可以找到 ipad、手机和 PC。 问题是可以ping到ipad和手机是可以的,但是ping到PC却失败了:
john@macbook:~$ ping 192.168.1.19
PING 192.168.1.19 (192.168.1.19): 56 data bytes
64 bytes from 192.168.1.19: icmp_seq=0 ttl=64 time=42.713 ms
64 bytes from 192.168.1.19: icmp_seq=1 ttl=64 time=43.392 ms
64 bytes from 192.168.1.19: icmp_seq=2 ttl=64 time=2.472 ms
64 bytes from 192.168.1.19: icmp_seq=3 ttl=64 time=40.964 ms
john@macbook:~$ ping 192.168.1.5
PING 192.168.1.5 (192.168.1.5): 56 data bytes
64 bytes from 192.168.1.5: icmp_seq=0 ttl=64 time=185.370 ms
64 bytes from 192.168.1.5: icmp_seq=1 ttl=64 time=7.653 ms
64 bytes from 192.168.1.5: icmp_seq=2 ttl=64 time=853.861 ms
64 bytes from 192.168.1.5: icmp_seq=3 ttl=64 time=6.430 ms
64 bytes from 192.168.1.5: icmp_seq=4 ttl=64 time=147.860 ms
64 bytes from 192.168.1.5: icmp_seq=5 ttl=64 time=248.788 ms
john@macbook:~$ ping 192.168.1.14
PING 192.168.1.14 (192.168.1.14): 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
我已确认防火墙 ID 在装有 Ubuntu 18.04 的 PC 上处于非活动状态:
john@home:~$ sudo ufw status
[sudo] password for john:
Status: inactive
这里出了什么问题?为什么 Macbook Pro 对 PC 不可见,而 PC 对 MacBook 可见?为什么 ping 失败?
以下是我第二天观察到的:
现在我在 PC 中执行 arp -a
命令,神秘地我可以在输出中看到 Macbook 设备和电话:
_gateway (192.168.1.1) at e4:7e:66:1f:bf:4c [ether] on wlo1
? (192.168.1.5) at 26:36:46:f9:69:83 [ether] on wlo1
? (192.168.1.3) at <incomplete> on wlo1
我不知道怎么突然出现在arp表中。但是,ping 会给出:
john@home:~$ ping 192.168.1.3
PING 192.168.1.3 (192.168.1.14) 56(84) bytes of data.
From 192.168.1.14 icmp_seq=1 Destination Host Unreachable
From 192.168.1.14 icmp_seq=2 Destination Host Unreachable
From 192.168.1.14 icmp_seq=3 Destination Host Unreachable
From 192.168.1.14 icmp_seq=4 Destination Host Unreachable
From 192.168.1.14 icmp_seq=5 Destination Host Unreachable
From 192.168.1.14 icmp_seq=6 Destination Host Unreachable
From 192.168.1.14 icmp_seq=7 Destination Host Unreachable
From 192.168.1.14 icmp_seq=8 Destination Host Unreachable
From 192.168.1.14 icmp_seq=9 Destination Host Unreachable
^C
--- 192.168.1.3 ping statistics ---
10 packets transmitted,0 received,+9 errors,100% packet loss,time 9195ms
pipe 4
john@home:~$ ^C
为什么PC端不一致?有时您可以从 PC 上发现 Macbook,有时则不能。
而且您无法在 PC 和 Macbook 之间以任何方式 ping。但是你可以从 Macbook ping Phone/ipad?
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。