[GH-ISSUE #291] Change VPN subnets! #268

Closed
opened 2026-03-02 08:00:55 +03:00 by kerem · 1 comment
Owner

Originally created by @alkolexx on GitHub (May 8, 2022).
Original GitHub issue: https://github.com/hwdsl2/docker-ipsec-vpn-server/issues/291

Hello!
It is very necessary to change vpn addressing of subnets 192.168.42.* and 192.168.43.* docker solution... Can this be done using .env file or are there other ways?

Originally created by @alkolexx on GitHub (May 8, 2022). Original GitHub issue: https://github.com/hwdsl2/docker-ipsec-vpn-server/issues/291 Hello! It is very necessary to change vpn addressing of subnets 192.168.42.* and 192.168.43.* docker solution... Can this be done using .env file or are there other ways?
kerem closed this issue 2026-03-02 08:00:55 +03:00
Author
Owner

@hwdsl2 commented on GitHub (May 8, 2022):

@alkolexx Hello! Advanced users may specify custom subnet(s) in the env file, see examples below. You must re-create the Docker container after modifying the env file.

# Example for IPsec/L2TP mode
VPN_L2TP_NET=10.1.0.0/16
VPN_L2TP_LOCAL=10.1.0.1
VPN_L2TP_POOL=10.1.0.10-10.1.254.254
# Example for IPsec/XAuth and IKEv2 modes
VPN_XAUTH_NET=10.2.0.0/16
VPN_XAUTH_POOL=10.2.0.10-10.2.254.254

VPN_L2TP_LOCAL is the VPN server's internal VPN IP for IPsec/L2TP mode. VPN_L2TP_POOL and VPN_XAUTH_POOL are the pools of auto-assigned IP addresses for VPN clients.

Note that if you specify VPN_XAUTH_POOL in the env file, and IKEv2 is already set up in the Docker container, you must manually edit /etc/ipsec.d/ikev2.conf inside the container and replace rightaddresspool=192.168.43.10-192.168.43.250 with the same value as VPN_XAUTH_POOL, before re-creating the Docker container. Otherwise, IKEv2 may stop working.

<!-- gh-comment-id:1120496775 --> @hwdsl2 commented on GitHub (May 8, 2022): @alkolexx Hello! Advanced users may specify custom subnet(s) in the `env` file, see examples below. You must re-create the Docker container after modifying the `env` file. ``` # Example for IPsec/L2TP mode VPN_L2TP_NET=10.1.0.0/16 VPN_L2TP_LOCAL=10.1.0.1 VPN_L2TP_POOL=10.1.0.10-10.1.254.254 ``` ``` # Example for IPsec/XAuth and IKEv2 modes VPN_XAUTH_NET=10.2.0.0/16 VPN_XAUTH_POOL=10.2.0.10-10.2.254.254 ``` `VPN_L2TP_LOCAL` is the VPN server's internal VPN IP for IPsec/L2TP mode. `VPN_L2TP_POOL` and `VPN_XAUTH_POOL` are the pools of auto-assigned IP addresses for VPN clients. Note that if you specify `VPN_XAUTH_POOL` in the `env` file, and IKEv2 is already set up in the Docker container, you **must** manually edit `/etc/ipsec.d/ikev2.conf` inside the container and replace `rightaddresspool=192.168.43.10-192.168.43.250` with the **same value** as `VPN_XAUTH_POOL`, before re-creating the Docker container. Otherwise, IKEv2 may stop working.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/docker-ipsec-vpn-server#268
No description provided.