Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
vyos1.2にSoftEther VPNをインストールする

vyos1.2にSoftEther VPNをインストールする

1.2.0-rolling+201904260337ではgccなどが依存関係によりインストールできないので他のマシンでビルドを行う

Linux router 4.19.36-amd64-vyos #1 SMP Sun Apr 21 10:39:20 CEST 2019 x86_64 GNU/Linux

kernelバージョンは4.19.36のようなので、ubuntu18.10kernelバージョンを4.19.36にあげてビルドを行う

ubuntu18.10のマシン

$ sudo apt update
$ sudo apt upgrade

kernelバージョンを上げる

$ wget https://kernel.ubuntu.com/~kernel-ppa/mainline/v4.19.36/linux-headers-4.19.36-041936_4.19.36-041936.201904200430_all.deb
$ wget https://kernel.ubuntu.com/~kernel-ppa/mainline/v4.19.36/linux-headers-4.19.36-041936-generic_4.19.36-041936.201904200430_amd64.deb
$ wget https://kernel.ubuntu.com/~kernel-ppa/mainline/v4.19.36/linux-image-unsigned-4.19.36-041936-generic_4.19.36-041936.201904200430_amd64.deb
$ wget https://kernel.ubuntu.com/~kernel-ppa/mainline/v4.19.36/linux-modules-4.19.36-041936-generic_4.19.36-041936.201904200430_amd64.deb
$ sudo apt install *.deb
$ sudo reboot
$ uname -a
Linux ubuntu 4.19.36-041936-generic #201904200430 SMP Sat Apr 20 08:34:39 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

SoftEther VPNをビルド

$ sudo apt install build-essential
$ curl -L -O https://github.com/SoftEtherVPN/SoftEtherVPN_Stable/releases/download/v4.29-9680-rtm/softether-vpnserver-v4.29-9680-rtm-2019.02.28-linux-x64-64bit.tar.gz
$ tar xvf softether-vpnserver-v4.29-9680-rtm-2019.02.28-linux-x64-64bit.tar.gz
$ cd vpnserver
$ make
$ cd ..
$ tar cvf vpnserver.tar.gz vpnserver/

vyosのマシン

ビルドしたのを持ってくる

$ tar -m -xvf vpnserver.tar.gz
$ mv vpn_server.config vpnserver/
$ sudo mv vpnserver/ /usr/local/
$ cd /usr/local
$ sudo chown -R root:root vpnserver
$ cd vpnserver
$ sudo chmod 600 *
$ sudo chmod 700 vpncmd
$ sudo chmod 700 vpnserver
$ sudo su
$ cat << \EOF > /etc/init.d/vpnserver
#!/bin/sh
### BEGIN INIT INFO
# Provides:          vpnserver
# Required-Start:    $network $remote_fs
# Required-Stop:     $network $remote_fs
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: SoftEther VPN Server
### END INIT INFO

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
EOF
$ exit
$ sudo chmod 755 /etc/init.d/vpnserver
$ sudo update-rc.d vpnserver defaults
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment