我有一个运行 OpenVPN 客户端的树莓派,它连接到 VPN 提供商和 Wireguard 服务器,因此我可以从外部连接到我的家庭局域网。我想通过wireguard连接到我的家,并通过Openvpn连接发送所有流量。
这是我的 ifconfig 输出
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.5 netmask 255.255.255.0 broadcast 192.168.1.255
wg0: flags=209<UP,POINTOPOINT,RUNNING,NOARP> mtu 1420
inet 172.1.1.1 netmask 255.255.255.0 destination 172.1.1.1
tun0: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST> mtu 1500
inet 10.8.8.17 netmask 255.255.255.0 destination 10.8.8.17
Run Code Online (Sandbox Code Playgroud)
eth0 - 是互联网的网关(连接到我的家庭路由器)
当我在没有运行 OpenVPN 客户端的情况下连接到 wireguard 服务器时,我可以访问我的内部 LAN (192.168.1.X) 并通过树莓派 (eth0) 将我的请求转发到互联网。当我启用 OpenVPN 客户端(tun0 up)时,我无法访问内部 LAN,也无法访问 Internet。
我想要做的是通过wireguard连接到我的家,并通过openvpn连接(tun0)获得所有流量隧道。
这是我从“route -n”的输出:
在 OpenVPN 启动之前(wireguard 工作正常):
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.1.1 0.0.0.0 …Run Code Online (Sandbox Code Playgroud)