Why does port forwarding keep changing ports?

I have port forwarding turned on, and am using it with qBittorrent, having followed the steps in the official documentation. While I having to enter a new code every session is inconvenient, it’s an easy enough operation that I don’t mind.

HOWEVER… For some strange reason, the open port keeps changing on me? Without any change to my VPN status or network configuration? I’ll connect to Proton VPN, open qBittorrent and enter the new port, and ~2``0mins later I’ll get a notification announcing I need to switch to the new open port… I’ve found nothing in the documentation to suggest that periodic randomization is a feature, and I’ve disabled Auto Reconnection under VPN Accelerator settings, so I’ve no idea why the open port would change on its own like this, without a network change or any apparent outside influence. This has occurred both after I’ve come back to my computer after stepping away, and while actively using it.

If this isn’t a bug, and is just the way port forwarding is going to work, then it’s virtually useless for bittorrent applications, as the only way to consistently make use of it would be to babysit your PC and continually punch in new port numbers into the client every 20mins or so, and that’s not at all how these applications tend to be used; you don’t run something like qBittorrent in short bursts, you get it configured safely and properly, and then leave it run in the background whenever you can. While thankfully my client still technically functions without bothering with port forwarding at all, I still want to use it *properly.*

Which VPN protocol are you using? If it’s OpenVPN, I wonder if this is related to how OpenVPN rotates keys every ~10-ish minutes and somehow this triggers a bug?

If you are currently using wireguard, can you try OpenVPN over TCP? Perhaps something is occasionally breaking your connection, causing a reconnect.

This is just speculation of course. It would be best if you could hit the “Report a bug” button in the app and report it directly to the teams too.

Coming from Mullvad, as they just dropped their port forwarding support, it kinda sucks that you need to change it every single session. In Mullvad it was static till you wanted it to change. Probably a security thing but would be nice if Qbittorent could somehow auto update the port as it changes.

Anyone figured an easy way for this?

So, embarrassingly enough, even though the port had changed several times during testing/writing this up yesterday, it’s not happened once since posting, so maybe turning off Auto-Reconnect *actually* did work, and I’d just encountered a temporary bug? Idk, ahah. If the issue presents itself again I’ll try these steps and report back

https://github.com/ravesheep/ProtonVPN-windows

if you install on top of existing protonVPN in windows it seems you lose your custom DNS setting (or at least I did) and the auto update setting had to be toggled manually in advanced settings first

https://codeberg.org/gingermelon/check-port-forward

There’s a reason Mullvad had to stop offering port forwarding :wink: Static portforwarding has much more abusive potential, compared to dynamic port forwarding. The abuse was the reason why Mullvad had to stop that (according to them).

I had the same experience, when the feature first came out I couldn’t go 15 minutes without the port changing on me. After that I made it like 72 hours since without it really happening. They might have just fixed a bug with it on their end.