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.72k stars 2.39k forks source link

how i change 192.168.255 to 192.168.0 #394

Open cirelramos opened 6 years ago

cirelramos commented 6 years ago

OVPN_ROUTES+=("192.168.254.0/24") 192.168.255??

marvin-w commented 6 years ago

Hi @cirelramos

According to the scripts the line you're searching is:

OVPN_SERVER=192.168.255.0/24

In order to change this you need to adjust the line in file manually as there is no option for it (at least not as far as I know)

OVPN_SERVER=192.168.0.0/24

The subnet mask of 24 will allow 254 clients ranging from 192.168.0.0 to 192.168.0.254.

Source: https://github.com/kylemanna/docker-openvpn/blob/master/bin/ovpn_genconfig#L167

Try running the genconfig with the -s parameter like so:

docker run -v $OVPN_DATA:/etc/openvpn --rm kylemanna/openvpn ovpn_genconfig -u udp://VPN.SERVERNAME.COM -s 192.168.0.0/24

I haven't tested this, but it should do just fine.