博主好,我这里使用了 gost 的 tun 功能,创建了一个简单的 VPN 。gost创建的 tun 设备的网络是可以互通的 ,但是和tun处于同一台机器的eth0,所在的网络,使用tun0设备无法访问,请问有什么方法可以访问到吗?
远端:
Linux 服务器具有两个网卡
本地:
示意图:
local remote
------------------------------------------- --------------------------------------------------
| tun0 | --------------------------> | | |not ok
------------------------------------------- | ----------------------------------------------- |
在本地ping远端
在远端ping本地
192.168.31.100 -->. 192.168.31.101 ok
从本地 ping server 的 172网段,日志可以看出,数据包已经发送到server的tun0设备,但是tun0到不了eth0,请问该如何配置尼?不胜感激
相关命令:
本地:
远端:
server路由
/root # route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 172.20.0.1 0.0.0.0 UG 0 0 0 eth0
172.20.0.0 * 255.255.255.0 U 0 0 0 eth0
192.168.31.0 * 255.255.255.0 U 0 0 0 tun0