-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to connect to VPN server in docker network #745
Comments
These comments from other threads suggest that this is possible:
However, I haven't had any luck and feel like I might be missing something obvious. |
This is painful to learn about but it may not be as hard as it seems. Add the openvpn container to a Docker network Make sure that your route for the VPN is not using an overlapping IP range with the Docker network e.g. in ./openvpn-data/conf/openvpn.conf I have
You should see the requests coming from the VPN clients. To make this permanent you could build a docker container that wraps around the kylemanna/openvpn image e.g. Dockerfile:
One VERY painful lesson is understanding how Windows machines build DNS requests by adding suffixes to simple names. This can mean the Docker network DNS cannot resolve the DNS request, to get around this you can add a . to turn the container name into a FQN e.g. the IP of the container openvpn can be found with: |
I have a bunch of containers running on a docker bridge network called
dev
. I want to be able to run a VPN server there so that my host machine can connect to the network and access all the running containers on that network. This is all on the same device, so traffic never needs to use the public internet.Assume there is a docker network called
dev
already created on subnet172.28.0.0/16
.I created the VPN server using the instructions with slight modifications. The main differences are that I:
127.0.0.1
as the VPN server nameroute 172.28.0.0 255.255.255.0
to the VPN configdev
network (172.28.0.0/16
)After this, I use Tunnelblick to connect to the server using the
CLIENTNAME.ovpn
but it hangs on waiting for a server response.The text was updated successfully, but these errors were encountered: