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

connect to local docker services #584

Open rae89 opened 4 years ago

rae89 commented 4 years ago

Right now I have openvpn running on my host machine. My host machine has other docker container running on the local network. I would like to connect to the docker container services once I am connceted to openvpn. For example I would like to access the jellyfin service when I connect to the vpn, but the browser does not connect to the service.

These are the steps I ran to setup openvpn:

docker-compose run --rm openvpn ovpn_genconfig -u udp://xxx.xxx.xx.xxx:1194 -N -d -c -p "route 172.18.0.2 255.255.255.0" docker-compose run --rm openvpn ovpn_initpki export CLIENTNAME="ipro3" docker-compose run --rm openvpn easyrsa build-client-full $CLIENTNAME nopass docker-compose run --rm openvpn ovpn_getclient $CLIENTNAME > $CLIENTNAME.ovpn docker-compose up -d openvpn

ATypescriptEnjoyer commented 3 years ago

If you're trying to connect via hostname you'll need to setup a dns proxy also.

erhan- commented 3 years ago

I created a concept using dnsmasq as DNS proxy. See here: https://github.com/kylemanna/docker-openvpn/issues/622

Works for one network.