我有一个 VPN 设置,允许我通过隧道回家并访问网络上运行的任何家庭服务器。
但是,我只能通过我的 Android 设备的移动网络或连接到移动热点的 Macbook 使用它。我可以从任何网络连接到我的 OpenVPN 服务器,但是当客户端设备连接到任何家庭/工作网络(ISP,因为没有更好的术语,在下面的日志中)时,连接就会超时。
不确定它是否相关,但这是arp
输出的样子。我使用 OpenVPN Connect 连接到我家的 OpenVPN 服务器。
> # ISP
> arp -a
iopsys.lan (192.168.1.1) at 34:e3:80:8c:b8:c0 on en0 ifscope [ethernet]
? (192.168.1.117) at a4:98:13:44:93:c7 on en0 ifscope [ethernet]
? (192.168.1.160) at (incomplete) on en0 ifscope [ethernet]
jbl-bar-9.lan (192.168.1.223) at 2c:fd:b3:d1:18:bc on en0 ifscope [ethernet]
? (xxx.xxx.xxx.xxx) at 1:0:5e:0:0:fb on en0 ifscope permanent [ethernet]
? (xxx.xxx.xxx.xxx) at 1:0:5e:7f:ff:fa on en0 ifscope permanent [ethernet]
> # ISP + VPN tunnel home – can't access any home machine by its IP, although they are in the list below
> arp -a
? (192.168.1.1) at 34:e3:80:8c:b8:c0 on en0 ifscope [ethernet]
? (192.168.1.117) at a4:98:13:44:93:c7 on en0 ifscope [ethernet]
? (192.168.1.160) at (incomplete) on en0 ifscope [ethernet]
? (192.168.1.223) at 2c:fd:b3:d1:18:bc on en0 ifscope [ethernet]
? (192.168.1.224) at 24:6f:28:5b:bc:c0 on en0 ifscope [ethernet]
? (192.168.1.255) at ff:ff:ff:ff:ff:ff on en0 ifscope [ethernet]
? (xxx.xxx.xxx.xxx) at 1:0:5e:0:0:fb on en0 ifscope permanent [ethernet]
? (xxx.xxx.xxx.xxx) at 1:0:5e:7f:ff:fa on en0 ifscope permanent [ethernet]
> # Mobile hotspot
> arp -a
? (192.168.146.123) at ce:30:4:ae:27:6c on en0 ifscope [ethernet]
? (192.168.146.255) at ff:ff:ff:ff:ff:ff on en0 ifscope [ethernet]
? (xxx.xxx.xxx.xxx) at 1:0:5e:0:0:fb on en0 ifscope permanent [ethernet]
? (xxx.xxx.xxx.xxx) at 1:0:5e:7f:ff:fa on en0 ifscope permanent [ethernet]
> # Mobile hotspot + VPN tunnel home – everything works, I can access all local IPs that aren't even listed in the table below
> arp -a
? (192.168.146.123) at ce:30:4:ae:27:6c on en0 ifscope [ethernet]
? (192.168.146.255) at ff:ff:ff:ff:ff:ff on en0 ifscope [ethernet]
? (xxx.xxx.xxx.xxx) at 1:0:5e:0:0:fb on en0 ifscope permanent [ethernet]
? (xxx.xxx.xxx.xxx) at 1:0:5e:7f:ff:fa on en0 ifscope permanent [ethernet]
我想我错过了 VPN 如何工作的部分内容,即两个网络(客户端的 LAN 和服务器的 LAN)如何分开,如果两者都使用相同的 IP 范围并且我想要做的是访问服务器的 LAN。我尝试在线搜索,但我认为我没有使用正确的关键字来找到它。
如果有人能指出我正确的方向,我将不胜感激,因为我真的很想了解如何使其工作以及为什么会发生这种行为。