Mugwoof wrote: ↑Tue Feb 20, 2024 7:28 pm
Been using different versions over the years, on a windows 11 lap top. Have started to get "no direct connection", no settings on router of firewall have been changed, any one got any ideas? Plain answers please
Without actually looking at the code it's my understanding that this message means you're not able to accept
inbound connections. The name is simply a misnomer. You say UPnP is enabled on your router? If it is then check your UPnP table on the device and look for any mappings that are still valid while using qBittorrent. There should be entries listed there. Just ensure that those pinholes were actually created by qBittorrent and not some other unrelated app or device on your network. Make sure you enable both UPnP & NAT-PMP in the client first. A lot of SOHO routers these days combine UPnP, NAT-PMP & PCP port mapping protocols into a single feature in their web and/or mobile app user interface. Check that the UPnP service(s) are actually enabled on your machine. In Windows, for example, you'll want to enable ‘SSDP Discovery’ & ‘UPnP Device Host’ through services.msc if they're not already enabled and running. Set their Startup Type to ‘Automatic’. Lastly, you should either configure the host machine with a static IP or, if using DHCP, create a DHCP reservation for it in your router.
If you see valid port mappings in your router's UPnP table but you're still unable to accept inbound connections then you're likely behind multiple levels of NAT. Multiple levels of NAT, such as the dreaded ‘Double NAT,’ will break these port mapping protocols. Do you connect to a VPN when you torrent? All providers utilize NAT. Even if you don't use a VPN it's possible that your ISP has deployed Carrier Grade NAT (CGN) which will break the port mapping protocols (unless they've implemented PCP in their upstream router and you're utilizing their CPE equipment that is configured to interface with it). Do you tether your device to access the internet? This also uses NAT. Do you use your ISP's CPE equipment, like a residential gateway (modem + router), alongside your own router? This will create a Double NAT situation on your local network. There are a
few solutions to the latter which either require putting the gateway into bridge mode (pass-thru), DMZing your own router from the gateway, or hooking up your ethernet cables differently.
The other method of accomplishing NAT traversal, which qBittorrent natively supports, is called hole punching. To be specific it uses
UDP hole punching. This doesn't require you to explicitly forward a port either dynamically (programmatically) or statically (manually). Instead it creates an implicit port mapping which it then uses for all subsequent connections that are merged. Make sure you have μTP (Micro Transport Protocol) enabled in your settings. It's a custom designed transport protocol built on top of UDP. If only TCP is set then it won't function.
Go to
Options → Connection → Peer connection protocol: and set it to ‘
TCP and μTP’
Try and figure out how many NATs you're behind, where those NATs are located in the path (do you have control over any of them?), and what types they are. There are existing tools and protocols that can assist you with this. The main types of NAT implementations are: Full Cone, [Address] Restricted Cone, Port Restricted Cone & Symmetric. There is a less common fifth type that's a hybrid which combines the latter two depending on how full the network translator's state table is. It's even trickier to deal with than Symmetric NATs which break hole punching and the STUN endpoint discovery process (you may be able to perform port prediction as a workaround).
Alternately, your other options would be to either connect to the internet directly (assuming there's no CGN in place), put the host machine in your router's DMZ, or use IPv6 if your ISP has native support for it. With IPv6 there's no need for NAT. However, occasionally it's still used in certain cases. IPv6 restores end-to-end connectivity after NAT broke this principle in IPv4.