一台 macOS
电脑,在移动宽带家用宽带内网中,路由器下发的 IP: 192.168.1.207
一台 Ubuntu
云主机,是腾讯云轻量服务器,内网 IP: 10.0.24.5
,公网 IP: 20.111.10.10
在两台设备上配置了 WireGuard
,其中
Ubuntu
的 WireGuard IP: 10.66.66.1
,监听端口 61000
AllowedIPs: 10.66.66.2/32, 192.168.1.1/24
macOS
的 WireGuard IP: 10.66.66.2
,AllowedIPs: 0.0.0.0/0, ::/0
EndPoint: 20.111.10.10:61000
在 WireGuard
的每个 Peer
可以访问到各自的局域网内的服务
我在两个设备上 80
端口分别部署了 web
服务。同时 Home Router
的 80
也有 web
服务。
macOS
无法 ping
通 Ubuntu
,但是反过来可以。
Ubuntu
无法访问 macOS
上的 web
服务,但是反过来可以。
macOS ping Ubuntu WireGuard IP
myname@mac ~> ping 10.66.66.1
PING 10.66.66.1 (10.66.66.1): 56 data bytes
Request timeout for icmp_seq 0
Request timeout for icmp_seq 1
^C
--- 10.66.66.1 ping statistics ---
3 packets transmitted, 0 packets received, 100.0% packet loss
myname@mac ~> sudo tcpdump host 10.66.66.1 -nn
tcpdump: data link type PKTAP
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on pktap, link-type PKTAP (Apple DLT_PKTAP), capture size 262144 bytes
09:08:45.842669 IP 198.18.0.1 > 10.66.66.1: ICMP echo request, id 3660, seq 0, length 64
09:08:45.842826 IP 192.168.1.207 > 10.66.66.1: ICMP echo request, id 30738, seq 0, length 64
09:08:46.845281 IP 198.18.0.1 > 10.66.66.1: ICMP echo request, id 3660, seq 1, length 64
09:08:46.845528 IP 192.168.1.207 > 10.66.66.1: ICMP echo request, id 30738, seq 1, length 64
09:08:47.849243 IP 198.18.0.1 > 10.66.66.1: ICMP echo request, id 3660, seq 2, length 64
09:08:47.849486 IP 192.168.1.207 > 10.66.66.1: ICMP echo request, id 30738, seq 2, length 64
^C
6 packets captured
28 packets received by filter
0 packets dropped by kernel
macOS ping Ubuntu LAN IP
myname@mac ~ [2]> ping 10.0.24.5
PING 10.0.24.5 (10.0.24.5): 56 data bytes
Request timeout for icmp_seq 0
Request timeout for icmp_seq 1
^C
--- 10.0.24.5 ping statistics ---
3 packets transmitted, 0 packets received, 100.0% packet loss
myname@mac ~> sudo tcpdump host 10.0.24.5 -nn
tcpdump: data link type PKTAP
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on pktap, link-type PKTAP (Apple DLT_PKTAP), capture size 262144 bytes
09:10:32.262418 IP 198.18.0.1 > 10.0.24.5: ICMP echo request, id 29772, seq 0, length 64
09:10:32.262692 IP 192.168.1.207 > 10.0.24.5: ICMP echo request, id 57874, seq 0, length 64
09:10:33.264108 IP 198.18.0.1 > 10.0.24.5: ICMP echo request, id 29772, seq 1, length 64
09:10:33.264379 IP 192.168.1.207 > 10.0.24.5: ICMP echo request, id 57874, seq 1, length 64
09:10:34.265250 IP 198.18.0.1 > 10.0.24.5: ICMP echo request, id 29772, seq 2, length 64
09:10:34.265511 IP 192.168.1.207 > 10.0.24.5: ICMP echo request, id 57874, seq 2, length 64
^C
6 packets captured
44 packets received by filter
0 packets dropped by kernel
Ubuntu ping macOS LAN IP
myname@rus ~> ping 192.168.1.207
PING 192.168.1.207 (192.168.1.207) 56(84) bytes of data.
^C
--- 192.168.1.207 ping statistics ---
5 packets transmitted, 0 received, 100% packet loss, time 4096ms
myname@rus ~> sudo tcpdump -i wg0 -nn
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on wg0, link-type RAW (Raw IP), capture size 262144 bytes
09:14:47.520387 IP 10.66.66.1 > 192.168.1.207: ICMP echo request, id 16, seq 1, length 64
09:14:48.544447 IP 10.66.66.1 > 192.168.1.207: ICMP echo request, id 16, seq 2, length 64
09:14:49.568440 IP 10.66.66.1 > 192.168.1.207: ICMP echo request, id 16, seq 3, length 64
09:14:50.592437 IP 10.66.66.1 > 192.168.1.207: ICMP echo request, id 16, seq 4, length 64
09:14:51.616445 IP 10.66.66.1 > 192.168.1.207: ICMP echo request, id 16, seq 5, length 64
^C
5 packets captured
5 packets received by filter
0 packets dropped by kernel
Ubuntu curl macOS
任何地址都没响应,而且没有终端输出,tcpdump
也没有输出。请大家指点。
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.