5

I have just installed transmission-daemon on a Raspberry Pi running Raspbian (Jessie).

When adding a torrent to the web interface, downloading works at high speeds, but it doesn't upload anything at all. For the torrent file I'm using, there should be plenty of leechers to connect to. BitTorrent works fine on my Mac computers in the same network.

First I thought it might be my firewall (ufw) causing issues since I have it set to ufw default reject incoming. This is likely to be the next issue – but even after ufw disable I still have the same problem with no uploading.

Questions:

  • What could be hindering upload when ufw is turned off?
  • Next, how can I use Transmission with ufw turned on while blocking as many incoming ports as sanely possible?

3 Answers 3

5

This sounds like a port forwarding issue.

To solve this, you'll have to enter you router's web interface. It can be reached on your router's address, which can be obtained using the ip route show command:

default via 192.168.1.1 dev eth0

In that example, the router's IP address would be 192.168.1.1.

The procedure may vary depending on the manufacturer, so the best you can do is to search in Google how to do it for your specific model.

Anyways, there should be some setting called "Port forwarding" or "NAT". Use the following info for the rule you've to set up:

<your RPi local IP address>
External port: 51413
Internal port: 51413
Protocol: TCP

Therefore, the only port you should need to open in ufw is 51413.

3
  • 1
    Sorry if some steps sound too obvious, it's just for helping other people who might not know ;)
    – Hewbot
    Nov 29, 2015 at 12:50
  • Thanks for your reply! I should perhaps add that BitTorrent works perfectly fine on my Mac computers connected to the same network. So I would like to avoid making changes in the router if possible. At least it may suggest that a solution can be found within the Raspberry config itself.
    – P A N
    Nov 29, 2015 at 12:52
  • 1
    Then, the only thing I can suggest is to try some port checking tool like this one, and see if the port is open. If it is, we could take a look to the settings on your Pi, but if it isn't, there's nothing you can do "from the inside", and you'll have to change your router settings.
    – Hewbot
    Nov 29, 2015 at 13:03
1

This seems to have helped me. Transmission-daemon can now upload.

I should mention that I'm a newbie when it comes to *nix, so I'm not really sure if what I'm doing is entirely correct.

1) Allowed port 51413 (BitTorrent default) in iptables by adding this to /etc/rc.local (suggested by this post):

iptables -A INPUT -m state --state RELATED,ESTABLISHED -p udp --dport 51413 -j ACCEPT
iptables -A OUTPUT -p udp --sport 51413 -j ACCEPT

2) Allowed the same port in ufw (because I use it as my host-based firewall):

sudo ufw allow 51413/udp

The above instructions are for the UDP port, but the same can be done for TCP, by adding the same lines with udp replaced by tcp.

0

I solved this issue without adding router port forwarding by enabling UPnP and NAT-PMP in the Transmission config, which was off by default.

  1. Open /etc/transmission-daemon/settings.json as root, with the editor of your choice (for example sudo nano /etc/transmission-daemon/settings.json).
  2. Find the line that includes port-forwarding-enabled.
  3. Change false to true on that line and save the file.
  4. Restart transmission-daemon by running sudo invoke-rc.d transmission-daemon reload

Transmission config documentation: https://github.com/transmission/transmission/wiki/Editing-Configuration-Files#peer-port

I'm on Raspberry Pi OS Buster Lite.

I also had previously turned on the peer-port-random-on-start setting, but that didn't work by itself, so I'm fairly confident it's the port-forwarding-enabled setting that I described above.

1
  • this only works if UPnP port forwarding is available on your router Nov 16, 2021 at 7:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.