小编Ste*_*ano的帖子

如何通过其他 Linux 机器将流量路由到 VPN

在这种情况下,我有两台机器 RasPi 和其他 Ubuntu 服务器。

我的 RasPi (192.168.100.105) 有 Debian 并且已经建立了 UDP openvpn 连接。RasPi 连接到远程 VPN 连接 172.16.199.99。

我尝试使用路由路由此流量:

ubuntu@server:~$ route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         192.168.100.254  0.0.0.0         UG    0      0        0 eth0
172.16.199.0    192.168.100.105  255.255.255.0   UG    0      0        0 eth0
192.168.100.0    *               255.255.255.0   U     0      0        0 eth0
Run Code Online (Sandbox Code Playgroud)

但不幸的是它不起作用。在 RasPi (192.168.100.105) 上,我可以 ping 172.16.199.99(在 openvpn 中远程 ip)但是在添加此路由后在 Ubuntu 服务器上:

mainframe@server:~$ sudo route add -net 172.16.199.0 netmask 255.255.255.0 gw 192.168.100.105 dev eth0 …
Run Code Online (Sandbox Code Playgroud)

routing gateway

1
推荐指数
1
解决办法
2万
查看次数

标签 统计

gateway ×1

routing ×1