一直使用 softether ,之前也有这个需求没有深入研究
https://forum.vpngate.net/viewtopic.php?t=65656现在网络是分级的,比如 2018 年时,电信联通网络不通,晚上两网之间连接竟然跑到省会城市去连接,搞得网间流量才 50KB/s 。出了墙更是有流量累积风险。移动访问深信服的 vpn 也是有间谒性访问问题的。
从这些年的经验来看,用 softether 常见避墙方法
1 。定时变更级联线路,条条大路通罗马
2 。同一服务器变更不同端口,以上都能有效的避开流量封锁
3 。似乎定时变更证书也能避墙
softether 的另外一个优点是一个服务器端即是服务器端又是客户端,具备一个服务器端连接全球服务器的效果,只是这需要对 linux route 有更高阶的经验。另外作者点拔了一下 softether 实现的 mesh ,只是没能领会用途。
之前测试时用的这种方法,softether 过墙的效果还是非常好的。
Webserver over VPN
https://forum.vpngate.net/viewtopic.php?t=65656Sure. What I did was set up a TAP adapter on the server so the VPN server can ping the VPN cleint. After that I used software like HAProxy and iptables port-fowarding to make the web-server available to the public
Setup the VPN server (after creating the TAP adapter in the server control panel)
sysctl -w net.ipv4.ip_forward=1
service vpnserver start #if not started allready
dhclient tap_tap #get an IP for this TAP adapter
For a web server tho I suggest HAProxy so you can use HTTP headers to get client IP address. This part is a little complicated and if you are using multiple subdomains you might need a Wildcard SSL to use in HAProxy (which you can usually get for free from Let's Encrypt)
If you are running a Minecraft Server you can use HAProxy and a SpigotProxy plugin to get player's real IPs and it works well for a testing env.
Heres what I use on the VPN server for generic port forwarding. x.x.x.x represents the server's public IPv4 and 192.168.30.13 is my VPN Client's IP (this will prob. work for IPv6)
iptables -t nat -I PREROUTING 1 -d x.x.x.x -p tcp --dport 8081 -j DNAT --to-dest 192.168.30.13:8081
iptables -t nat -I POSTROUTING 1 -d 192.168.30.13 -p tcp --dport 8081 -j SNAT --to-source 192.168.30.1
iptables -I FORWARD 1 -d 192.168.30.13 -p tcp --dport 8081 -j ACCEPT
If you do get a Wildcard SSL thru Let's Encrypt. Use this command to combine the certs than use this command block to turn it into a single pem file to use with HAProxy
sudo cat /etc/letsencrypt/live/mydomain.tld/fullchain.pem \
/etc/letsencrypt/live/mydomain.tld/privkey.pem \
| sudo tee mydomain.tld.pem