Mac 电脑收到 ping 但没有响应

Mac 电脑收到 ping 但没有响应

这也发布在Apple 的支持论坛

我发现了多个类似的问题,但没有一个能帮助我。

我有一个家庭网络,其中有 2 台机器连接到 Wi-Fi 路由器。从 A 到 B 的 Ping 因超时而失败。tcpdump显示机器 B 确实看到了传入的请求。从 B 到 A 的 Ping 成功。两台机器都运行 Mac OS,防火墙已禁用,尝试使用我的 Android 手机的热点 Wi-Fi 连接它们,结果相同。

我想通过远程桌面将我的笔记本电脑(MacBook)连接到固定电脑(Mac mini)。


路由器


MacBook

  • 操作系统 = Catalina 10.15.6

  • IP =192.168.1.231

  • 防火墙:关闭

  • ping适用于:,,localhost(路由器),(本身)127.0.0.1192.168.1.1192.168.1.231

  • ping超时:192.168.1.185(mac mini)

  • nslookup sams-mac-mini成功解析为192.168.1.185

netstat -rn

Routing tables

Internet:
Destination        Gateway            Flags        Netif Expire
default            192.168.1.1        UGSc           en0
127                127.0.0.1          UCS            lo0
127.0.0.1          127.0.0.1          UH             lo0
169.254            link#6             UCS            en0      !
192.168.1          link#6             UCS            en0      !
192.168.1.1/32     link#6             UCS            en0      !
192.168.1.1        20:1f:31:aa:e5:90  UHLWIir        en0   1190
192.168.1.185      3c:22:fb:a8:43:ed  UHLWI          en0    902
192.168.1.231/32   link#6             UCS            en0      !
224.0.0/4          link#6             UmCS           en0      !
224.0.0.251        1:0:5e:0:0:fb      UHmLWI         en0
239.192.152.143    1:0:5e:40:98:8f    UHmLWI         en0
239.255.255.250    1:0:5e:7f:ff:fa    UHmLWI         en0
255.255.255.255/32 link#6             UCS            en0      !

