Running containers through an OpenVPN container

    • OMV 4.x

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • Running containers through an OpenVPN container

      Here's my goal: Run sabnzbd and deluge containers through an openvpn container. I know that there are some "bundled" images out there for things like deluge+openvpn, but I'd prefer not to have separate vpn connections for each container since the number of connections are limited by my vpn provider.

      This works to create the openvpn container:

      Source Code

      1. docker run -it --cap-add=NET_ADMIN --device /dev/net/tun --name vpn -v /etc/openvpn/client:/vpn -d dperson/openvpn-client -f ""

      This appears to work to create the deluge container:

      Source Code

      1. docker run -d --name=deluge --net=container:vpn -e PUID=1000 -e PGID=1000 -v /root/deluge/downloads:/downloads -v /root/deluge/config:/config linuxserver/deluge

      And this is where I'm probably getting hung up:

      Source Code

      1. docker run -it --name web -p 8112:8112 -e SSI=y --link vpn:deluge -d dperson/nginx -w "http://deluge:8112/;/deluge/"
      Most of the examples I've seen indicate that I should use -p 80:80, but I can't do that because OMV is already using port 80. So I just figured that I would use port 8112 instead, and hit the page with http://<OMV IP>:8112, but I get nothing at all.

      Any ideas? I've already spent around 12 hours trying to get this working.

      Thanks!
    • In this docker create command:

      docker run -d --name=deluge --net=container:vpn -e PUID=1000 -e PGID=1000 -v /root/deluge/downloads:/downloads -v /root/deluge/config:/config linuxserver/deluge

      What user:group are 1000:1000?

      Why are you trying to write the downloads and config into the root user's home folder? Only the root user can do that.
      OMV 4.x - ASRock Rack C2550D4I - 16GB ECC - Silverstone DS380
    • Slightly modified commands:


      Source Code

      1. docker run -d -it --name vpn --cap-add=NET_ADMIN --device /dev/net/tun -v /etc/openvpn/client:/vpn dperson/openvpn-client -f ""
      2. docker run -d --name=deluge --net=container:vpn -v /sharedfolders/download/deluge/complete:/downloads -v /sharedfolders/download/deluge/config:/config linuxserver/deluge
      3. docker run -d -it --name web -p 8112:8112 -e SSI=y --link vpn:deluge dperson/nginx -w "http://deluge:8112/;/deluge/"
      The vpn container gets a valid IP from my vpn provider. From within the web container, I can ping "deluge" (returning the IP of the deluge container), and I can curl http://deluge:8112 (returning HTML from the deluge GUI page). But I just can't access the deluge GUI from my PC on my LAN at all.
    • Interestingly enough, the maintainer of the container posted a link to a sample docker compose file that may be helpful in getting your containers set up.

      As an aside, the command that finally worked for me was the following (note I'm on ARM so I needed the armhf build):

      sudo docker run -it --restart=always --dns XXX.XXX.XXX.XXX --cap-add=NET_ADMIN --device /dev/net/tun --name vpn -v /srv/dev-disk-by-label-storage/home/docker/.config/vpn:/vpn -e PGID=100 -e PUID=1001 -d dperson/openvpn-client:armhf -f ""

      edit: just replace the dns X's with your own dns, or remove it entirely if you don't want to specify the dns server
      OMV 4.1.4-1 Arrakis | Odroid XU4Q | armhf-gang | docker noob