[GH-ISSUE #385] Change default ports #358

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

Originally created by @grinono on GitHub (Jun 9, 2023).
Original GitHub issue: https://github.com/hwdsl2/docker-ipsec-vpn-server/issues/385

I'm running this container on Kubernetes, but exposing it with nodePort will change the output ports to 30000+. I do not have a load balancer to trim down the ports again. There is no other"simple" way to directly expose to a lower range for UDP traffic.

Would it be somehow possible to change the exposed ports and then populate these in the generated config files? So the client connections are established directly to these non-standard ports?

Originally created by @grinono on GitHub (Jun 9, 2023). Original GitHub issue: https://github.com/hwdsl2/docker-ipsec-vpn-server/issues/385 I'm running this container on Kubernetes, but exposing it with nodePort will change the output ports to 30000+. I do not have a load balancer to trim down the ports again. There is no other"simple" way to directly expose to a lower range for UDP traffic. Would it be somehow possible to change the exposed ports and then populate these in the generated config files? So the client connections are established directly to these non-standard ports?
kerem closed this issue 2026-03-02 08:01:37 +03:00
Author
Owner

@hwdsl2 commented on GitHub (Jun 9, 2023):

@grinono Hello! Currently, with this Docker image it is not supported to change the default ports (UDP 500 and 4500) for the IPsec VPN. The related Libreswan option is leftikeport, read more at this link. You can customize this Docker image yourself and add this option to the IPsec configuration in run.sh, and modify the Dockerfile to expose different ports. This has not been tested, however, and IPsec VPN clients may not support connecting to custom ports.

<!-- gh-comment-id:1584600811 --> @hwdsl2 commented on GitHub (Jun 9, 2023): @grinono Hello! Currently, with this Docker image it is not supported to change the default ports (UDP 500 and 4500) for the IPsec VPN. The related Libreswan option is `leftikeport`, read more at [this link](https://libreswan.org/man/ipsec.conf.5.html). You can [customize this Docker image](https://github.com/hwdsl2/docker-ipsec-vpn-server/blob/master/docs/advanced-usage.md#build-from-source-code) yourself and add this option to the IPsec configuration in `run.sh`, and modify the Dockerfile to expose different ports. This has not been tested, however, and IPsec VPN clients may not support connecting to custom ports.
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#358
No description provided.