qbittorrent / qBittorrent

qBittorrent BitTorrent client
https://www.qbittorrent.org
Other
25.89k stars 3.82k forks source link

Automatic renew connection when connect with VPN #18930

Open thiendt2k1 opened 1 year ago

thiendt2k1 commented 1 year ago

Suggestion

Automatic check connect via port, when the VPN connection is connected

Use case

I use Surfshark or IPVanish from time to time, set the network interface to Surfshark/Ipvanish, so only when VPN is on, torrent works. But when i start the computer, they are delay from when VPN is connected and qbtorrent get connection, so it always on no connections, and i have to change the port MANUALLY for qbtorrent to make connection again. So, can this be made automatic ??

Extra info/examples/attachments

I'm on Windows 10, qbtorrent 4.5.1

glassez commented 1 year ago

Could you provide log messages related to qBittorrent startup (the ones from beginning and up to the point when you applied your workaround by changing the port)?

thiendt2k1 commented 1 year ago

Here it go image and some torrent being load, and after i connect image

glassez commented 1 year ago

Here it go image

So, there are no "Failed to listen on IP" messages?

thiendt2k1 commented 1 year ago

Here it go image

So, there are no "Failed to listen on IP" messages?

no that's all, before is when first start the app, after is when my vpn connection kicks in AND i change the port in Connection and click OK, otherwise it stay a red globe icon, stating no internet connection

softmoth commented 1 year ago

I have the same result (Windows 10 Home 22H2 19045.2965, qbittorrent_4.6.0alpha1_lt20_qt6_x64_setup.exe). I'm using CyberGhost VPN. I tried with 4.6.0 alpha libtorrent 2.0, as well as 4.5.x libtorrent 1.2. This is from 4.6.0:

At the top of the log, is the successful connection after manually setting the Network Interface back to "CyberGhost (IKEv2)".

6/2/2023 10:08 AM - qBittorrent v4.6.0alpha1 started
6/2/2023 10:11 AM - Detected external IP. IP: "102.129.152.194"
6/2/2023 10:10 AM - Successfully listening on IP. IP: "10.5.1.229". Port: "UTP/31388"
6/2/2023 10:10 AM - Successfully listening on IP. IP: "10.5.1.229". Port: "TCP/31388"
6/2/2023 10:10 AM - Trying to listen on the following list of IP addresses: "{38C40CD2-1494-4CEA-8832-BE129B20672F}:31388"
6/2/2023 10:10 AM - Options saved.

Prior to that is the (expected) unsuccessful listen when I manually chose the "Local Area Connection" Network Interface.

6/2/2023 10:10 AM - Failed to listen on IP. IP: "169.254.135.47". Port: "TCP/31388". Reason: "The requested address is not valid in its context"
6/2/2023 10:10 AM - Trying to listen on the following list of IP addresses: "{8D4CEE4C-99F4-4F7D-9EAD-31A479DF95E1}:31388"
6/2/2023 10:10 AM - Options saved.

And prior messages from starting up with Network Interface already set to "CyberGhost (IKEv2)". At the start, the VPN was off. And there was no attempt by qbittorrent to retry when the VPN was turned on. Likewise, if my VPN drops for a bit and then comes back up, I have to manually switch to a different interface and then back again (or else restart qbittorrent itself).

6/2/2023 10:09 AM - Torrent resumed. Torrent: "archlinux-2023.06.01-x86_64.iso"
6/2/2023 10:08 AM - IP geolocation database loaded. Type: DBIP-Country-Lite. Build time: Wed May 31 20:18:15 2023.
6/2/2023 10:08 AM - Restored torrent. Torrent: "archlinux-2023.06.01-x86_64.iso"
6/2/2023 10:08 AM - UPnP/NAT-PMP support: ON
6/2/2023 10:08 AM - Encryption support: ON
6/2/2023 10:08 AM - Anonymous mode: OFF
6/2/2023 10:08 AM - Peer Exchange (PeX) support: ON
6/2/2023 10:08 AM - Local Peer Discovery support: ON
6/2/2023 10:08 AM - Distributed Hash Table (DHT) support: ON
6/2/2023 10:08 AM - HTTP User-Agent: "qBittorrent/4.6.0alpha1"
6/2/2023 10:08 AM - Peer ID: "-qB4600-"
6/2/2023 10:08 AM - Trying to listen on the following list of IP addresses: "ppp_0:31388"
6/2/2023 10:08 AM - Could not find GUID of network interface. Interface: "ppp_0"
6/2/2023 10:08 AM - The configured network interface is invalid. Interface: "ppp_0"
6/2/2023 10:08 AM - Using config directory: C:\Users\siege\AppData\Roaming\qBittorrent
Jarpetnee commented 11 months ago

Were you guys able to resolve this?

nyakojiru commented 8 months ago

Bump. Strongly needed on vpn services with changing / temporal port forwarding