在多个网络接口上侦听链接请在vpn_server.config中添加string ListenIP 0.0.0.0
This post continues on the last post about Softether setup on a VPS.
Problem on SecureNAT
SecureNAT is a fairly simple way to setup Softether. You don’t need a lot of sysadmin skill and network understanding in order to get Softether up and running.
The problem is SecureNAT is a bit SLOW. I will show a comparison at the end of this article.
We can boost the performance using a local bridge.
Softether using local bridge
To start with you need Softether installed and setup. You can follow the guide on Softether on VPS
Just skip the last step “Enable the Virtual NAT”
Local bridge Setup
VPN Server IP: 192.168.7.1
VPN Client IP Range: 192.168.7.50-192.168.7.60
Tap Device name: tap_soft
From here we go to the “Local Bridge Setting”
First we choose the Virt
ual Hub. It should be only one for normal setup.
Then we check the tap device box.
After that we type in the name of the tap device(I use soft here for simplicity).
After the creation of the local bridge we jump back to our server. And run
It should show you something similar to this
Because we are not going to use SecureNAT and SecureDHCP. We need to install a DHCP server on our VPS. We are going to use dnsmasq as our DHCP server.
Now edit the /etc/dnsmasq.conf file. Add these 3 lines at the end.
The above 3 lines are used to enable the dhcp server on interface tap_soft.
Next step we need a new set of init script which will config tap interface for us when Softether start up.
Then we need to enable NAT on linux server.
Add this file to /etc/sysctl.d/ to enable ipv4 forwarding.
Apply the sysctl run
Then we add a POSTROUTING rule to iptables
To make our iptables rule survive after reboot install
After all the above setting, restart the vpnserver then we are good to go.
Comparison on SecureNAT and local bridge method.