程序问答   发布时间:2022-06-01  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了Ubuntu和Mac在同一个家庭网络中找不到对方大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

如何解决Ubuntu和Mac在同一个家庭网络中找不到对方?

开发过程中遇到Ubuntu和Mac在同一个家庭网络中找不到对方的问题如何解决?下面主要结合日常开发的经验,给出你关于Ubuntu和Mac在同一个家庭网络中找不到对方的解决方法建议,希望对你解决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

@R_119_6618@突然出现在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 (将#修改为@)

大佬总结

以上是大佬教程为你收集整理的Ubuntu和Mac在同一个家庭网络中找不到对方全部内容,希望文章能够帮你解决Ubuntu和Mac在同一个家庭网络中找不到对方所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。
标签: