docker-openvpn-client
docker-openvpn-client copied to clipboard
Local network access to published ports
In outside-access docker-compose, I need to access vpn:8000
within a local network.
https://github.com/0xcaff/docker-openvpn-client/blob/258069bba415e2d2fd0e57a918dfbf022eeaba66/examples/outside-access/docker-compose.yml#L54
I can access it from host by vpn
's ip, like 172.17.0.2:8000
if I publish port on vpn
as 8000:8000
. But it is not reachable from local network if OpenVPN is setup in it. You can try this on https://labs.play-with-docker.com with your docker compose. vpn:8000
will not be accesible from the internet.
I am not very familiar with ip routing, so I am not sure what is going on. I can make it work adding another container with 8000
as published port and using socat
to forward that port to vpn:8000
(example). But is there any native docker way to do it?