1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

【2021年版】RaspberryPi4 + Ubuntu20.4 + SoftEther VPN Bridge 環境構築

Last updated at Posted at 2021-02-03

はじめに

  • RaspberryPi4をSoftEther VPNの拠点間接続HUBとして構築する
  • ここでは、Ubuntuのインストールと、SoftEther Bridgeインストールまでを記述する
  • VPN HUBの設定はSoftEtherのGUIでカスケード接続するだけなので割愛(気が向いたら)
  • 有線接続のみを利用し、Wifiは利用しない

Ubuntuのインストール

cloud init - Networking Config Version 2

network-config
# 修正例
version: 2
ethernets:
eth0:
  dhcp4: false
  dhcp6: false
  addresses: [192.168.0.8/24, 172.30.0.119/24, 10.1.0.21/24]
  gateway4: 192.168.0.1
  nameservers:
    addresses: [8.8.8.8, 1.1.1.1, 8.8.4.4]

cloud init - Cloud config examples

user-data
# 修正例
chpasswd:
expire: true
list:
- hoge:hogepas123
system_info:
default_user:
  name: hoge
# Enable password authentication with the SSH daemon
ssh_pwauth: false
ssh_authorized_keys:
- ssh-rsa AAAAB..... rsa-key-of-hoge
timezone: Asia/Tokyo
  • SDカードをRasberryPi4にセットして起動
  • SSHで設定したIPアドレスにアクセスできることを確認
  • OSのインストール/apt update/apt upgradeが走っているので終わるまで待つ(だいぶ長い)
  • ps aux | grep -i apt でaptがいなくなっていたら終わっていると思われるので作業を継続
    終わっていないとapt installでwaitingとなり継続できない

SoftEtherのインストール

  • 以下のコマンドを実行する
$ sudo apt install gcc make unzip
$ sudo apt install build-essential
$ sudo apt install libreadline-dev libssl-dev libncurses-dev libz-dev
$ wget http://jp.softether-download.com/files/softether/v4.34-9744-beta-2020.03.20-tree/Source_Code/softether-src-v4.34-9744-beta.zip
$ unzip softether-src-v4.34-9744-beta.zip
$ cd v4.34-9744/
$ vim src/Cedar/Server.c   # bool SiIsEnterpriseFunctionsRestrictedOnOpenSource(CEDAR *c) のreturn を false にする
$ chmod +x ./configure
$ vim Makefile   # 4箇所の -m64 オプションを削除
$ make
$ sudo make install
$ sudo vim /etc/systemd/system/vpnbridge.service # 修正内容は後述
$ sudo systemctl daemon-reload
$ sudo systemctl start vpnbridge
$ sudo systemctl enable vpnbridge
vpnbridge.service
[Unit]
Description=SoftEther VPN Bridge
After=network.target network-online.target

[Service]
ExecStart=/usr/bin/vpnbridge start
ExecStop=/usr/bin/vpnbridge stop
Type=forking
RestartSec=4s

[Install]
WantedBy=multi-user.target

SoftEtherの設定

  • GUIで行いましょう。カスケードのブリッジ作成時に、うまく行かないときはマシンを再起動したら動くことがあります。

感謝・参考URL

1
2
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
1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?