Last active
March 19, 2018 13:55
-
-
Save billyriantono/d69cc512860be5c13848 to your computer and use it in GitHub Desktop.
/etc/init.d/vpnserver file for softether using Local Bridge
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
iptables -t nat -A POSTROUTING -s 192.168.100.0/24 -j SNAT --to-source [YOUR ETHERNET INTERNET IP ADDRESS] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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