我有一个家庭 wifi 网络,其中有 2 个 Linux 系统和 1 个 Mac 系统。我可以从 Mac 访问每个 Linux 系统,反之亦然,但尝试从另一个 Linux ping 一个 Linux 系统时,两个系统都出现“目标主机无法访问”错误。
可能是什么原因造成的,如何解决?我在两个 Linux 系统上禁用了所有防火墙:
iptables -nL
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
但它并没有多大帮助。
细节:
电脑(Ubuntu 16.04):
ifconfig:
wlp2s0 Link encap:Ethernet HWaddr ac:7b:a1:c5:ea:0e
inet addr:192.168.1.83 Bcast:192.168.1.255 Mask:255.255.255.0
route:
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.1.254 0.0.0.0 UG 600 0 0 wlp2s0
192.168.1.0 * 255.255.255.0 U 600 0 0 wlp2s0
arp:
Address HWtype HWaddress Flags Mask Iface
192.168.1.254 ether 58:90:43:49:eb:6b C wlp2s0
192.168.1.77 ether 34:02:86:aa:89:85 C wlp2s0
192.168.1.69 ether 18:65:90:dc:04:55 C wlp2s0
笔记本电脑(ubuntu 16.04):
ifconfig:
wlan0 Link encap:Ethernet HWaddr 34:02:86:aa:89:85
inet addr:192.168.1.77 Bcast:192.168.1.255 Mask:255.255.255.0
route:
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.1.254 0.0.0.0 UG 600 0 0 wlan0
192.168.1.0 * 255.255.255.0 U 600 0 0 wlan0
arp:
Address HWtype HWaddress Flags Mask Iface
192.168.1.83 ether ac:7b:a1:c5:ea:0e C wlan0
192.168.1.69 ether 18:65:90:dc:04:55 C wlan0
192.168.1.254 ether 58:90:43:49:eb:6b C wlan0
mac(10.13.3):
ifconfig:
en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
ether 18:65:90:dc:04:55
inet6 fe80::80f:e846:2fe6:90c5%en0 prefixlen 64 secured scopeid 0x5
inet 192.168.1.69 netmask 0xffffff00 broadcast 192.168.1.255
route:
Destination Gateway Flags Refs Use Netif Expire
default 192.168.1.254 UGSc 105 0 en0
192.168.1 link#5 UCS 4 0 en0
192.168.1.69/32 link#5 UCS 0 0 en0
192.168.1.77 34:2:86:aa:89:85 UHLWI 0 510 en0 1154
192.168.1.83 ac:7b:a1:c5:ea:e UHLWIi 2 55 en0 915
192.168.1.254/32 link#5 UCS 1 0 en0
192.168.1.254 58:90:43:49:eb:6b UHLWIir 39 14075 en0 1169
192.168.1.255 ff:ff:ff:ff:ff:ff UHLWbI 0 2 en0
255.255.255.255/32 link#5 UCS 0 0 en0
从 PC 到 Mac 执行 Ping 操作有效:
ping 192.168.1.69
PING 192.168.1.69 (192.168.1.69) 56(84) bytes of data.
64 bytes from 192.168.1.69: icmp_seq=1 ttl=64 time=6.15 ms
从 PC 到笔记本电脑 ping 不通:
ping 192.168.1.77
PING 192.168.1.77 (192.168.1.77) 56(84) bytes of data.
From 192.168.1.83 icmp_seq=9 Destination Host Unreachable
从笔记本电脑 ping 至 Mac 有效:
ping 192.168.1.69
PING 192.168.1.69 (192.168.1.69) 56(84) bytes of data.
64 bytes from 192.168.1.69: icmp_seq=1 ttl=64 time=5.89 ms
从笔记本电脑 ping 到 PC 不成功:
ping 192.168.1.83
PING 192.168.1.83 (192.168.1.83) 56(84) bytes of data.
From 192.168.1.77 icmp_seq=2 Destination Host Unreachable
从 Mac 到 PC 执行 Ping 操作有效:
ping 192.168.1.83
PING 192.168.1.83 (192.168.1.83): 56 data bytes
64 bytes from 192.168.1.83: icmp_seq=0 ttl=64 time=101.836 ms
从 Mac 到笔记本电脑的 Ping 操作同样有效:
ping 192.168.1.77
PING 192.168.1.77 (192.168.1.77): 56 data bytes
64 bytes from 192.168.1.77: icmp_seq=0 ttl=64 time=16.749 ms
在以下过程中从 192.168.1.77 进行 Tcpdump telnet 192.168.83 22
:
tcpdump -i wlan0 -s 65535 -n host 192.168.1.83
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on wlan0, link-type EN10MB (Ethernet), capture size 65535 bytes
18:38:53.194490 ARP, Request who-has 192.168.1.83 tell 192.168.1.77, length 28
18:38:53.410085 ARP, Reply 192.168.1.83 is-at ac:7b:a1:c5:ea:0e, length 46
18:38:53.410100 IP 192.168.1.77.38208 > 192.168.1.83.22: Flags [S], seq 3257644438, win 29200, options [mss 1460,sackOK,TS val 7583261 ecr 0,nop,wscale 7], length 0
18:38:54.193729 IP 192.168.1.77.38208 > 192.168.1.83.22: Flags [S], seq 3257644438, win 29200, options [mss 1460,sackOK,TS val 7583511 ecr 0,nop,wscale 7], length 0
18:38:56.197662 IP 192.168.1.77.38208 > 192.168.1.83.22: Flags [S], seq 3257644438, win 29200, options [mss 1460,sackOK,TS val 7584012 ecr 0,nop,wscale 7], length 0
18:39:00.205734 IP 192.168.1.77.38208 > 192.168.1.83.22: Flags [S], seq 3257644438, win 29200, options [mss 1460,sackOK,TS val 7585014 ecr 0,nop,wscale 7], length 0
18:39:08.213738 IP 192.168.1.77.38208 > 192.168.1.83.22: Flags [S], seq 3257644438, win 29200, options [mss 1460,sackOK,TS val 7587016 ecr 0,nop,wscale 7], length 0
18:39:24.245736 IP 192.168.1.77.38208 > 192.168.1.83.22: Flags [S], seq 3257644438, win 29200, options [mss 1460,sackOK,TS val 7591024 ecr 0,nop,wscale 7], length 0
18:39:29.253720 ARP, Request who-has 192.168.1.83 tell 192.168.1.77, length 28
18:39:30.253717 ARP, Request who-has 192.168.1.83 tell 192.168.1.77, length 28
18:39:31.253715 ARP, Request who-has 192.168.1.83 tell 192.168.1.77, length 28
18:39:56.309737 ARP, Request who-has 192.168.1.83 tell 192.168.1.77, length 28
18:39:56.321748 ARP, Reply 192.168.1.83 is-at ac:7b:a1:c5:ea:0e, length 46
18:39:56.321762 IP 192.168.1.77.38208 > 192.168.1.83.22: Flags [S], seq 3257644438, win 29200, options [mss 1460,sackOK,TS val 7599040 ecr 0,nop,wscale 7], length 0
同时从 192.168.1.83 进行 tcpdump:
tcpdump -i wlp2s0 -s 65535 -n host 192.168.1.77
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on wlp2s0, link-type EN10MB (Ethernet), capture size 65535 bytes
18:38:53.341294 ARP, Request who-has 192.168.1.83 tell 192.168.1.77, length 46
18:38:53.341312 ARP, Reply 192.168.1.83 is-at ac:7b:a1:c5:ea:0e, length 28
18:39:56.316562 ARP, Request who-has 192.168.1.83 tell 192.168.1.77, length 46
18:39:56.316597 ARP, Reply 192.168.1.83 is-at ac:7b:a1:c5:ea:0e, length 28
更新
显然我错过了一些智能设置蓝牙智能中心. 一切都可以通过不太复杂的路由器实现。