Ubuntu にインストールした SoftEther VPN サーバーの仮想 NAT と仮想 DHCP をオフにする方法

前書き

SoftEther VPN サーバー (VPN サーバー) のコマンドリファレンスを調べていて、ふとしたことから自宅パソコンで運用している VPN サーバーで仮想 NAT 機能と仮想 DHCP 機能が動いていることに気がついた。

どちらの機能も使っていないのでこの機能をオフする方法について調べたのでメモしておこうと思った。

仮想 NAT 機能も仮想 DHCP 機能もどちらも SecureNAT と呼ばれる機能に含まれているものだ。

公式サイトの説明ページ —> 3.7 仮想 NAT および仮想 DHCP サーバー

コマンド操作でこれらをオフにする方法を以下に紹介する。

確認、設定変更、確認

はじめに、コマンド操作を行うために vpncmd を起動する。

$ sudo ./vpncmd
vpncmd command - SoftEther VPN Command Line Management Utility
SoftEther VPN Command Line Management Utility (vpncmd command)
Version 4.39 Build 9772 (English)
Compiled 2022/04/26 18:00:50 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: localhost:5555

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 "localhost" (port 5555).

You have administrator privileges for the entire VPN Server.

VPN Server>

我が家の VPN サーバーは tcp: 5555 でアクセスするように設定してあるので localhost:5555 と指定している。

次に仮想 HUB に接続する。hub コマンドを使う。

VPN Server>hub hogeubuntu-vpn-vhub
Hub command - Select Virtual Hub to Manage
The Virtual Hub "lenovobuntu-vpn-vhub" has been selected.
The command completed successfully.

VPN Server/hogeubuntu-vpn-vhub>

そして、仮想 NAT 機能の設定がどうなっているかを確認する。コマンドは nagtet だ。

VPN Server/hogeubuntu-vpn-vhub>natget
NatGet command - Get Virtual NAT Function Setting of SecureNAT Function
Item |Value
-------------------------------+-----
Use Virtual NAT Function |Yes
MTU Value |1500
TCP Session Timeout (Seconds) |1800
UDP Session Timeout (Seconds) |60
Save NAT and DHCP Operation Log|Yes
The command completed successfully.

VPN Server/hogeubuntu-vpn-vhub>

Use Virtual NAT Function | Yes となっていることからわかるように仮想 NAT の機能が有効になっている。

さらに、仮想 DHCP 機能の設定がどうなっているかを確認する。コマンドは dhcpget だ。

VPN Server/hogeubuntu-vpn-vhub>dhcpget
DhcpGet command - Get Virtual DHCP Server Function Setting of SecureNAT Function
Item |Value
-------------------------------+--------------
Use Virtual DHCP Function |Yes
Start Distribution Address Band|192.168.30.10
End Distribution Address Band |192.168.30.200
Subnet Mask |255.255.255.0
Lease Limit (Seconds) |7200
Default Gateway Address |192.168.30.1
DNS Server Address 1 |192.168.30.1
DNS Server Address 2 |None
Domain Name |
Save NAT and DHCP Operation Log|Yes
Static Routing Table to Push |
The command completed successfully.

VPN Server/hogeubuntu-vpn-vhub>

Use Virtual DHCP Function | Yes となっている。このことから仮想 DHCP 機能も有効となっていることがわかる。

では、機能を無効にしていく。

仮想 NAT 機能を無効にする。コマンドは natdisable だ。

VPN Server/hogeubuntu-vpn-vhub>natdisable
NatDisable command - Disable Virtual NAT Function of SecureNAT Function
The command completed successfully.

VPN Server/hogeubuntu-vpn-vhub>natget
NatGet command - Get Virtual NAT Function Setting of SecureNAT Function
Item |Value
-------------------------------+-----
Use Virtual NAT Function |No
MTU Value |1500
TCP Session Timeout (Seconds) |1800
UDP Session Timeout (Seconds) |60
Save NAT and DHCP Operation Log|Yes
The command completed successfully.

VPN Server/hogeubuntu-vpn-vhub>

続いて、仮想 DHCP を無効にする。コマンドは dhcpdisable になる。

VPN Server/hogeubuntu-vpn-vhub>dhcpdisable
DhcpDisable command - Disable Virtual DHCP Server Function of SecureNAT Function
The command completed successfully.

VPN Server/hogeubuntu-vpn-vhub>dhcpget
DhcpGet command - Get Virtual DHCP Server Function Setting of SecureNAT Function
Item |Value
-------------------------------+--------------
Use Virtual DHCP Function |No
Start Distribution Address Band|192.168.30.10
End Distribution Address Band |192.168.30.200
Subnet Mask |255.255.255.0
Lease Limit (Seconds) |7200
Default Gateway Address |192.168.30.1
DNS Server Address 1 |192.168.30.1
DNS Server Address 2 |None
Domain Name |
Save NAT and DHCP Operation Log|Yes
Static Routing Table to Push |
The command completed successfully.

VPN Server/hogeubuntu-vpn-vhub>

これで両方の機能の無効化ができた。

あとは hub コマンド、exit コマンドで抜けていけばオーケーだ。

VPN Server/hogeubuntu-vpn-vhub>hub
Hub command - Select Virtual Hub to Manage
The Virtual Hub selection has been unselected.
The command completed successfully.

VPN Server>exit
$

コマンドリファレンス

最後に、SoftEther VPN 公式サイトのコマンドリファレンスのページを紹介しておこう。

6.4.94 “NatGet”: SecureNAT 機能の仮想 NAT 機能の設定の取得

6.4.99 “DhcpGet”: SecureNAT 機能の仮想 DHCP サーバー機能の設定の取得

こういうページを読むことに慣れていくと作業がはかどります。

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

このサイトはスパムを低減するために Akismet を使っています。コメントデータの処理方法の詳細はこちらをご覧ください