当我从家里连接到我的普通 wifi 连接时,它是 192.168,我的 VPN 一切正常,并使用以下命令为 10.0.0.0 地址添加了所需的额外路由:
路由添加-net 10.0.0.0/8 gw 10.100.1.99
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.0.1 0.0.0.0 UG 303 0 0 wlo1
10.0.0.0 10.100.1.99 255.0.0.0 UG 0 0 0 ppp0
10.100.1.99 0.0.0.0 255.255.255.255 UH 0 0 0 ppp0
192.168.0.0 0.0.0.0 255.255.255.0 U 303 0 0 wlo1
但是当我连接我的 wifi 热点设备(yourkarma.com)时,它会添加:
169.xxx
地址为 192.168 上方的 wlo1,然后 VPN 就无法正常工作。
当 169 ip 在路由 -n 列表中时,知道如何通过 wifi 热点让 VPN 工作吗?
以下是完整历史记录:
route -n
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.0.1 0.0.0.0 UG 303 0 0 wlo1
192.168.0.0 0.0.0.0 255.255.255.0 U 303 0 0 wlo1
echo "c myvpn" > /var/run/xl2tpd/l2tp-control
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.0.1 0.0.0.0 UG 303 0 0 wlo1
10.100.1.99 0.0.0.0 255.255.255.255 UH 0 0 0 ppp0
192.168.0.0 0.0.0.0 255.255.255.0 U 303 0 0 wlo1
# at this point if I do route add -net 10.0.0.0/8 gw 10.100.1.99
# i would get this new route and ssh to ips inside my vpn would work
# 10.0.0.0 10.100.1.99 255.0.0.0 UG 0 0 0 ppp0
#
# but to show the problem instead of adding that route, I swtich over to karma wifi
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.1.1 0.0.0.0 UG 303 0 0 wlo1
10.100.1.99 0.0.0.0 255.255.255.255 UH 0 0 0 ppp0
169.254.0.0 0.0.0.0 255.255.0.0 U 1000 0 0 wlo1
192.168.1.0 0.0.0.0 255.255.255.0 U 303 0 0 wlo1
# notice the new 169.254.0.0 with that 255.255.0.0 Genmask show up. When I try and
# add the route for 10.0.0.0/8 I get:
SIOCADDRT: Network is unreachable