Often when I'm fetching an .ISO I use the Transmission BitTorrent client to a) save on bandwidth and b) share the file with others. I've experienced some issues with Transmission lately and out of curiosity checked the port I had assigned to it. In this case, the port is 51412. When I test this in Transmission-gtk, the response is "Closed." However, I have configured this in ufw.
Since I wasn't receiving any data, I quite Transmission, cleared out the torrents in ~/.config/transmission/torrents, made sure to killall transmission and restarted the program. The torrents started flowing again, but Transmission still reports the port is closed. Go figure.
I just confirmed that my gateway is properly configured. Port 51412 forwards TCP to the same port on my server. I don't think Transmission has ever used (or required) UDP.
And since it's working, I suspect the issue is with the way Transmission tests the port.
Well, I'm still running an older 22.04.5 LTS, so that might explain it. Nevertheless, the point remains that Transmission doesn't know (or recognize) what port it's using. That one can specify a port is nice for security and management, but Transmission also allows for randomizing its port, so I guess the developers haven't given it too much thought.
Transmission is working fine for me after I cleaned up the leftover crud (I think there were multiple instances running). So, I'm not being blocked, but it's curious that Transmission reports the port it's listening on is closed.
I'm not sure there's an issue more than Transmission is (incorrectly) reporting the port it's set to listen on is closed. It's working for me regardless.
I'm running transmission on 22.04.5 LTS as well.
Strangely enough I don't happen to encounter this problem. Transmission nicely reports that the port I set is open.
BitTorrent is pretty nice in that you don't need an open port to send/receive files with other peers, as long as one of the peers in the swarm has an open port to initiate a connection. A closed port just means they can't directly connect to you, so progress might be less performant.
If you have μTP enabled, that uses UDP and would need forwarding too.
Randomization might work better with UPnP enabled, since UPnP allows the program to ask the router "Hey! I'd like to open a port across our NAT to the WAN (internet) please!" aka. incoming connections to that port number (51412) via public IP address will be forwarded to that computer.
It's also possible that a router (with UPnP on) is still forwarding an earlier request, possibly if the program didn't tell the router that it's done and can close that port. In which case, restarting the router should do the trick.
I tested in a VM. It's working as expected in 24.04.
My VM behind its own [NAT] → [Main Network] → Router → Internet = Closed
[] → [] → Nope, stuck behind 2 NATs and didn't get forwarded.
My VM is bridged, part of the [Main Network] → Router → Internet = Open (with UPnP)
[] → :51413
To rule it out, try using an online tool to test that port number at your public IP address. Odds are it'll be closed. Could mean:
The local firewall is blocking that port when accessed from anywhere (0.0.0.0).
Wrong protocol (TCP/UDP) being forwarded.
The static port forward on the router isn't set up properly, or points to the wrong computer. (Could happen if the LAN IP address is dynamic, aka. DHCP)
UPnP is disabled and there isn't a static port forward.
Rarely, ISP monitors and blocks the port. Try another number.
Configuring Transmission to require encryption and not use μTP could be an option.
As you have mentioned above regarding NATted VM, there are ISP options which effectively prevent connection to the port in question from Internet. That is ISP could use NAT in overload mode or transparent proxy/gateway.