【LIVA】【Ubuntu server14.04】VPNをやりたい(SoftEtherインストール編)
こちらがとても参考になってので載せておきます。
某模型メーカー中の人のサーバ管理帳: Ubuntu ServerにSoftEther VPN Serverを入れてみる
1.SoftEtherの取得とmake
wgetコマンドで取得します。
取得するファイルは各環境に合わせる必要があります。
http://jp.softether-download.com/files/softether/
$wget http://jp.softether-download.com/files/softether/v4.10-9473-beta-2014.07.12-tree/Linux/SoftEther_VPN_Server/64bit_-_Intel_x64_or_AMD64/softether-vpnserver-v4.10-9473-beta-2014.07.12-linux-x64-64bit.tar.gz
jp.softether-download.com (jp.softether-download.com) をDNSに問いあわせています... 130.158.75.49
jp.softether-download.com (jp.softether-download.com)|130.158.75.49|:80 に接続しています... 接続しました。
HTTP による接続要求を送信しました、応答を待っています... 200 OK
長さ: 5638726 (5.4M) [application/x-gzip]
`softether-vpnserver-v4.10-9473-beta-2014.07.12-linux-x64-64bit.tar.gz' に保存中100%[======================================>] 5,638,726 2.14MB/s 時間 2.5s
2014-09-28 14:34:59 (2.14 MB/s) - `softether-vpnserver-v4.10-9473-beta-2014.07.12-linux-x64-64bit.tar.gz' へ保存完了 [5638726/5638726]
取得したファイルを解凍します。
$sudo tar zxvf ./softether-vpnserver-v4.10-9473-beta-2014.07.12-linux-x64-64bit.tar.gz
vpnserver/
vpnserver/Makefile
vpnserver/.install.sh
vpnserver/ReadMeFirst_License.txt
vpnserver/Authors.txt
vpnserver/ReadMeFirst_Important_Notices_ja.txt
vpnserver/ReadMeFirst_Important_Notices_en.txt
vpnserver/ReadMeFirst_Important_Notices_cn.txt
vpnserver/code/
vpnserver/code/vpnserver.a
vpnserver/code/vpncmd.a
vpnserver/lib/
vpnserver/lib/libcharset.a
vpnserver/lib/libcrypto.a
vpnserver/lib/libedit.a
vpnserver/lib/libiconv.a
vpnserver/lib/libintelaes.a
vpnserver/lib/libncurses.a
vpnserver/lib/libssl.a
vpnserver/lib/libz.a
vpnserver/lib/License.txt
vpnserver/hamcore.se2
makeコマンドを実行します。
$ cd vpnserver/
$ ls
Authors.txt ReadMeFirst_License.txt
Makefile code
ReadMeFirst_Important_Notices_cn.txt hamcore.se2
ReadMeFirst_Important_Notices_en.txt lib
ReadMeFirst_Important_Notices_ja.txt
$ sudo make
--------------------------------------------------------------------
SoftEther VPN Server (Ver 4.10, Build 9473, Intel x64 / AMD64) for Linux Install Utility
Copyright (c) SoftEther Project at University of Tsukuba, Japan. All Rights Reserved.--------------------------------------------------------------------
Do you want to read the License Agreement for this software ?1. Yes
2. NoPlease choose one of above number:
1
(略)
--------------------------------------------------------------------
The preparation of SoftEther VPN Server is completed !
*** How to switch the display language of the SoftEther VPN Server Service ***
SoftEther VPN Server supports the following languages:
- Japanese
- English
- Simplified ChineseYou can choose your prefered language of SoftEther VPN Server at any time.
To switch the current language, open and edit the 'lang.config' file.
*** How to start the SoftEther VPN Server Service ***Please execute './vpnserver start' to run the SoftEther VPN Server Background Service.
And please execute './vpncmd' to run the SoftEther VPN Command-Line Utility to configure SoftEther VPN Server.
Of course, you can use the VPN Server Manager GUI Application for Windows on the other Windows PC in order to configure the SoftEther VPN Server remotely.
--------------------------------------------------------------------make[1]: ディレクトリ `/tmp/vpnserver' から出ます
ライセンスとか使用条件とかいろいろ聞かれますが、基本的に1を選択。
※makeがエラーになる場合は、以下で必要なものを取得
sudo apt-get install gcc make binutils chkconfig libc-dev zlib1g-dev openssl libreadline-dev libncurses-dev
2.デーモン動作設定
とりあえずフォルダを移動します。
$sudo mv vpnserver /usr/local
デーモン起動させるため、以下のファイル作成します。※参考サイトより
$sudo vi /etc/init.d/vpnserver
#!/bin/sh
# chkconfig: 2345 99 01
# description: SoftEther VPN Server
DAEMON=/usr/local/vpnserver/vpnserver
test -x $DAEMON || exit 0
case "$1" in
start)
$DAEMON start
;;
stop)
$DAEMON stop
;;
restart)
$DAEMON stop
sleep 3
$DAEMON start
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac
exit 0
そのままだと実行権限もないため、権限変更を行います。
$sudo chmod 755 /etc/init.d/vpnserver
3.実行
$ sudo service vpnserver start
The SoftEther VPN Server service has been started.
停止、再開は以下になります。
$ sudo service vpnserver stop
$ sudo service vpnserver restart