How to have multiple containers exiting in Internet by one OpenVPN container

  • Hi, i have a NordVPN client container up and runnig, i would like to have the possibility to force other containers like for istance Transmission to use the NordVPN container instead of using the host adapter to exit out in Internet ; also i need to have the possibility to reach the Transmission GUI or WebUI from within the internal network after the containers are under the VPN network.
    I read that i just have to add some parameters into the docker GUI but i don't know how to and where to do it, as i'm so new in docker...
    Is there sombody helping me with some explanation or example?
    I searched a lot but i'm still too much confused...
    Thank you in advance :)

  • I just managed to get this running on my system yesterday.


    Take a look at this page to start:


    https://forum.openmediavault.o…by-one-OpenVPN-container/


    Here are my docker configs. I am running
    1) PIA in a openvpn Docker
    2) Contaner running rutorrent (via the PIA docker)
    3) nginx


    Here are my docker commands:


    1) This is the PIA openvpn docker container.
    docker pull itsdaspecialk/pia-openvpn
    docker run --cap-add=NET_ADMIN --name=pia -d \
    --restart=always \
    --dns 209.222.18.222 --dns 209.222.18.218 \
    -e 'REGION=US East' \
    -e 'USERNAME=USERID' \
    -e 'PASSWORD=PASSWORD' \
    itsdaspecialk/pia-openvpn


    2) This is the rutorrent docker container (NOTE --net=container:pia) this will force it to go throught the PIA containers network.
    docker run -itd --net=container:pia --name=rutorrent \
    -v /srv/dev-disk-by-label-BIGDISK/Torrent:/config \
    -v /srv/dev-disk-by-label-BIGDISK/Torrent:/downloads \
    -e PGID=100 -e PUID=1000 \
    -e TZ=America/Toronto \
    --restart=always \
    linuxserver/rutorrent


    3) nginx so we can get to the web interface of rutorret
    docker run --link=pia:rutorrent -d --name=nginx \
    -v /root/nginx.conf:/etc/nginx/nginx.conf:ro \
    -p 8888:8888 \
    nginx


    4) Here is my nginx config file
    events {
    worker_connections 1024;
    }


    http {
    server {
    listen 8888;
    location / {
    proxy_pass http://172.17.0.2:80;
    }
    }
    }

  • Hi, thank you for your clear explanation, i'm using docker's GUI and still can't figurate off how to pass some parameters to the container, --net=container:vpn is one...
    I'm thinking that to have all working i will have to leave the GUI and create everything from bash, am i right?

  • I see, i have done everything from bash and now it's all working as expected :)


    Another question, do you know if it's possible to have all clients containers starting after the vpn-server container is up and running? And if so how?

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!