ラズパイでVPN
今さらですがラズパイでのVPN(SoftEtherVPN)導入の話です。以前のバージョンではARMアーキテクチャの64bit版ではエラーが発生するため32bit版を使用していましたが、現在のバージョン(9760安定版)ではエラーが解消されているため64bit版を選びます。公式サイトからダウンロードした圧縮ファイルを解凍しvpnserverフォルダでmakeすると必要なモジュールが得られます。/usr/local/vpnserverなどにフォルダ毎移植し644などに変更しておきます。
「./vpnserver start」コマンドでサーバーを初回起動すると必要な構成ファイル「vpn_server.config」が作成されます。DDNSを移行するためには「DDnsClient」セクションの「byte Key」を移植します。移植の際はvpnserverを停止しておく必要があります。稼働したまま構成ファイルを変更しても再起動や停止すると稼働状態の構成で上書きされてしまいます。
declare DDnsClient { bool Disabled false byte Key xxxxxxxxxxxxxxxxxxxxxxxx string LocalHostname cctv string ProxyHostName $ uint ProxyPort 0 uint ProxyType 0 string ProxyUsername $ }
サーバー構成・管理用のアプリはWindows版かIntel Mac用しか用意されていません。コマンドラインでDDNSを確認するには、以下の「./vpncmd」コマンドを使用します。「1. Management of VPN Server or VPN Bridge 」の後、Hub Nameを入れずに空エンターし、パスワードを入力後「hub」コマンドでvpnを指定します。DDNSを確認するコマンドは「DynamicDnsGetStauts」です。
root@vpn:/usr/local/vpnserver# ./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: 1 Specify the host name or IP address of the computer that the destination VPN Server or VPN Bridge is operating on. By specifying according to the format 'host name:port number', you can also specify the port number. (When the port number is unspecified, 443 is used.) If nothing is input and the Enter key is pressed, the connection will be made to the port number 8888 of localhost (this computer). Hostname of IP Address of Destination: 192.168.99.253:992 If connecting to the server by Virtual Hub Admin Mode, please input the Virtual Hub name. If connecting by server admin mode, please press Enter without inputting anything. Specify Virtual Hub Name: Password: ******* Connection has been established with VPN Server "192.168.99.253" (port 992). You have administrator privileges for the entire VPN Server. VPN Server>hub vpn Hub command - Select Virtual Hub to Manage The Virtual Hub "VPN" has been selected. The command completed successfully. VPN Server/VPN>DynamicDnsGetStatus DynamicDnsGetStatus command - Show the Current Status of Dynamic DNS Function Item |Value ----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------- Assigned Dynamic DNS Hostname (Full) |vpn12345678.softether.net Assigned Dynamic DNS Hostname (Hostname)|vpn12345678 DNS Suffix |.softether.net Global IPv4 Address |106.153.xxx.xxx Global IPv6 Address |Connection to the server failed. Check network connection and make sure that address and port number of destination server are correct. The command completed successfully. VPN Server/VPN>
手持ちのラズパイは4も3もUbuntu 18.04から22.04へのアップグレードが完了しています。サポート期限は2027年4月です。EC2も前回の騒動で結果的に22.04へのアップグレードを果たしました。残るはデータベースサーバーとZABBIX監視サーバーです。2023年4月までにUbuntu 22.04へのアップグレードが必要です。