Softether on VPS Using Local Bridge

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

Network setup

  • VPN Server IP:
  • VPN Client IP Range:
  • Tap Device name: tap_soft

From here we go to the “Local Bridge Setting”

Local Bridge Setting

  • First we choose the Virtual 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).

Create Local Bridge

After the creation of the local bridge we jump back to our server. And run

# ifconfig tap_soft

It should show you something similar to this

Check on the server

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.

# apt-get install dnsmasq

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.

# Provides: vpnserver
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start daemon at boot time
# Description: Enable Softether by daemon.

test -x $DAEMON || exit 0
case "$1" in
$DAEMON start
touch $LOCK
sleep 1
/sbin/ifconfig tap_soft $TAP_ADDR
$DAEMON stop
rm $LOCK
$DAEMON stop
sleep 3
$DAEMON start
sleep 1
/sbin/ifconfig tap_soft $TAP_ADDR
echo "Usage: $0 {start|stop|restart}"
exit 1
exit 0

Then we need to enable NAT on linux server.

Add this file to /etc/sysctl.d/ to enable ipv4 forwarding.

net.ipv4.ip_forward = 1

Apply the sysctl run

# sysctl --system

Then we add a POSTROUTING rule to iptables

# iptables -t nat -A POSTROUTING -s -j SNAT --to-source [YOUR VPS IP ADDRESS]

To make our iptables rule survive after reboot install iptables-persistent

# apt-get install iptables-persistent

After all the above setting, restart the vpnserver then we are good to go.

# /etc/init.d/vpnserver restart
# /etc/init.d/dnsmasq restart

Comparison on SecureNAT and local bridge method.

Speed test on local bridge  Speed test on SecureNAT


Local bridge use far less CPU resources than SecureNAT. It is a bit trouble to setup but I think it is worth to use local bridge.



Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.