Internet6:
Destination                             Gateway                         Flags         Netif Expire
default                                 fe80::221f:31ff:feaa:e590%en0   UGc             en0
default                                 fe80::%utun0                    UGcI          utun0
default                                 fe80::%utun1                    UGcI          utun1
default                                 fe80::%utun2                    UGcI          utun2
default                                 fe80::%utun3                    UGcI          utun3
::1                                     ::1                             UHL             lo0
2001:7d0:84b0:1580::/64                 link#6                          UC              en0
2001:7d0:84b0:1580:4bf:ddc7:25f2:30f1   3c:22:fb:40:fd:5d               UHL             lo0
2001:7d0:84b0:1580:7c49:fd29:22b:1ea2   3c:22:fb:a8:43:ed               UHLWIi          en0
2001:7d0:84b0:1580:817a:55f7:e052:2518  link#6                          UHLWI           en0
2001:7d0:84b0:1580:bd28:6e56:8081:20c1  3c:22:fb:40:fd:5d               UHL             lo0
fe80::%lo0/64                           fe80::1%lo0                     UcI             lo0
fe80::1%lo0                             link#1                          UHLI            lo0
fe80::%en5/64                           link#4                          UCI             en5
fe80::aede:48ff:fe00:1122%en5           ac:de:48:0:11:22                UHLI            lo0
fe80::aede:48ff:fe33:4455%en5           ac:de:48:33:44:55               UHLWIi          en5
fe80::%en0/64                           link#6                          UCI             en0
fe80::c3d:9dc9:9593:12c8%en0            3c:22:fb:40:fd:5d               UHLI            lo0
fe80::1477:d6f9:e406:2a44%en0           3c:22:fb:a8:43:ed               UHLWI           en0
fe80::1826:bd30:ffca:e2af%en0           88:a9:b7:65:a0:4b               UHLWI           en0
fe80::221f:31ff:feaa:e590%en0           20:1f:31:aa:e5:90               UHLWIir         en0
fe80::%awdl0/64                         link#13                         UCI           awdl0
fe80::44ad:a1ff:febb:3021%awdl0         46:ad:a1:bb:30:21               UHLWIi        awdl0
fe80::a861:11ff:fea8:3756%awdl0         aa:61:11:a8:37:56               UHLI            lo0
fe80::%llw0/64                          link#14                         UCI            llw0
fe80::44ad:a1ff:febb:3021%llw0          46:ad:a1:bb:30:21               UHLWI          llw0
fe80::a861:11ff:fea8:3756%llw0          aa:61:11:a8:37:56               UHLI            lo0
fe80::%utun0/64                         fe80::e39:7f8:b2fb:4473%utun0   UcI           utun0
fe80::e39:7f8:b2fb:4473%utun0           link#15                         UHLI            lo0
fe80::%utun1/64                         fe80::245e:5d7e:31eb:6ac6%utun1 UcI           utun1
fe80::245e:5d7e:31eb:6ac6%utun1         link#16                         UHLI            lo0
fe80::%utun2/64                         fe80::4175:99b7:91f2:1a2e%utun2 UcI           utun2
fe80::4175:99b7:91f2:1a2e%utun2         link#17                         UHLI            lo0
fe80::%utun3/64                         fe80::19bd:c7d7:c780:8e80%utun3 UcI           utun3
fe80::19bd:c7d7:c780:8e80%utun3         link#18                         UHLI            lo0
ff01::%lo0/32                           ::1                             UmCI            lo0
ff01::%en5/32                           link#4                          UmCI            en5
ff01::%en0/32                           link#6                          UmCI            en0
ff01::%awdl0/32                         link#13                         UmCI          awdl0
ff01::%llw0/32                          link#14                         UmCI           llw0
ff01::%utun0/32                         fe80::e39:7f8:b2fb:4473%utun0   UmCI          utun0
ff01::%utun1/32                         fe80::245e:5d7e:31eb:6ac6%utun1 UmCI          utun1
ff01::%utun2/32                         fe80::4175:99b7:91f2:1a2e%utun2 UmCI          utun2
ff01::%utun3/32                         fe80::19bd:c7d7:c780:8e80%utun3 UmCI          utun3
ff02::%lo0/32                           ::1                             UmCI            lo0
ff02::%en5/32                           link#4                          UmCI            en5
ff02::%en0/32                           link#6                          UmCI            en0
ff02::%awdl0/32                         link#13                         UmCI          awdl0
ff02::%llw0/32                          link#14                         UmCI           llw0
ff02::%utun0/32                         fe80::e39:7f8:b2fb:4473%utun0   UmCI          utun0
ff02::%utun1/32                         fe80::245e:5d7e:31eb:6ac6%utun1 UmCI          utun1
ff02::%utun2/32                         fe80::4175:99b7:91f2:1a2e%utun2 UmCI          utun2
ff02::%utun3/32                         fe80::19bd:c7d7:c780:8e80%utun3 UmCI          utun3

迷你苹果电脑

  • 操作系统 = Catalina 10.15.6

  • IP =192.168.1.185

  • 防火墙:关闭

  • ping适用于:、、localhost(路由器)、(本身)、(MacBook)127.0.0.1192.168.1.1192.168.1.185192.168.1.231

  • nslookup sams-mbp成功解析为192.168.1.231

注意:我确实安装了 VPN,但目前尚未连接/使用,因此您可能会在这里看到与此相关的内容。

netstat -rn

Routing tables

Internet:
Destination        Gateway            Flags        Netif Expire
default            192.168.1.1        UGSc           en1
127                127.0.0.1          UCS            lo0
127.0.0.1          127.0.0.1          UH             lo0
169.254            link#7             UCS            en1      !
192.168.1          link#7             UCS            en1      !
192.168.1.1/32     link#7             UCS            en1      !
192.168.1.1        20:1f:31:aa:e5:90  UHLWIir        en1   1196
192.168.1.185/32   link#7             UCS            en1      !
192.168.1.255      ff:ff:ff:ff:ff:ff  UHLWbI         en1      !
224.0.0/4          link#7             UmCS           en1      !
224.0.0.251        1:0:5e:0:0:fb      UHmLWI         en1
239.255.255.250    1:0:5e:7f:ff:fa    UHmLWI         en1
255.255.255.255/32 link#7             UCS            en1      !

