Skip to content

Instantly share code, notes, and snippets.

@billyriantono
Last active March 19, 2018 13:55
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save billyriantono/d69cc512860be5c13848 to your computer and use it in GitHub Desktop.
Save billyriantono/d69cc512860be5c13848 to your computer and use it in GitHub Desktop.
/etc/init.d/vpnserver file for softether using Local Bridge
interface=tap_soft
dhcp-range=tap_soft,192.168.100.50,192.168.100.60,24h
dhcp-option=tap_soft,3,192.168.100.1
dhcp-option=tap_soft,option:dns-server,165.21.83.88,165.21.100.88
iptables -t nat -A POSTROUTING -s 192.168.100.0/24 -j SNAT --to-source [YOUR ETHERNET INTERNET IP ADDRESS]
#!/bin/sh
# chkconfig: 2345 99 01
# description: SoftEther VPN Server
DAEMON=/usr/local/vpnserver/vpnserver
LOCK=/var/lock/subsys/vpnserver
TAP_ADDR=192.168.7.1
TAP_ADAPTER='tap_soft'
test -x $DAEMON || exit 0
case "$1" in
start)
$DAEMON start
touch $LOCK
sleep 3
sleep 1
ifconfig $TAP_ADAPTER $TAP_ADDR
service dnsmasq start
;;
stop)
$DAEMON stop
rm $LOCK
;;
restart)
$DAEMON stop
sleep 3
$DAEMON start
sleep 1
ifconfig $TAP_ADAPTER $TAP_ADDR
service dnsmasq restart
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment