-
-
Save wrtcoder/8c8be6127283a893c5ec37fa8497c39f to your computer and use it in GitHub Desktop.
Softether VPN Server
This file contains hidden or 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
| VPNCMD="sudo /usr/local/vpnserver/vpncmd localhost:443 /SERVER /CMD" | |
| # Create virtual hub | |
| ${VPNCMD} HubCreate ${HubName} /PASSWD:admin | |
| # Create local bridge(connect to physical device) | |
| ${VPNCMD} BridgeCreate ${HubName} /DEVICE:${phy_dev_name:-eth0} | |
| # Create local bridge(create tap interface) | |
| ${VPNCMD} BridgeCreate ${HubName} /Device:${tap_dev_name:-vpn-br} /TAP:yes | |
| sudo ip link set promisc on tap_vpn-br | |
| # Connect to another vpn server | |
| VPNCMD_WITH_HUB="sudo /usr/local/vpnsrver/vpncmd localhost:443 /SERVER /HUB:${HubName} /CMD" | |
| ${VPNCMD_WITH_HUB} CascadeCreate ${CascadeName} /SERVER:${AnotherHost}:${AnotherPort} /HUB:${AnotherHubName} /USERNAME:{AnotherUsername} | |
| ${VPNCMD_WITH_HUB} CascadePasswordSet ${CascadeName} /PASSWORD:${AnotherHubPassword} /TYPE:${PasswordType} | |
| ${VPNCMD_WITH_HUB} CascadeOnline ${CascadeName} |
This file contains hidden or 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
| # this is based on manual(https://ja.softether.org/4-docs/1-manual/7/7.3) | |
| # download source code from web site (http://www.softether-download.com/ja.aspx?product=softether) | |
| # rtm is recommended | |
| wget http://jp.softether-download.com/files/softether/v4.04-9412-rtm-2014.01.15-tree/Linux/SoftEther%20VPN%20Server/64bit%20-%20Intel%20x64%20or%20AMD64/softether-vpnserver-v4.04-9412-rtm-2014.01.15-linux-x64-64bit.tar.gz | |
| # unpacking tarball | |
| tar xf softether-vpnserver-v4.04-9412-rtm-2014.01.15-linux-x64-64bit.tar.gz | |
| # make and store | |
| cd vpnserver | |
| make | |
| cd ../ | |
| sudo mv vpnserver /usr/local | |
| # change owner and permission | |
| sudo chown -R root:root /usr/local/vpnserver | |
| sudo chmod 600 -R /usr/local/vpnserver/* | |
| sudo chmod 700 /usr/local/vpnserver/vpncmd /usr/local/vpnserver/vpnserver | |
| # regist to init.d | |
| sudo cp vpnserver.sh /etc/init.d/vpnserver | |
| sudo update-rc.d vpnserver defaults |
This file contains hidden or 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 | |
| test -x $DAEMON || exit 0 | |
| case "$1" in | |
| start) | |
| $DAEMON start | |
| touch $LOCK | |
| ;; | |
| stop) | |
| $DAEMON stop | |
| rm $LOCK | |
| ;; | |
| restart) | |
| $DAEMON stop | |
| sleep 3 | |
| $DAEMON start | |
| ;; | |
| *) | |
| 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