对于上下文,我正在迁移我的VPN服务器。 我几乎完全复制了旧的设置,现在连接到新的VPN服务器的客户端不能正确地隧道(但他们连接就好)。
隧道,这是我的客户的路由表:
Kernel IP routing table Destination Gateway Genmask Flags MSS Window irtt Iface 10.8.0.5 0.0.0.0 255.255.255.255 UH 0 0 0 tun0 10.8.0.1 10.8.0.5 255.255.255.255 UGH 0 0 0 tun0 [vpnserver-ip] 10.105.0.1 255.255.255.255 UGH 0 0 0 wlan1 10.105.0.0 0.0.0.0 255.255.252.0 U 0 0 0 wlan1 169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 wlan1 0.0.0.0 10.8.0.5 128.0.0.0 UG 0 0 0 tun0 128.0.0.0 10.8.0.5 128.0.0.0 UG 0 0 0 tun0 0.0.0.0 10.105.0.1 0.0.0.0 UG 0 0 0 wlan1
同时,这里是服务器的路由表
Kernel IP routing table Destination Gateway Genmask Flags MSS Window irtt Iface 0.0.0.0 [vpn-gate].1 0.0.0.0 UG 0 0 0 eth0 10.8.0.0 10.8.0.2 255.255.255.0 UG 0 0 0 tun0 10.8.0.2 0.0.0.0 255.255.255.255 UH 0 0 0 tun0 [vpn-sub].0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
新的VPN服务器的表格与旧的表格基本相同,所以我不确定缺less什么? 为什么不能正确的隧道?
我已经编辑了VPN服务器的IP。
您可能没有在服务器上为来自VPN客户端的传出数据包configurationIP伪装。 您可以使用iptables -nvL -t nat在旧服务器上检查此configuration。 在新服务器上需要如下所示:
iptables --table nat --append POSTROUTING --out-interface eth0 --source 10.8.0.0/24 --jump MASQUERADE