rssnsj / minivtun

A fast, secure and reliable VPN service based on non-standard protocol
GNU General Public License v3.0
246 stars 102 forks source link

连接minivtun之后如何访问服务器的内网网卡呢? #16

Open threekidney opened 6 years ago

threekidney commented 6 years ago

centos6服务端执行 /usr/sbin/minivtun -l 0.0.0.0:12398 -a 10.8.8.8/24 -n vnet0 -e '123123' -t aes-256 -d

iptables -t nat -A POSTROUTING -s 10.8.8.0/24 -o eth0 -j SNAT --to-source 10.104.232.195

客户端为openwrt中的minivtun客户端,连接上之后能正常经过访问外网,客户端跟服务器也能正常互ping,现在需求客户端能访问服务器端的内网网卡ip,服务器端应该要再怎么设置呢? 服务端 route : [root@VM_232_195_centos ~]# route -n Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 10.8.8.0 0.0.0.0 255.255.255.0 U 0 0 0 vnet0 10.104.192.0 0.0.0.0 255.255.192.0 U 0 0 0 eth0 169.254.0.0 0.0.0.0 255.255.0.0 U 1002 0 0 eth0 0.0.0.0 10.104.192.1 0.0.0.0 UG 0 0 0 eth0

服务器为单网卡:

eth0 Link encap:Ethernet HWaddr 52:54:00:B3:3E:A9
inet addr:10.104.232.195 Bcast:10.104.255.255 Mask:255.255.192.0

请求大神抽空帮忙解答一下,感激不尽!