r/docker • u/hannes3120 • 4h ago
Multiple VPNs?
Right now I have a docker container with a VPN that provides it's connection to the other services.
I thought about adding a VPN connection on the host system to basically create a multihop over different providers. Would that work?
As far as I understood the one inside the docker should be the "better" one as that's the one that's exposed first and the one on host would only see the VPN-encrypted traffic anyway? How about port forwarding? That should only be necessary on the one inside docker, too - or is there something I'm missing?
What are the disadvantages to do that (other than the lower speed)? Could I actually add risk of exposure if just one of them is compromised?
Or would it be smarter to spin up another docker and route the traffic through that one?
1
u/WikibearTheReal 4h ago
You can use netbird in the same compose file as the service. Then you have for each service isolated VPN.
1
u/christophla 4h ago
Why not just use the host network? But if you need a VPN - especially one that involves other remote hosts - maybe take a look at wireguard (Tailscale makes it easier). You’ll get a CGNAT overlay network that shouldn’t require as much complexity as a traditional vpn.