[PR #277] [MERGED] feat: allow to specify static IP addresses #480

Closed
opened 2026-03-02 08:35:39 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hwdsl2/docker-ipsec-vpn-server/pull/277
Author: @wolasss
Created: 2/12/2022
Status: Merged
Merged: 3/4/2022
Merged by: @hwdsl2

Base: masterHead: master


📝 Commits (3)

  • b513fe0 feat: allow to specify additional users ip addresses
  • fac6815 feat: support additional IP for ipsec/xauth
  • 0320b69 fix: VPN_ADDL_IP_ADDRS parameter handling

📊 Changes

1 file changed (+12 additions, -2 deletions)

View changed files

📝 run.sh (+12 -2)

📄 Description

This PR introduces optional static IP addresses that work both in l2tp and ipsec-xauth.

This feature request has been brought up many times: https://github.com/hwdsl2/docker-ipsec-vpn-server/issues/32, https://github.com/hwdsl2/docker-ipsec-vpn-server/pull/222 https://github.com/hwdsl2/docker-ipsec-vpn-server/issues/159 https://github.com/hwdsl2/setup-ipsec-vpn/issues/508

This feature is very much needed as one cannot easily build own Dockerfile based on this image because all of the configurations are done in run.sh script that is being run on CMD. Therefore, in the child Dockerfile, it is impossible to extend this configuration script - one has to copy the whole repository which is a hassle (for instance keeping it up to date).

With this PR, the user can specify VPN_ADDL_IP_ADDRS in addition to VPN_ADDL_USERS and VPN_ADDL_PASSWORDS. It works the same, for example:

VPN_ADDL_USERS=adduser1 adduser2 adduser3
VPN_ADDL_PASSWORDS=test1 test2 test3
VPN_ADDL_IP_ADDRS=192.168.42.3 192.168.42.4

adduser1 will be assigned 192.168.42.3, adduser2 is assigned 192.168.42.4 and adduser3 is assigned a dynamic IP address from the pool. Note, that the users with dynamic IP addresses should be stated at the end of the list (this should be stated in the docs).

Please let me know what do you think if you like it I can:

  1. possibly add the same feature with IKEv2
  2. add VPN_ADDL_IP_ADDRS parameter validation
  3. update the documentation to cover this and explain the limitations (such that a user by default could specify 42.2-42.9 address or adjust VPN_L2TP_POOL accordingly)

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/hwdsl2/docker-ipsec-vpn-server/pull/277 **Author:** [@wolasss](https://github.com/wolasss) **Created:** 2/12/2022 **Status:** ✅ Merged **Merged:** 3/4/2022 **Merged by:** [@hwdsl2](https://github.com/hwdsl2) **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (3) - [`b513fe0`](https://github.com/hwdsl2/docker-ipsec-vpn-server/commit/b513fe047441ea97bc3b41be80b9bd3681007338) feat: allow to specify additional users ip addresses - [`fac6815`](https://github.com/hwdsl2/docker-ipsec-vpn-server/commit/fac68155e667b0055954b9f16d3cd9f333041476) feat: support additional IP for ipsec/xauth - [`0320b69`](https://github.com/hwdsl2/docker-ipsec-vpn-server/commit/0320b699370faaab30ca178a70f82de647d315cf) fix: VPN_ADDL_IP_ADDRS parameter handling ### 📊 Changes **1 file changed** (+12 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `run.sh` (+12 -2) </details> ### 📄 Description This PR introduces optional static IP addresses that work both in l2tp and ipsec-xauth. This feature request has been brought up many times: https://github.com/hwdsl2/docker-ipsec-vpn-server/issues/32, https://github.com/hwdsl2/docker-ipsec-vpn-server/pull/222 https://github.com/hwdsl2/docker-ipsec-vpn-server/issues/159 https://github.com/hwdsl2/setup-ipsec-vpn/issues/508 This feature is very much needed as one cannot easily build own Dockerfile based on this image because all of the configurations are done in `run.sh` script that is being run on CMD. Therefore, in the child Dockerfile, it is impossible to extend this configuration script - one has to copy the whole repository which is a hassle (for instance keeping it up to date). With this PR, the user can specify `VPN_ADDL_IP_ADDRS` in addition to `VPN_ADDL_USERS` and `VPN_ADDL_PASSWORDS`. It works the same, for example: ``` VPN_ADDL_USERS=adduser1 adduser2 adduser3 VPN_ADDL_PASSWORDS=test1 test2 test3 VPN_ADDL_IP_ADDRS=192.168.42.3 192.168.42.4 ``` `adduser1` will be assigned 192.168.42.3, `adduser2` is assigned 192.168.42.4 and `adduser3` is assigned a dynamic IP address from the pool. Note, that the users with dynamic IP addresses should be stated at the end of the list (this should be stated in the docs). Please let me know what do you think if you like it I can: 1) possibly add the same feature with IKEv2 2) add `VPN_ADDL_IP_ADDRS` parameter validation 3) update the documentation to cover this and explain the limitations (such that a user by default could specify 42.2-42.9 address or adjust VPN_L2TP_POOL accordingly) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-02 08:35:39 +03:00
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#480
No description provided.