通过 LAN 中的节点共享 VPN 连接

通过 LAN 中的节点共享 VPN 连接

我想通过同一 LAN 中的节点共享 VPN 连接。下图显示了我的网络系统。

LAN A: 10.44.247.0/24
|-* Router Aa: 10.44.247.1, ext XXX.XXX.XXX.XXX
    |-* Node Ab: 10.44.247.2 (en0), ppp 192.168.100.36 (ppp0) -| VPN (L2TP)
    |-* Node Ac: 10.44.247.3                                   | 
                                                               |
LAN B: 192.168.100.0/24                                        |
|-* Router Ba: 192.168.100.1, ext YYY.YYY.YYY.YYY <------------|
    |-* Node Bb: 192.168.100.6

Bb我想要做的是从 Node访问 Node Ac。路由器Aa路由发往 的流量192.168.100.0/24 。Node10.44.247.2与服务Ab共享互联网连接pf

nat on en0 from en0:network to any -> (en0)
nat on ppp0 from en0:network to 192.168.100.0/24 -> (ppp0)
nat on en0 from ppp0:network to 10.44.247.0/24 -> (en0)

我可以Bb从 Node ping Node Ac,并且跟踪的路由显示如预期的那样:

$ tractroute 192.168.100.6
traceroute to 192.168.100.6 (192.168.100.6), 64 hops max, 52 byte packets
 1  10.44.247.1 (10.44.247.1)  1.585 ms  0.355 ms  0.325 ms
 2  10.44.247.2 (10.44.247.2)  0.703 ms  0.530 ms  0.545 ms
 3  192.168.100.6 (192.168.100.6)  16.429 ms  13.982 ms  13.834 ms

$ ping 192.168.100.6
PING 192.168.100.6 (192.168.100.6): 56 data bytes
Request timeout for icmp_seq 0
64 bytes from 192.168.100.6: icmp_seq=1 ttl=63 time=14.232 ms

但是,我无法通过 SSH 和其他协议访问该节点:

$ ssh -vvv 192.168.100.6
OpenSSH_7.9p1, LibreSSL 2.7.3
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 48: Applying options for *
debug2: resolve_canonicalize: hostname 192.168.100.6 is address
debug2: ssh_connect_direct
debug1: Connecting to 192.168.100.6 [192.168.100.6] port 22.
debug1: Connection established.
debug1: identity file /Users/daehyun/.ssh/id_rsa type 0
debug1: identity file /Users/daehyun/.ssh/id_rsa-cert type -1
debug1: identity file /Users/daehyun/.ssh/id_dsa type -1
debug1: identity file /Users/daehyun/.ssh/id_dsa-cert type -1
debug1: identity file /Users/daehyun/.ssh/id_ecdsa type -1
debug1: identity file /Users/daehyun/.ssh/id_ecdsa-cert type -1
debug1: identity file /Users/daehyun/.ssh/id_ed25519 type -1
debug1: identity file /Users/daehyun/.ssh/id_ed25519-cert type -1
debug1: identity file /Users/daehyun/.ssh/id_xmss type -1
debug1: identity file /Users/daehyun/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_7.9
ssh_exchange_identification: read: Operation timed out

我看不出它为什么不起作用。有什么想法吗?

相关内容