我有一個家庭 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
蘋果電腦(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
從筆記型電腦到 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=5.89 ms
從筆記型電腦到 PC 的 Ping 操作不會:
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
更新
顯然我缺少一些智能設置英國電信智慧中心。一切都可以在不太複雜的路由器上運作。