UDP 53
My account
and click Port forwardingSelect a city
dropdownSelect a device
dropdown to No device (only OpenVPN)
and click the Add port
green buttonACTIVE PORTS
- e.g. nl-ams-59103
(country-city-port)docker-compose
file---
version: "3"
services:
openvpn-client:
image: ghcr.io/wfg/openvpn-client # Image on Docker. Shoutout to ghcr.io
container_name: openvpn-client
cap_add:
- NET_ADMIN # Needs to be here
environment:
- KILL_SWITCH=on # Turns off internet access if the VPN connection drops
- FORWARDED_PORTS=nl-ams-59103 # Enter the full value you noted at step 9 above
- SUBNETS=192.168.0.0/24,192.168.1.0/24 # Allows for the service to be accessed through LAN
devices:
- /dev/net/tun
volumes:
- /Volumes/Luigi/docker/mullvadVPN/config/mullvad_config_linux_ch_zrh:/data/vpn
# File unzipped before from Mullvad, it's location. Make sure to keep the ":/data/vpn" part at the end
ports:
- 5665:5665 # Opening port for to access hypothetical Transmission container that would be routing through this VPN
- 1500:1500 # Opening port for other application routing through VPN
restart: unless-stopped
cd
into folder where the docker-compose.yml
for this container is storeddocker-compose up
docker ps
docker exec -it <container ID from above> /bin/sh
wget -qO- http://ipecho.net/plain | xargs echo
will return your container's public IPNow go browse the internet from 🇨🇭Switzerland or something
So you want to allow other containers to use this connection? Ok fine...
network_mode: container:openvpn-client
to the container's compose fileports:
to the VPN's compose filenetwork_mode: container:openvpn-client
to docker compose fileversion: "2.1"
services:
transmission:
image: linuxserver/transmission
container_name: transmission
environment:
- PUID=1000
- PGID=1000
- TZ=America/Denver
volumes:
- <Config location>:/config
- <Download location>:/downloads
- <Watch location>:/watch
network_mode: container:openvpn-client # The addition to add to all containers that you want to route through VPN container
restart: unless-stopped