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
ifconfig tap_soft
apt-get install dnsmasq
nano /etc/dnsmasq.conf
interface=tap_soft dhcp-range=tap_soft,192.168.7.50,192.168.7.60,12h dhcp-option=tap_soft,3,192.168.7.1
config tap
ifconfig tap_soft 192.168.7.1
Add this file to /etc/sysctl.d/
to enable ipv4 forwarding
/etc/sysctl.d/ipv4_forwarding.conf
Wih this content
net.ipv4.ip_forward = 1
sysctl --system
Then we add a POSTROUTING rule to iptables
iptables -t nat -A POSTROUTING -s 192.168.7.0/24 -j SNAT --to-source [YOUR VPS IP ADDRESS]
# /etc/init.d/vpnserver restart # /etc/init.d/dnsmasq restart
References
http://blog.lincoln.hk/blog/2013/05/17/softether-on-vps-using-local-bridge/