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

can set max clients ? #599

Open behroozbc opened 4 years ago

behroozbc commented 4 years ago

hi I want khow can i set max client ?

brainv commented 1 year ago

@behroozbc setting the max-clients has no effect (I haven't check the openvpn source though), but increasing the subnet will work. Example: from 10.1.0.0/20 to 10.1.0.0/16 will change from 1022 to 16382

From:

#openvpn.conf
server 10.1.0.0 255.255.240.0
route 10.1.0.0 255.255.240.0

#ovpn_env.sh
declare -x OVPN_SERVER=10.1.0.0/20

$ sudo docker logs openvpn | grep POOL | tail
Sat Dec  3 14:16:21 2022 IFCONFIG POOL: base=10.1.0.4 size=1022, ipv6=0

To:

#openvpn.conf
server 10.1.0.0 255.255.0.0
route 10.1.0.0 255.255.0.0

#ovpn_env.sh
declare -x OVPN_SERVER=10.1.0.0/16

$ sudo docker logs openvpn | grep POOL | tail
Tue Dec  6 21:24:07 2022 IFCONFIG POOL: base=10.1.0.4 size=16382, ipv6=0