qbittorrent / qBittorrent

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

Unreliable UPnP port forwarding #14144

Open hfball opened 3 years ago

hfball commented 3 years ago

Please provide the following information

qBittorrent version and Operating System

qb 4.3.2, OS Windows 10 20H2 x64, latest patch level, Netgear Nighthawk R7000 router

10.0.19042

If on linux, libtorrent-rasterbar and Qt version

N/A

What is the problem

Sometimes, when using a random address, qb fails to use UPnP to forward the random port immediately. Eventually it logs this error:

1/3/2021 10:43 AM - UPnP/NAT-PMP: Port mapping failure, message: could not map port using UPnP: no router found

Or it does nothing at all on occasion.

The same error message also appears 2 minutes after a successful UPnP port forward. So even when it works, though the port is opened, you still get an error message.

What is the expected behavior

It's expected to be able to use the router's UPnP services. When it succeeds, it doesn't then spit out an error message two minutes later like it retried. It should reliably connect to the UPnP service.

Steps to reproduce

Check UPnP/ NAT-PMP in "Connection" tab. Close qb. Launch qBittorrent with any port enabled, even a static one. Sometimes it succeeds, sometimes it doesn't, sometimes it doesn't even appear to try immediately, but gives an error message after a while.

Extra info(if any)

Netgear R7000 router. May be a router problem. Firmware V1.0.11.106_10.2.100.

sqliuchang commented 3 years ago

I have the same problem. It works when it starts and about 2-3 minutes later, the log shows "could not map port using UPnP: no router found".

update: I set "Network interface" and "Optional IP address to bind to" fixed, it seems to work well now.