The objective of this container is to run a script that requests a port forward (via NAT-PMP) from the VPN provider and upon success changes the listening port of the qBittorrent client when running in Docker
This solution is currently in use and tested with Gluetun and qBittorrent from Linuxserver.io and with VPN fron ProtonVPN using Wireguard.
The need to improve the seeding/upload performance and not finding any work done for this scenario (qBittorrent using docker'ized VPN), but finding this post on reddit by u/TennesseeTater for Deluge made me try and do something similar. His post is also referenced in the ProtonVPN Guide.
Well, as far as I could find, Alpine Linux doesn't have natively the binary for natpmpc, the NAT-PMP client used to request the port forward as per the instructions for manual mapping on ProtonVPN. Gluetun is using alpine as it's base image.
On AlpineLinux package info: natpmpc binary not found and here a request still in open state.
If I had the binary needed on the Gluetun container a script running on the host system instead of the container would probably suffice, allowing the following action: doing "docker exec
So far:
VPN_GATEWAY
for udp and tcpThese actions are performed continuously (in a loop, every 5 minutes (default, can be lowered/increased)), most likely an option to set a failure count will be added in the future.
VPN_IF_NAME
(default: tun0) a few users have reported needing to set FIREWALL_OUTBOUND_SUBNETS
for the Gluetun/VPN containerVPN_CT_NAME
as network_mode this would be set to 10.2.0.2VPN_IF_NAME
(default: tun0) gateway address, not the VPN_ENDPOINT_IP
from the Gluetun/VPN Container when using Wireguard, more info here.CHECK_INTERVAL
and NAT_LEASE_LIFETIME
should be set equal or the check interval lower than the lease lifetime, but never above.