Qbittorrent and network_mode: service:vpn

I have a working qbittorrent container, and a working wireguard container named “vpn”, but I cannot figure out how to get them to work together.

In theory, I should be able to use “network_mode: service:vpn” and have qbittorrent use the same network and the vpn container. However when I do this qbittorrent has no connectivity to anything (except maybe the VPN container). I believe they are successfully sharing a network as both containers report the same IP address.

What is the “right” way to have an LSIO container use my VPN container to hit the internet?

I saw this: How to add VPN to qbittirrent container but I am not confident I could create a mod to add wireguard (I have a hard enough time understanding Alpine linux). And honestly, I like the idea of having the VPN running in a separate container so I can have several containers using it.

Alternatively, I can configure the VPN in a seperate network namespace on the host (I tried this first), but I cannot figure out how to have a container use that namespace. https://www.wireguard.com/netns/ has a good explanation on how to create the VPN in its own namespace. It also mentions using an existing docker namespace by referencing the PID… but that would require that the container be up before I run the commands to add the VPN.

I guess I have come at this from every direction I can see, and so far I have had little success. Hopefully someone here can help?

1 Like