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

Two docker instances with different IPs #309

Open Webfenix opened 7 years ago

Webfenix commented 7 years ago

Hi, I'm trying to run two docker instances with different IP addresses adding needed IPs here:

docker run -v $OVPN_DATA:/etc/openvpn -d -p MY_IP:1194:1194/udp --cap-add=NET_ADMIN kylemanna/openvpn

And here:

docker run -v $OVPN_DATA:/etc/openvpn --rm kylemanna/openvpn ovpn_genconfig -u udp://IP

All created containers work, but I could not connect to VPN of second container. How can I solve this? Thanks.

jcberthon commented 6 years ago

I'm not sure what you mean here. I can see that you are running 1 OpenVPN server using the first command, but you start it while it has obviously no configuration so it probably fails right away.

Then you run another container which generate the first part of the configuration and then of course exit. You still need to generate the PKI. and then only then can you run the server, not before.

You should have a look at the documentation again.