Ubuntu – Transmission says port is closed but seeding is happening


I'm using Transmission right now.

The Transmission's test of the port says: port is closed. But there is seeding activity (around 160KB/s).

I re-checked the port with an online site. It says closed too. How is that possible??

I forgot to add that I use Ubuntu 12.04 and I enabled Upnp both in Transmission and in the router's interface.

Could seeding happen even if the port is closed?

Best Answer

The short answer to the question: YES, you can seed with closed port too.

  • If the port is closed that only means you can't accept incoming connections, but you can still connect to peers who accept connections. In torrent terminology they say that you are in passive mode.

  • If your port would be open then you would be able to accept connections too. In torrent terminology this is called active mode.

So it works like this: A client in passive mode can connect to a client which is in active mode, but not to a client which is in passive mode. A client in active mode can connect to both active and passive clients.

So if your port is closed that only means you can't connect to other peers with closed ports. That means that you may get less peers and because of that worse speed. But if the torrent is frequent and there are lot of peers your client will likely be able to find enough active peers to max out your connection. If the torrent has few peers then it is likely that with active mode you would get much better speed. (If that rare case happens that all the peers are in passive mode, then you won't be able to download/upload anything. Actually non of the peers would be able to do anything as everyone is passive, you will have to wait until an active peer comes in.)

To open that port: First find out the number of the port in Transmission under Edit->Preferences->Network->Port used for incoming connections. That port can be blocked either by your router or by your firewall.

  • If you use Ubuntu with the default settings and didn't activate a firewall then the linux firewall won't block any port. If you activated some kind of firewall then you have to change those settings to allow incoming connections on that port. If you use a firewall but you don't know how to allow that port, use the following command where PORT_NUMBER is the port used for incoming connections in Transmission:

    sudo iptables -I INPUT -p tcp --dport PORT_NUMBER -j ACCEPT

    this is only a temporary solution, after reboot this firewall setting is lost. If you want to make it permanent you can put this command in a startup script. (But it is better if you allow the port in your firewall frontend (ufw, gufw, firestarter, e.g.) for permanent solution.)

  • So the much more likely case is that your router is "blocking" that port:

    The easier way to solve this is to just enable UPnP in the router's settings and also in Transmission under Edit->Preferences->Network tab-> and check in Use UPNP or NAT-PMP port-forwarding from my router.

    If that doesn't solve it then you will have to forward that port in the router's settings. Here is a great site showing you how to do that for almost all types of router. Just select your router type there and follow the instructions. (On that site you will also have to select a program for which you want to forward, but it is unimportant which one you choose, because the solution will only differ in the port number, but you already know from transmission the port number which you want to forward.)

Note: You should only check Pick a random port every time Transmission is started in Transmission if you use UPNP, or the port number will always change and the firewall/forwarding have to be set up after every start of transmission. (UPNP can deal with changing port numbers.)