kylemanna / docker-openvpn

🔒 OpenVPN server in a Docker container complete with an EasyRSA PKI CA
https://hub.docker.com/r/kylemanna/openvpn/
MIT License
8.73k stars 2.39k forks source link

Change IP Range #690

Open m-jaggi opened 2 years ago

m-jaggi commented 2 years ago

Hello, I'd like to change the IP range for the VPN (set by default to 192.168.255.0). How can I do that ?

Thanks for your help

Pezhvak commented 2 years ago

Hey, i just had your problem and solved it by examining source code, you can actually change IP range when initiating:

# Making configuration files
docker-compose run --rm openvpn ovpn_genconfig -c -s 192.168.255.0/24 -u udp://VPN.SERVERNAME.COM
# Configuration to store all users in
docker-compose run --rm openvpn ovpn_initpki

Note that -s is what you are looking for.