LoginSignup
2
7

More than 3 years have passed since last update.

Ubuntu 17.10 に SoftEther_VPN をインストール

Last updated at Posted at 2018-03-16

次のページを参考にしました。
https://dev.classmethod.jp/cloud/aws/rk-2018-02-12-softethervpn/
必要なソフトのインストール

sudo apt install make
sudo apt install gcc
sudo apt install bridge-utils
sudo apt install libssl-dev
sudo apt install libncurses5-dev
sudo apt install libreadline-dev
sudo apt install zlib1g-dev
sudo apt install git

ソースのダウンロード

git clone https://github.com/SoftEtherVPN/SoftEtherVPN_Stable/

コンパイル、インストール

cd SoftEtherVPN_Stable/
./configure
make
sudo make install

次のコマンドがインストールされます。

/usr/bin/vpnserver
/usr/bin/vpnclient
/usr/bin/vpncmd

サーバーのスタート

sudo vpnserver start

次のプロセスが走ります。

9889 ?        S<s    0:00 /usr/vpnserver/vpnserver execsvc
9890 ?        S<l    0:00 /usr/vpnserver/vpnserver execsvc

実行した時の様子

$ sudo vpnserver start
The SoftEther VPN Server service has been started.

Let's get started by accessing to the following URL from your PC:

https://123.123.123.85:5555/
  or
https://123.123.123.85/

Note: IP address may vary. Specify your server's IP address.
A TLS certificate warning will appear because the server uses self signed certificate by default. That is natural. Continue with ignoring the TLS warning.

ブラウザーで指定されたアドレスにアクセスすると次のような画面が出ます。

softethervpn_server01.png

クライアントサービスのスタート

sudo vpnclient start

次のプロセスが走ります。

9932 ?        S<s    0:00 /usr/vpnclient/vpnclient execsvc
9933 ?        S<l    0:00 /usr/vpnclient/vpnclient execsvc

systemd の設定をする

作業用フォルダーの作成

sudo mkdir /opt/vpnserver

設定ファイルの作成

/etc/systemd/system/vpnserver.service
[Unit]
Description=Softether VPN Server Service
After=network.target

[Service]
Type=forking
User=root
ExecStart=/usr/bin/vpnserver start
ExecStop=/usr/bin/vpnserver stop
Restart=on-abort
WorkingDirectory=/opt/vpnserver/
ExecStartPre=/sbin/ip link set dev eth0 promisc on

[Install]
WantedBy=multi-user.target

起動の準備

sudo chmod 0755 /etc/systemd/system/vpnserver.service
sudo systemctl daemon-reload

vpnサーバーの起動

sudo systemctl start vpnserver
sudo systemctl enable vpnserver

vpnclient の設定ファイル

/etc/systemd/system/vpnclient.service
[Unit]
Description=Softether VPN Client Service
After=network.target

[Service]
Type=forking
User=root
ExecStart=/usr/bin/vpnclient start
ExecStop=/usr/bin/vpnclient stop
Restart=on-abort
WorkingDirectory=/opt/vpnserver/
ExecStartPre=/sbin/ip link set dev eth0 promisc on

[Install]
WantedBy=multi-user.target

このあとの操作は、vpncmd で行う
操作は、こちら
Arch Linux に SoftEther_VPN をインストール

接続状態をコマンドで調べる方法

vpncmd /server localhost /password:tiger /adminhub:DEFAULT /cmd DhcpTable

実行結果

Item            |Value
----------------+-------------------------
ID              |1
Leased at       |2018-03-25 (Sun) 16:19:49
Expires at      |2018-03-25 (Sun) 18:19:49
MAC Address     |CA-79-02-75-4F-65
Allocated IP    |192.168.30.10
Client Host Name|anonymous
The command completed successfully.
2
7
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
7