Skip to content

Instantly share code, notes, and snippets.

@GitHub30
Last active May 12, 2018 13:53
Show Gist options
  • Save GitHub30/46f808fbac2d8a720132787b991ec4a8 to your computer and use it in GitHub Desktop.
Save GitHub30/46f808fbac2d8a720132787b991ec4a8 to your computer and use it in GitHub Desktop.
#cat /etc/system-release
# Amazon Linux AMI release 2018.03
# LinuxのNetwork Interfaceの名前は15文字まで(NICNAMEは11文字まで)
set -xe \
&& sudo yum -y update \
&& sudo yum -y install git gcc readline-devel openssl-devel \
&& git clone https://github.com/SoftEtherVPN/SoftEtherVPN.git \
&& cd SoftEtherVPN/ \
&& git checkout refs/tags/5.1 \
&& ./configure \
&& make \
&& sudo make install \
&& sudo vpnserver start \
&& sudo vpnclient start \
&& NICNAME=honmachi ACCOUNTNAME=honmachi HUB=honmachi USERNAME=username PASSWORD= IP_ADDRESS=10.0.2.15 \
&& vpncmd localhost /SERVER /CMD HubCreate $HUB /PASSWORD: \
&& vpncmd localhost /SERVER /HUB:$HUB /CMD UserCreate $USERNAME /GROUP:none /REALNAME:none /NOTE:none \
&& vpncmd localhost /SERVER /HUB:$HUB /CMD UserPasswordSet $USERNAME /PASSWORD:$PASSWORD \
&& vpncmd localhost /CLIENT /CMD NicCreate $NICNAME \
&& vpncmd localhost /CLIENT /CMD NicList \
&& vpncmd localhost /CLIENT /CMD AccountCreate $ACCOUNTNAME /SERVER:localhost:443 /HUB:$HUB /USERNAME:$USERNAME /NICNAME:$NICNAME \
&& vpncmd localhost /CLIENT /CMD AccountList \
&& vpncmd localhost /CLIENT /CMD AccountPasswordSet $ACCOUNTNAME /PASSWORD:$PASSWORD /TYPE:standard \
&& vpncmd localhost /CLIENT /CMD AccountStartupSet $ACCOUNTNAME \
&& vpncmd localhost /CLIENT /CMD AccountConnect $ACCOUNTNAME \
&& vpncmd localhost /CLIENT /CMD AccountStatusGet $ACCOUNTNAME \
&& sudo ip addr add $IP_ADDRESS/24 dev vpn_$NICNAME \
&& set +xe
# Down unnecessary route
#sudo ip link set vpn_$NICNAME down
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment