Docker Vpn Passthrough

  • All Docker installations represent the docker0 network with bridge; Docker connects to bridge by default. Run ifconfig on the Linux host to view the bridge network. When you run the following command in your console, Docker returns a JSON object describing the bridge network (including information regarding which containers run on the network, the options set, and listing the subnet.
  • Using VPN container as a jumphost provides enhanced availability to a protected application/server. Background Knowledge. Jumphost is a server which we use as an intermediate/gateway server for.
  • Setup notes

VPN Passthrough 🔗 Docker Desktop for Mac’s networking can work when attached to a VPN. To do this, Docker Desktop for Mac intercepts traffic from the containers and injects it into Mac as if it originated from the Docker application.

Helpful Commands

Check if a parity operation is in-progress

Check the status of a parity operation. Wait for % complete is mdResyncPos/mdResyncSize.

  • https://www.youtube.com/channel/UCZDfnUn74N0WeAPvMqTOrtA/videos - Very good tutorials on just about every unraid topic.

Setup Community Applications

This will allow you to search and install applications (plugins and docker containers).

  • Click the Plugins tab
  • Click the Install a plugin tab
  • Add this URL: https://raw.githubusercontent.com/Squidly271/community.applications/master/plugins/community.applications.plg
  • Click install

VPN Setup

VPN Certificates

Create a share named vpn. Make it private so only you can read it.Next, download your VPN certs from your VPN provider's website and do the following:

  • Copy the following into that share: ca.crt, .crt, .key, ta.key, and one of the ovpn file you want to use
  • Rename the ovpn file to vpn.conf
  • Edit the vpn.conf file and put the full path where it references the certs. /vpn/ca.crt, etc...

VPN Container

  • Click the docker tab
  • Click Add container
  • Name: vpn
  • Repository: dperson/openvpn-client
  • Privileged: On
  • Path: /mnt/user/vpn/ -> Container Path: /vpn
  • Extra Parameters: --cap-add=NET_ADMIN --dns=8.8.8.8 --sysctl net.ipv6.conf.all.disable_ipv6=0
  • Container Device: /dev/net/tun
  • Variable:
    • Name: FIREWALL
    • Value: true
  • Click Apply

Go to the docker tab. Look at the last column on the right for the VPN container, look at the logs, make sure things are OK. Should say 'Initialization Sequence Completed'. May take 5 minutes or more to complete.

Deluge

First setup Deluge.

  • Go to 'Apps' tab and search for 'Deluge' and add it. I use captinsano/deluge
  • Name: Deluge
  • Extra Parameters: --net='container:vpn'
  • Network Type: None
  • Privileged: Off
  • Add your paths for the media

NOTE:Prior to Unraid 6.8 you'd add --net='container:vpn' as an 'extra parameter'. With Unraid 6.8, that broke. For 6.8, as of now until there's a better solution, open the console and type the following

Now (You'll probably need to reload the UI to get this to show up) in the Network Type drop down, select the network you just created, which is container:vpn

The above configures Deluge but you won't be able to reach the web UI since the network type is set to 'none'. To reach it, we'll create a proxy with nginx, see the next section

nginx

Go to 'Apps' tab and search for 'nginx' and add it. I use linuxserver/nginx. Enter these settings:

  • Name: nginx
  • Repository: dperson/nginx
  • Extra Parameters: --link vpn:deluge -p 8112:8112
  • Network Type: Bridge
  • Host Port 1: 8080
  • Host Port 2: 8443
  • AppData Config Path: /mnt/user/appdata/nginx

In the /mnt/user/appdata/nginx, edit the nginx configuration file as needed. Here's mine, which includes a proxy_pass for deluge.

Now you can reach the Deluge web UI by going to http://:8112/

Home Assistant

This will get Home Assistant running with a Z-Wave USB stick.

  • Go to apps, install home-assistant
  • Network type: Host
  • Extra Parameters: select device
    • Name: ttyACM0
    • Value: /dev/ttyACM0
  • Privileged: On
  • Start the container.

Now edit the file /mnt/user/appdata/home-assistant/configuration.yaml and add the following two lines and then restart Home Assistant.

Jackett

  • Got to apps and search for linuxserver/jackett
  • Name: Jackett
  • Network Type: Bridge
  • Privileged: off
  • Host Port 1: 9117
  • Host Path 2: /mnt/user/media/downloads/

Plex Media Server

Docker Desktop Vpn Passthrough

  • Go to apps and search for PlexMediaServer. I used the one from limetech/plex
  • Name PlexMediaServer
  • Network Type: Host
  • Privileged: on
  • Add a container path variable: /mnt/user/media/

Tip: You might want to hook up PlexTraktSync to sync your watched state to Trakt.

Tautulli

  • Go to apps and search for tautulli. I use the one from linuxserver/tautulli
  • Name: Tautulli
  • Network Type: Bridge
  • Host Port 1: 8181
  • Host Path 1: /logs

Sonarr

  • Go to apps and search for sonarr. I use the one from linuxserver/sonarr
  • Name: Sonarr
  • Network Type: Bridge
  • Privileged: Off
  • Host Port 1: 8989

Radarr

  • Go to apps and search for radarr. I use the one from linuxserver/radarr
  • Name: Radarr
  • Network Type: Bridge
  • Privileged: Off
  • Host Port 1: 7878

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover, and with no Back-Cover Texts. A copy of the license is included in the section entitled GNU Free Documentation License.

Table of Contents

Virtual Private Networking (VPN)

It is often the case that a system behind the firewall needs to be able to access a remote network through Virtual Private Networking (VPN). The two most common means for doing this are IPsec and PPTP. The basic setup is shown in the following diagram:

A system with an RFC 1918 address needs to access a remote network through a remote gateway. For this example, we will assume that the local system has IP address 192.168.1.12 and that the remote gateway has IP address 192.0.2.224.

If PPTP is being used and you need to have two or more local systems connected to the same remote server at the same time, then you should be sure that the PPTP helpers modules are loaded (ip_conntrack_pptp and ip_nat_pptp or nf_conntrack_pptp and nf_nat_pptp). Using the default modules file, Shorewall (Lite) will attempt to load these modules when Shorewall (Lite) is started.

If IPsec is being used, you should configure IPsec to use NAT Traversal -- Under NAT traversal the IPsec packets (protocol 50 or 51) are encapsulated in UDP packets (normally with destination port 4500). Additionally, keep-alive messages are sent frequently so that NATing gateways between the end-points will retain their connection-tracking entries. This is the way that I connect to the HP Intranet and it works flawlessly without anything in Shorewall other than my ACCEPT loc->net policy. NAT traversal is available as a patch for Windows 2K and is a standard feature of Windows XP -- simply select 'L2TP IPsec VPN' from the 'Type of VPN' pulldown.

Alternatively, if you have an IPsec gateway behind your firewall then you can try the following: only one system may connect to the remote gateway and there are firewall configuration requirements as follows:

Table 1. /etc/shorewall/rules

ACTIONSOURCEDESTPROTODPORTSPORTORIGDEST
DNATnet:192.0.2.224loc:192.168.1.1250
DNATnet:192.0.2.224loc:192.168.1.12udp500

The above may or may not work — your mileage may vary. NAT Traversal is definitely a better solution. To use NAT traversal:

Table 2. /etc/shorewall/rules with NAT Traversal

ACTIONSOURCEDESTPROTODPORTSPORTORIGDEST
DNATnet:192.0.2.224loc:192.168.1.12udp4500
DNATnet:192.0.2.224loc:192.168.1.12udp500

Docker Desktop Windows Vpn Passthrough

Docker

Docker For Mac Vpn Passthrough


Docker Windows Vpn Passthrough

If you want to be able to give access to all of your local systems to the remote network, you should consider running a VPN client on your firewall. As starting points, see The /etc/shorewall/tunnels manpage.

Comments are closed.