Internet6:
Destination                             Gateway                         Flags         Netif Expire
default                                 fe80::221f:31ff:feaa:e590%en1   UGc             en1
default                                 fe80::%utun0                    UGcI          utun0
default                                 fe80::%utun1                    UGcI          utun1
default                                 fe80::%utun2                    UGcI          utun2
default                                 fe80::%utun3                    UGcI          utun3
::1                                     ::1                             UHL             lo0
2001:7d0:84b0:1580::/64                 link#7                          UC              en1
2001:7d0:84b0:1580:1c09:ef76:fc0f:6787  3c:22:fb:a8:43:ed               UHL             lo0
2001:7d0:84b0:1580:409c:597b:219b:31cd  3c:22:fb:a8:43:ed               UHL             lo0
2001:7d0:84b0:1580:8d39:c6a:9520:65a8   link#7                          UHLWI           en1
fe80::%lo0/64                           fe80::1%lo0                     UcI             lo0
fe80::1%lo0                             link#1                          UHLI            lo0
fe80::%en6/64                           link#5                          UCI             en6
fe80::aede:48ff:fe00:1122%en6           ac:de:48:0:11:22                UHLI            lo0
fe80::aede:48ff:fe33:4455%en6           ac:de:48:33:44:55               UHLWIi          en6
fe80::%en1/64                           link#7                          UCI             en1
fe80::1477:d6f9:e406:2a44%en1           3c:22:fb:a8:43:ed               UHLI            lo0
fe80::221f:31ff:feaa:e590%en1           20:1f:31:aa:e5:90               UHLWIir         en1
fe80::%awdl0/64                         link#9                          UCI           awdl0
fe80::5892:a4ff:fe11:f46c%awdl0         5a:92:a4:11:f4:6c               UHLI            lo0
fe80::a861:11ff:fea8:3756%awdl0         aa:61:11:a8:37:56               UHLWIi        awdl0
fe80::%llw0/64                          link#10                         UCI            llw0
fe80::5892:a4ff:fe11:f46c%llw0          5a:92:a4:11:f4:6c               UHLI            lo0
fe80::a861:11ff:fea8:3756%llw0          aa:61:11:a8:37:56               UHLWI          llw0
fe80::%utun0/64                         fe80::35c8:509b:4d5f:e060%utun0 UcI           utun0
fe80::35c8:509b:4d5f:e060%utun0         link#16                         UHLI            lo0
fe80::%utun1/64                         fe80::f4f5:d2b6:c69e:755e%utun1 UcI           utun1
fe80::f4f5:d2b6:c69e:755e%utun1         link#17                         UHLI            lo0
fe80::%utun2/64                         fe80::19c4:e545:e84:a3bc%utun2  UcI           utun2
fe80::19c4:e545:e84:a3bc%utun2          link#18                         UHLI            lo0
fe80::%utun3/64                         fe80::f9fd:1490:c5f0:37ef%utun3 UcI           utun3
fe80::f9fd:1490:c5f0:37ef%utun3         link#20                         UHLI            lo0
ff01::%lo0/32                           ::1                             UmCI            lo0
ff01::%en0/32                           link#4                          UmCI            en0
ff01::%en6/32                           link#5                          UmCI            en6
ff01::%en1/32                           link#7                          UmCI            en1
ff01::%awdl0/32                         link#9                          UmCI          awdl0
ff01::%llw0/32                          link#10                         UmCI           llw0
ff01::%utun0/32                         fe80::35c8:509b:4d5f:e060%utun0 UmCI          utun0
ff01::%utun1/32                         fe80::f4f5:d2b6:c69e:755e%utun1 UmCI          utun1
ff01::%utun2/32                         fe80::19c4:e545:e84:a3bc%utun2  UmCI          utun2
ff01::%utun3/32                         fe80::f9fd:1490:c5f0:37ef%utun3 UmCI          utun3
ff02::%lo0/32                           ::1                             UmCI            lo0
ff02::%en0/32                           link#4                          UmCI            en0
ff02::%en6/32                           link#5                          UmCI            en6
ff02::%en1/32                           link#7                          UmCI            en1
ff02::%awdl0/32                         link#9                          UmCI          awdl0
ff02::%llw0/32                          link#10                         UmCI           llw0
ff02::%utun0/32                         fe80::35c8:509b:4d5f:e060%utun0 UmCI          utun0
ff02::%utun1/32                         fe80::f4f5:d2b6:c69e:755e%utun1 UmCI          utun1
ff02::%utun2/32                         fe80::19c4:e545:e84:a3bc%utun2  UmCI          utun2
ff02::%utun3/32                         fe80::f9fd:1490:c5f0:37ef%utun3 UmCI          utun3

