Featured image of post SoftEther VPNをProxmoxで構築する

SoftEther VPNをProxmoxで構築する

# はじめに

外出中に自宅のネットワークにアクセスしたいことがある。
そういった場合に VPN を利用することでローカルネットワークへのリモートアクセスが可能になる。
そこで今回は SoftEther VPN を使用した。

# 手順

# Proxmox VE

Proxmox VEで VM の作成で気をつけることが 1 つある。
デフォルトのネットワークデバイスのモデルはVirtIO (準仮想化)だと思うが、Intel E1000に変更するする必要がある。
これをしないと、上り下りのスループットが 3Mbps 程しか出ない。

# SoftEther VPN

# ダウンロード

PPA を使用してインストールもできるが、バージョンが古いのでダウンロードサイトから手動で入れる。

$ sudo apt install gcc make -y

$ curl -O <ファイルのURL>

$ tar xzvf <ファイル>

$ cd vpnserver

$ make

$ cd ..

$ sudo mv vpnserver /usr/local/softether

$ cd /usr/local/softether/vpnserver

$ chmod 600 *

$ chmod 700 vpncmd vpnserver

# Systemd

コレを参考に/etc/systemd/system/softether-vpnserver.serviceを作成する。

[Unit]
Description=SoftEther VPN Server
After=network.target auditd.service
ConditionPathExists=!/usr/local/softether/vpnserver/do_not_run

[Service]
Type=forking
TasksMax=infinity
EnvironmentFile=-/usr/local/softether/vpnserver
ExecStart=/usr/local/softether/vpnserver/vpnserver start
ExecStop=/usr/local/softether/vpnserver/vpnserver stop
KillMode=process
Restart=on-failure

# Hardening
PrivateTmp=yes
ProtectHome=yes
ProtectSystem=full
ReadOnlyDirectories=/
ReadWriteDirectories=-/usr/local/softether/vpnserver
CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE CAP_NET_BROADCAST CAP_NET_RAW CAP_SYS_NICE CAP_SYSLOG CAP_SETUID

[Install]
WantedBy=multi-user.target

その後

$ sudo systemctl daemon-reload

$ sudo systemctl start softether-vpnserver.service

$ sudo systemctl enable softether-vpnserver.service

$ sudo systemctl status softether-vpnserver.service

あとはサーバー管理ツール等で VPN の設定をすれば完了です。


# 参考

Built with Hugo
Theme Stack designed by Jimmy