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.68k stars 2.38k forks source link

Always getting same IP for clients #549

Open Ventzy opened 4 years ago

Ventzy commented 4 years ago

I have generated two client configs with

docker run -v $OVPN_DATA:/etc/openvpn --log-driver=none --rm -it kylemanna/openvpn easyrsa build-client-full CLIENTNAME_1 nopass
docker run -v $OVPN_DATA:/etc/openvpn --log-driver=none --rm kylemanna/openvpn ovpn_getclient CLIENTNAME_1 > CLIENTNAME_1.ovpn
docker run -v $OVPN_DATA:/etc/openvpn --log-driver=none --rm -it kylemanna/openvpn easyrsa build-client-full CLIENTNAME_2 nopass
docker run -v $OVPN_DATA:/etc/openvpn --log-driver=none --rm kylemanna/openvpn ovpn_getclient CLIENTNAME_2 > CLIENTNAME_2.ovpn

And I can connect to the server, but both of them are getting the same IP. I have read that this may be caused by same CN in client certificates, but I haven't specified any CNs manually. I have also tried to setup permanent IP for each client by setting it with ifconfig-push in /etc/openvpn/ccd/CLIENTNAME_1 but I still get the same IP regardless of this configs. Any ideas?

erhan- commented 3 years ago

The CLIENTNAME_1 and 2 are used for CN normally. Check if the certificates are the same.