1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2026-01-27 22:00:11 +03:00

Cedar: Add "DefaultGateway" and "DefaultSubnet" virtual hub options

WireGuard does not provide any configuration messages, meaning that we cannot push the IP address we receive from the DHCP server to the client.

In order to overcome the limitation we don't perform any DHCP operations and instead just extract the source IP address from the first IPv4 packet we receive in the tunnel.

The gateway address and the subnet mask can be set using the new "SetStaticNetwork" command. The values can be retrieved using "OptionsGet".

In future we will add a "allowed source IP addresses" function, similar to what the original WireGuard implementation provides.

================================================================================

SetStaticNetwork command - Set Virtual Hub static IPv4 network parameters
Help for command "SetStaticNetwork"

Purpose:
  Set Virtual Hub static IPv4 network parameters

Description:
  Set the static IPv4 network parameters for the Virtual Hub. They are used when DHCP is not available (e.g. WireGuard sessions).
  You can get the current settings by using the OptionsGet command.

Usage:
  SetStaticNetwork [/GATEWAY:gateway] [/SUBNET:subnet]

Parameters:
  /GATEWAY - Specify the IP address of the gateway that will be used for internet communication.
  /SUBNET  - Specify the subnet mask, required to determine the size of the local VPN network.
This commit is contained in:
Davide Beatrici
2020-09-01 03:04:14 +02:00
parent decfcecc97
commit afe576dcdc
14 changed files with 171 additions and 10 deletions

View File

@ -5084,6 +5084,16 @@ CMD_Offline_Help 現在管理している仮想 HUB がオンラインになっ
CMD_Offline_Args Offline
# SetStaticNetwork command
CMD_SetStaticNetwork Set Virtual Hub static IPv4 network parameters
CMD_SetStaticNetwork_Help Set the static IPv4 network parameters for the Virtual Hub. They are used when DHCP is not available (e.g. WireGuard sessions). \nYou can get the current settings by using the OptionsGet command.
CMD_SetStaticNetwork_Args SetStaticNetwork [/GATEWAY:gateway] [/SUBNET:subnet]
CMD_SetStaticNetwork_GATEWAY Specify the IP address of the gateway that will be used for internet communication.
CMD_SetStaticNetwork_SUBNET Specify the subnet mask, required to determine the size of the local VPN network.
CMD_SetStaticNetwork_Prompt_GATEWAY Gateway:
CMD_SetStaticNetwork_Prompt_SUBNET Subnet mask:
# SetMaxSession コマンド
CMD_SetMaxSession 仮想 HUB の最大同時接続セッション数を設定する
CMD_SetMaxSession_Help 現在管理している仮想 HUB の、最大同時接続セッション数を設定します。最大同時接続セッション数を越えたセッションが、VPN Client や VPN Bridge から接続された場合、最大同時接続セッション数を上回った時点で、それ以上クライアントは接続できなくなります。この最大同時接続セッション数の制限には、ローカルブリッジ、仮想 NAT、カスケード接続などによって仮想 HUB 内に生成されるセッションは含まれません。\n現在の最大同時接続セッション数の設定は、OptionsGet コマンドによって取得することができます。\nこのコマンドは、VPN Bridge では実行できません。\nこのコマンドは、クラスタとして動作している VPN Server の仮想 HUB では実行できません。
@ -5120,7 +5130,8 @@ CMD_OptionsGet_ENUM 匿名ユーザーに対する仮想 HUB の列挙
CMD_OptionsGet_MAXSESSIONS 最大同時接続セッション数
CMD_OptionsGet_STATUS 状態
CMD_OptionsGet_TYPE 仮想 HUB の種類
CMD_OptionsGet_GATEWAY Default gateway
CMD_OptionsGet_SUBNET Default subnet
# RadiusServerSet コマンド