测试

在 Mac mini 上监听 ping 请求:

  1. tcpdump -v host 192.168.1.231在 Mac mini 上运行

  2. ping -c 4 192.168.1.185在 MacBook 上运行

  3. Mac mini 输出:

    tcpdump: data link type PKTAP
    tcpdump: listening on pktap, link-type PKTAP (Apple DLT_PKTAP), capture size 262144 bytes
    11:43:05.797487 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has 192.168.1.185 tell 192.168.1.231, length 28
    11:43:05.797555 ARP, Ethernet (len 6), IPv4 (len 4), Reply 192.168.1.185 is-at 3c:22:fb:a8:43:ed (oui Unknown), length 28
    11:43:05.814090 IP (tos 0x0, ttl 64, id 4572, offset 0, flags [none], proto ICMP (1), length 84)
        192.168.1.231 > 192.168.1.185: ICMP echo request, id 40459, seq 0, length 64
    11:43:06.734317 IP (tos 0x0, ttl 64, id 42401, offset 0, flags [none], proto ICMP (1), length 84)
        192.168.1.231 > 192.168.1.185: ICMP echo request, id 40459, seq 1, length 64
    11:43:07.722478 IP (tos 0x0, ttl 64, id 36241, offset 0, flags [none], proto ICMP (1), length 84)
        192.168.1.231 > 192.168.1.185: ICMP echo request, id 40459, seq 2, length 64
    11:43:08.726554 IP (tos 0x0, ttl 64, id 59095, offset 0, flags [none], proto ICMP (1), length 84)
        192.168.1.231 > 192.168.1.185: ICMP echo request, id 40459, seq 3, length 64
    

MacBook 没有收到任何响应,所有 4 个请求都超时了,但正如您所见,mac mini 收到了所有请求,甚至似乎响应了 ARP,但 ICMP 没有响应。

禁用 IPv6

让我想到这可能是由 Ipv6 引起的,所以我networksetup -setv6off Wi-Fi在两台机器上运行,没有引起任何变化,所以我重新启用了它。

为 Mac mini 设置手动 IP

建议如果我将 mac mini 的 IP 设置为 DHCP 池中的其他 IP,它可能会执行某些操作,但没有执行(我试过了192.168.1.230192.168.1.232,所以我将自动地址放回去。

禁用其他网络接口

反向路径过滤器看起来和我所拥有的非常接近,但它是关于 Linux 的,Mac OS 对此有不同的处理。我没有花太多时间在这上面,但我认为这与机器与网络接口混淆有关,所以我禁用了除 Mac Mini 之外的所有接口,192.168.*但这并没有解决问题。

尝试不同的路由器

我尝试将 MacBook 和 Mac Mini 连接到我的 Android 手机的 Wi-Fi 热点,但情况是一样的。

通过电缆连接

我尝试通过以太网电缆将 Mac Mini 直接连接到路由器,但没有任何变化。


希望我们能够找到解决方案,甚至将来能够帮助到其他人。

答案1

找到了!根本原因是 /Library/Extensions/cpfw.kext我的 VPN 软件 (Endpoint Security VPN) 添加的扩展。一旦我从该文件夹中删除它,ping 就会再次开始工作!

事实证明这个文件是某种防火墙,即使没有它,VPN 也可以工作。

有关更多故障排除详细信息,请参阅Apple 论坛中的帖子

相关内容