March 24, 20233 yr Hello So how do you really set up this correct? So I have an Unraid server with div dockers and I have another lab offsite, and I want some containers to be connected to their own isolated network with 1 OpenVPN container connected to the other site and the isolated containers to only be able to talk to the outside though the OpenVPN container. Even it is an option, I don't want the entire Unraid server to be connected to the other site though VPN. I have tried to set up this by setting the container network to "none" and use the parameter "--net=container:OpenVPNContainer", and it works, but the problem with this solution is that if you setup more than one identical container, say an web-server, even if I change the ports on the 2nd one, it wont work, and I think this has to do with that with this solution, the containers share the same IP I know you can setup different docker network types others than the bridged, host and none, and its easy enough to setup an isolated network where each container inside has their own IP on an isolated subnet, and I can get them to talk to each other on the Unraid server, but how to I route them though the VPN container? Do the VPN container need to be connected to 2networks at once? (I read this is possible with newer versions of Docker) I guess there is some routing and config here I miss. If this was multiply physical computers or even VMs, I would have less problems setting this up, I would just put 2NICs on the VPN server. (not sure if I posed this in the right forum )
March 25, 20233 yr Author So after a lot of searching I tried the following: -create 2 new custom docker networks, vpnwan and vpnlan where vpnlan has the --internal=true flag on -connect the vpn container to both networks and set the LAN side on the vpn to be vpnlan subnet -connect another docker to vpnlan only Result is that I cant access the vpnlan docker from outside and though the vpn I tried the same thing with an proxy network, so I have a reverse proxy server connected to 2 networks, one --internal=true, and I get it to work there, so I know it should work, but I guess there is some routing or something openvpn may change that makes it not to work. edit: got it to work! I had forgot to add the port for the container in the vpn container correct. Edited March 25, 20233 yr by isvein got it to work!
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.