Unable to download torrent in Transmission after updating firewall

8,962

Your port 51413 appears closed because you didn't allow incoming connections, you only allowed outgoing connections. The guide you followed is wrong in this point.

Delete the rules related to port 51413. To do that run

sudo ufw status numbered

and then delete the four related rules with

sudo ufw delete #

Replace # with the numbers you got before, you will have to run this command four times to get rid of all of them.

Now add a new rule which allows incoming connections with

sudo ufw allow 51413

To apply the changes reload the firewall rules with

sudo ufw reload

or

sudo ufw disable
sudo ufw enable

Remind that this port (51413) needs to be forwarded in your router, if the port is not forwarded in the router, incoming connections will get denied in your router before they reach your computer and the port will still appear as closed.

The Bittorrent-network is a peer-to-peer network and lives from connectivity. If a client on the network does not allow incoming connections, this client can only connect to clients which allow incoming connections. If not even a single client on the network allows incoming connections, no client would be able to connect to other clients, the network become useless.

You would still be able to download torrents if you don't allow incoming connections, but you can't connect to other peers which also deny incoming connections. Thus, the number of peers you can connect to is limited and this reduces download speed or, in the worst case, you can't download at all.

I think it is a common problem with bittorrents, many people don't know to configure their firewall and router correctly.

How to forward a port in the router is a topic which is not in the scope of askubuntu. You will have to refer to the manual of your router. For some knowledge about this topic take a look at https://portforward.com/ .

To learn more about the usage of ufw take a look at:

Following the guide you used you have a firewall which is very restrictive, you set the defaults to deny all incoming and all outgoing connections. You will have to add rules to allow connections for each application which needs Internet-access and uses ports which are not defined in your rules yet. Remind that when you install a new application and you wonder why the application does not have access to the Internet.

Share:
8,962

Related videos on Youtube

1565986223
Author by

1565986223

/o-o/

Updated on September 18, 2022

Comments

  • 1565986223
    1565986223 almost 2 years

    I recently updated (enabled and updated) firewall setting using this guide on wiki.ubuntu.com. I followed Method 2 UFW. However, after completing the process am unable to download torrents in Transmission.

    The guide mentions Transmission port rules:

    And now our Transmission rules

    sudo ufw allow out 51413/tcp
    sudo ufw allow out 51413/udp
    sudo ufw allow out 6969/tcp
    

    Under Preference -> Network in Transmission

    The Port for incoming connections (which is) 51413 shows Port is closed when I click Test Port.

    Please help me resolve this issue. Am just an average user (also new to linux), so please kindly break it down so that I would be able to understand you.

    Ubuntu version 16.10

    result of sudo ufw status

    Status: active
    
    To                         Action      From
    --                         ------      ----
    25,53,80,110,443/tcp       ALLOW OUT   Anywhere                  
    53,67,68/udp               ALLOW OUT   Anywhere                  
    51413/tcp                  ALLOW OUT   Anywhere                  
    51413/udp                  ALLOW OUT   Anywhere                  
    6969/tcp                   ALLOW OUT   Anywhere                  
    123/udp                    ALLOW OUT   Anywhere                  
    25,53,80,110,443/tcp (v6)  ALLOW OUT   Anywhere (v6)             
    53,67,68/udp (v6)          ALLOW OUT   Anywhere (v6)             
    51413/tcp (v6)             ALLOW OUT   Anywhere (v6)             
    51413/udp (v6)             ALLOW OUT   Anywhere (v6)             
    6969/tcp (v6)              ALLOW OUT   Anywhere (v6)             
    123/udp (v6)               ALLOW OUT   Anywhere (v6)             
    
    • George Udosen
      George Udosen about 7 years
      Please post the result of sudo ufw status
  • 1565986223
    1565986223 about 7 years
    Thanks. It's working now. But just to be clear, do I add separate rules for tcp and udp like in the earlier mentioned guide or just that one ufw allow will do? At the moment I added just the ufw allow
  • 1565986223
    1565986223 about 7 years
    now it's now uploading after download finishes. Do I ask a separate question?
  • mook765
    mook765 about 7 years
    This simple command will add rules for UPD and TCP. That Transmission is not uploading is normally not a problem, I have that often. Mostly the reason is that there are just no interested peers, and that is nothing you can change with the settings in your machine. Observe that first to get experience.
  • 1565986223
    1565986223 about 7 years
    If i disable ufw I am able to upload and get quite a good number for peers on some of the torrents (popular movies actually).
  • mook765
    mook765 about 7 years
    @spaceout I see, Transmission attempts to use outgoing connections with random port numbers. Try to add another rule sudo ufw allow out transmission-gtk, this should allow outgoing connections on any port only for transmission. Don't forget to reload ufw after adding the rule and check if this helps. This are the obstacles of a restrictive firewall...
  • 1565986223
    1565986223 about 7 years
    When I first entered ufw allow out transmission-gtk I got the error: could not find a profile matching transmission-gtk. So I created ufw app profile as instructed in this link askubuntu.com/questions/409013/… title=a BitTorrent Client description=Transmission is an open source cross-platform BitTorrent client. ports=51413 -------- After which i was able to add sudo ufw allow out transmission Still it's not uploading.
  • mook765
    mook765 about 7 years
    @spaceout Try sudo ufw allow out app transmission, be aware of case sensitivity, you must use the app-name you specified in /etc/ufw/applications.d. If this does not work use the extended format described in man ufw which is ufw allow from 192.168.0.0/24 to any app <name>, you will have to check your local IP-adress for the correct value, in this example it is the IP-range from 192.168.0.0 to 192.168.0.255. You could also restrict to a single IP-adress. Upvoted your question because you are not lazy to research.
  • mook765
    mook765 about 7 years
    @spaceout It appears that it is not going to work, at least not with the restrictive defaults you set. With files in /etc/ufw/applications.d we can manage only incoming connections. The only way is to reset ufw to defaults sudo ufw reset and add the rule for incoming connections ` sudo ufw allow 51413`. Not everything is possible with ufw, For more complicated setups you will have to use iptables.
  • 1565986223
    1565986223 about 7 years
    Looks like it. If I first disable ufw and start seeding torrents, the established peer connections persist after enabling ufw and no new connection is established. However, if I enable ufw before I start seeding, then no seeding happens at all.
  • mook765
    mook765 about 7 years
  • lakshman
    lakshman about 4 years
    its give me error ERROR: Invalid syntax Usage: ufw COMMAND