Ubuntu20.04にSoftEther VPN Clientインストール

Linux
スポンサーリンク
スポンサーリンク
スポンサーリンク
スポンサーリンク

前提

SoftEther VPN Server の初期設定、DHCP設定、アカウント設定等が完了していること

構築環境

CPU:E5-2650 v3 ×2
OS:Ubuntu Server 20.04

download

必要ツール

apt install -y make gcc

SoftEther VPN Client ソフトウェア

下記URLからお使いのCPUのアーキテクチャに適応したSoftEther VPN Client ソフトウェアのダウンロードURLをコピーします。
https://www.softether-download.com/ja.aspx?product=softether
wgetコマンドを利用してSoftEther VPN Client ソフトウェアをダウンロードします。下記コマンドは執筆時点(2022/02/18)でx64の最新ビルドをダウンロードするコマンドです。

wget https://github.com/SoftEtherVPN/SoftEtherVPN_Stable/releases/download/v4.38-9760-rtm/softether-vpnclient-v4.38-9760-rtm-2021.08.17-linux-x64-64bit.tar.gz

SoftEther VPN Client のインストール

・ダウンロードしたSoftEther VPN Clientの展開

tar xzvf softether-vpnclient-v4.38-9760-rtm-2021.08.17-linux-x64-64bit.tar.gz

・展開したディレクトリに移動してビルド

cd vpnclient
make

・プログラムの配置

cd ..
mv vpnclient /usr/local
ls -l /usr/local/vpnclient/

・パーミッション設定

cd /usr/local/vpnclient/
chmod 600 *
chmod 700 vpncmd
chmod 700 vpnclient

・サービス登録

nano /etc/systemd/system/vpnclient.service
---下記を入力---
[Unit]
Description=SoftEther VPN Client
After=network.target network-online.target

[Service]
ExecStart=/usr/local/vpnclient/vpnclient start
ExecStop=/usr/local/vpnclient/vpnclient stop
Type=forking
RestartSec=3s

[Install]
WantedBy=multi-user.target
---以上---

systemctl enable vpnclient
systemctl start vpnclient

・vNic設定
/usr/local/vpnclient/vpncmdを実行
Selectで「2」(Management of VPN Client)を選択

root@fmvd2801bp-01:/usr/local/vpnclient# /usr/local/vpnclient/vpncmd
vpncmd command - SoftEther VPN Command Line Management Utility
SoftEther VPN Command Line Management Utility (vpncmd command)
Version 4.38 Build 9760   (English)
Compiled 2021/08/17 22:32:49 by buildsan at crosswin
Copyright (c) SoftEther VPN Project. All Rights Reserved.

By using vpncmd program, the following can be achieved.

1. Management of VPN Server or VPN Bridge
2. Management of VPN Client
3. Use of VPN Tools (certificate creation and Network Traffic Speed Test Tool)

Select 1, 2 or 3: 2 

Specify the host name or IP address of the computer that the destination VPN Client is operating on.
If nothing is input and Enter is pressed, connection will be made to localhost (this computer).
Hostname of IP Address of Destination: localhost

Connected to VPN Client "localhost".

VPN Client>
VPN Client>NicCreate vnic
NicCreate command - Create New Virtual Network Adapter
The command completed successfully.

VPN Client>AccountCreate [アカウント名] /SERVER:[SoftEtherVPNServerIP]:[Port] /HUB:"[HUB名]" /USERNAME:[ユーザ名] /NICNAME:[NicCreateで作ったNIC名]
AccountCreate command - Create New VPN Connection Setting
The command completed successfully.

VPN Client>AccountPasswordSet [アカウント名] /PASSWORD:[Password] /TYPE:standard
AccountPasswordSet command - Set User Authentication Type of VPN Connection Setting to Password Authentication
The command completed successfully.

VPN Client>AccountStartupSet [アカウント名]
AccountStartupSet command - Set VPN Connection Setting as Startup Connection
The command completed successfully.

VPN Client>AccountConnect [アカウント名]
AccountConnect command - Start Connection to VPN Server using VPN Connection Setting
The command completed successfully.

VPN Client>exit
NicCreate [NIC名]
AccountCreate [アカウント名] /SERVER:[SoftEtherVPNServerIP]:[Port] /HUB:"[HUB名]" /USERNAME:[ユーザ名] /NICNAME:[NicCreateで作ったNIC名]
AccountPasswordSet [アカウント名] /PASSWORD:[Password] /TYPE:standard
AccountStartupSet [アカウント名]
AccountConnect [アカウント名]

vNICのIPアドレス設定

DHCP

dhclient vpn_vnic

Static

nano /etc/netplan/99-manual.yaml
---
network:
  version: 2
  ethernets:
    vpn_vnic:
      dhcp4: false
      dhcp6: false
      addresses:
        - 192.168.30.10/24
---
netplan apply

コメント