VPN Container that only runs OpenVPN/WireGuard. Used to passthrough other containers through it.
100K+
Docker container which runs Debian 10 with a WireGuard or OpenVPN with iptables killswitch to prevent IP leakage when the tunnel goes down. This Docker runs nothing but Debian 10 with a VPN connection, but it's intended use is to route other containers with no VPN or proxy capability through this one to protect you IP.
yes this container will restart when the connection is lost. Because of this, the Dockers you route through this one will also lose connection. Therefore you need to either restart them manually or use my restart-passed-through-containers script in combination with CA User Scripts. Information about how to install this script can be found here: Installing the auto-restart scriptScenario One: You wish to download online content via another container that has no 'vpn' variant or proxy capability.
Scenario Two: You wish to host a (game, Plex) server/service, but would want to protect your (home) IP.
This scenario will only protect your IP. For example when you wish to download content. For this scenario you would need two things:
Extra info; In this example, jDownloader2 uses port 8080, and without passing it through the passthroughvpn container, it would be accessible via http://192.168.0.100:8080/vnc.html?autoconnect=true
Honestly, the port numbers can get quite messy. I will do my best to describe the infrastructure.
The jDownloader2 container has a web interface on port 8080.
This port is exposed by the Docker container. This is NOT the port mapping.
Apps section of Unraid search for passthroughvpn, you will see an app matching this name from my repository (Dyon's Repository).Basic View to Advanced View.--net=container:passthroughvpn. It is possible that some containers already have something filled in here already, you can still add the --net=container after it, for example: --restart unless-stopped --net=container:passthroughvpn is valid and how it should be done.Network Type to None.Basic View to Advanced View.Add another Path, Port, Variable, Label or Device completely at the bottom and follow the example below:PortjDownloader2 Web interface80808012ADDITIONAL_PORTS environment variable, add as example the following:8012,8080VPN_USERNAME and VPN_PASSWORD)VPN_TYPE to either openvpn or wireguard, depending on which you choose.For this scenario you would need three things.
In the example below, I will refer to a game server container, but this could as well be a Plex or plain webserver container.
Honestly, the port numbers can get quite messy. I will do my best to describe the infrastructure.
In this example, there is a game server container with port 25569 for the game service 8443 for the web interface.
These ports are exposed by the Docker container. This are NOT port mappings.
If you wish to expose additional ports, you must add the --expose PORT (docs.docker.com) to the extra parameters (or the docker run command).
Extra info; Unraid server uses the IP 192.168.0.100.
In these instructions, I do assume you have common sense, experience with Unraid and already know how to use the Apps section of Unraid, nevertheless I will still briefly explain this.
Apps section of Unraid search for passthroughvpn, you will see an app matching this name from my repository (Dyon's Repository).Basic View to Advanced View.--net=container:passthroughvpn. It is possible that some containers already have something filled in here already, you can still add the --net=container after it, for example: --restart unless-stopped --net=container:passthroughvpn is valid and how it should be done.Network Type to None.Basic View to Advanced View.Add another Path, Port, Variable, Label or Device completely at the bottom and follow the example below:PortGame Server Web interface84438012ADDITIONAL_PORTS environment variable, add as example the following:8012,8443,25569,25570Since I have no other reference material, in this example I will explain how I do it with a Windscribe Static IP.
VPN_TYPE to OpenVPN.VPN_USERNAME and VPN_PASSWORD)passthroughvpn directory and then the openvpn directory. Put your .ovpn config file in here.mkdir -p /boot/config/plugins/user.scripts/scripts/passthrough_restart
echo 'This script will check if the passthroughvpn container has restarted and restart the passed through containers' > /boot/config/plugins/user.scripts/scripts/passthrough_restart/description
wget -q https://raw.githubusercontent.com/DyonR/docker-passthroughvpn/master/restart-passed-through-containers.sh -O /boot/config/plugins/user.scripts/scripts/passthrough_restart/script
| Variable | Required | Function | Example | Default |
|---|---|---|---|---|
VPN_ENABLED | Yes | Enable VPN (yes/no)? | VPN_ENABLED=yes | yes |
VPN_TYPE | Yes | WireGuard or OpenVPN (wireguard/openvpn)? | VPN_TYPE=wireguard | openvpn |
VPN_USERNAME | No | If username and password provided, configures ovpn file automatically | VPN_USERNAME=ad8f64c02a2de | |
VPN_PASSWORD | No | If username and password provided, configures ovpn file automatically | VPN_PASSWORD=ac98df79ed7fb | |
LAN_NETWORK | Yes (atleast one) | Comma delimited local Network's with CIDR notation | LAN_NETWORK=192.168.0.0/24,10.10.0.0/24 | |
ADDITIONAL_PORTS | No | Adding a comma delimited list of ports will allow these ports via the iptables script. | ADDITIONAL_PORTS=1234,8112 | |
RESTART_CONTAINER | No | If set to yes, the container will exit 1, restarting itself. | RESTART_CONTAINER=yes | |
NAME_SERVERS | No | Comma delimited name servers | NAME_SERVERS=1.1.1.1,1.0.0.1 | 1.1.1.1,1.0.0.1 |
PUID | No | UID for the user that runs the container | PUID=99 | 99 |
PGID | No | GID for the user that runs the container | PGID=100 | 100 |
UMASK | No | UMASK=002 | 002 | |
HEALTH_CHECK_HOST | No | This is the host or IP that the healthcheck script will use to check an active connection | HEALTH_CHECK_HOST=one.one.one.one | one.one.one.one |
HEALTH_CHECK_INTERVAL | No | This is the time in seconds that the container waits to see if the internet connection still works (check if VPN died) | HEALTH_CHECK_INTERVAL=300 | 300 |
HEALTH_CHECK_SILENT | No | Set to 1 to supress the 'Network is up' message. Defaults to 1 if unset. | HEALTH_CHECK_SILENT=1 | 1 |
It is possible that OpenVPN will fail to start if there is no auth-user-pass line in your .ovpn file.
Open your .ovpn file with a text editor and check if the auth-user-pass line exists. If not, add this line to the first section of the config:
auth-user-pass credentials.conf
User ID (PUID) and Group ID (PGID) can be found by issuing the following command for the user you want to run the container as: id <username>
Example output will be:
uid=1000(dyon) gid=100(users) groups=100(users)
In the container environment varables, this means I will set PUID to 1000 and PGID to 100.
If you are having issues with this container please submit an issue on GitHub.
Please provide logs, Docker version and other information that can simplify reproducing the issue.
If possible, always use the most up to date version of Docker, you operating system, kernel and the container itself. Support is always a best-effort basis.
MarkusMcNugen/docker-qBittorrentvpn
DyonR/jackettvpn
This projects originates from MarkusMcNugen/docker-qBittorrentvpn, but forking was not possible since DyonR/jackettvpn uses the fork already.
Content type
Image
Digest
sha256:8b3806a58…
Size
46.6 MB
Last updated
about 4 years ago
docker pull dyonr/passthroughvpn