Managing Docker Networks: Channeling Traffic to qBittorrent through VPN reddit / selfhosted ---------------------------------------------------------------------- NoNefariousness2888 · 2023-10-09 10:43 Hello everyone, I'm using PrivateVPN, and after a chat with the provider, I found out that their dedicated IPv4 with full port mapping can be used when using one of these servers: \[PrivateVPN Dedicated Servers\]([https://ovpnstorage.privatevpn.com/Dedicated-TUN- UDP-128-GCM/](https://ovpnstorage.privatevpn.com/Dedicated-TUN- UDP-128-GCM/)) I have tested this on my Windows machine, and it works well—forwarding all ports seamlessly. However, I have the following Docker setup: \- A container that establishes a connection to PrivateVPN via OpenVPN (\`qmcgaw/gluetun\`). \- A container running qBittorrent, listening on port 57234 (\`lscr.io/linuxserver/qbittorrent\`). \- The qBittorrent container shares the network with the VPN container, and this setup is working smoothly. \- I have also specified port 57234 in the VPN container. I would like to keep it this way to route other containers through the VPN. PrivateVPN assigns an IPv4 address to the VPN container and maps all ports back to the VPN container, which works great. When I look up the IP and access it from a different network, I reach the VPN container. Here's where my challenges begin: How can I, using Docker and my setup, redirect external requests on port 57234 to the qBittorrent container? I know IP Tables but Preferably, I'm looking for a nice web interface—a sort of internal network port mapper and something that works with Docker compose Files. Appreciate any guidance or suggestions! ---------------------------------------------------------------------- Tsusai · 2023-10-09 16:09 I believe there are at least 2 qBitTorrent/vpn docker projects where they are fully intertwined with each other for that protection. Binhex I think? ---------------------------------------------------------------------- NoNefariousness2888 · 2023-10-09 16:58 I know, but i want to do it in a separate Container, use the VPN Connection for other Containers too. ---------------------------------------------------------------------- Tsusai · 2023-10-09 17:12 Wouldnt attaching other containers to the same network (creating a new bridge network for the q/vpn container) solve that? Or did I misread that project file...been so long ---------------------------------------------------------------------- newbutler · 2023-10-10 00:46 you can use the network stack of your vpn container for qbittorrent: https://docs.docker.com/compose/compose-file/compose- file-v3/#network_mode with this approach you dont have to setup any forwarding. ---------------------------------------------------------------------- NoNefariousness2888 · 2023-10-10 04:59 How do i use this to forward a incoming request in one Container to a specific other Container? ---------------------------------------------------------------------- PovilasID · 2023-10-10 09:28 I use \`network\_mode: "service:VPN\_Container"\` then on the VPN container you can expose a port or add reverse proxy to expose web UI. VPN container if it has a valid VPN connection will handle all the outgoing connection over the VPN except the ones you expose to the host. This actually handled by IP mapping inside of the container but the defaults should work ---------------------------------------------------------------------- NoNefariousness2888 · 2023-10-10 11:15 That is my current setup, and the out going traffic works great. My problem is the ingoing traffic, how do i initiate a connection from outside to the vpn that gets routet to the torrent Container.