# rtorrent problem

## FGor

I cant get rtorrent to connect to trackers.

i get "Tracker: [Timeout was reached]" or "Tracker: [cant connect to udp tracker]".

here is my iptables script:

```

#!/bin/sh

# ArchWiki - Simple stateful firewall HOWTO

# URL: http://wiki.archlinux.org/index.php/Simple_stateful_firewall_HOWTO

clear

echo "Setting Up Iptables For Routing!"

echo "--------------------------------"

sleep 1

echo "Reseting Rules..."

iptables -P INPUT ACCEPT

iptables -P FORWARD ACCEPT

iptables -P OUTPUT ACCEPT

iptables -F

iptables -X

sleep 1

echo "Creating Custom Chains..."

iptables -N open

iptables -N interfaces

sleep 1

echo "Accepting All ICMP Messages..."

iptables -A INPUT -p icmp -j ACCEPT

sleep 1

echo "Allowing Connections From Lan To Internet..."

iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT

sleep 1

echo "Adding Rules For Interfaces And Open..."

iptables -A INPUT -j interfaces

iptables -A INPUT -j open

iptables -A INPUT -p tcp -j REJECT --reject-with tcp-reset

iptables -A INPUT -p udp -j REJECT --reject-with icmp-port-unreachable

sleep 1

echo "Dropping Protocols Other Than TCP, UDP and ICMP..."

iptables -P INPUT DROP

sleep 1

echo "Allowing All Outgoing Traffic..."

iptables -P OUTPUT ACCEPT

sleep 1

echo "Setting Up Interfaces Chain..."

iptables -A interfaces -i lo -j ACCEPT

iptables -A interfaces -i lan -j ACCEPT

sleep 1

# --------------[PORT FORWARDING 01]--------------

echo "Setting Up Open Chain..."

# Apache

iptables -A open -i wan -p tcp --dport 80 -j ACCEPT

# SSHD

iptables -A open -i wan -p tcp --dport 22 -j ACCEPT

# RtGUI - dht

iptables -A open -i wan -p udp --dport 6880 -j ACCEPT

sleep 1

echo "Setting Up Protection..."

iptables -A INPUT -p tcp ! --syn -m state --state NEW -j DROP

iptables -A INPUT -f -j DROP

iptables -A INPUT -p tcp --tcp-flags ALL ALL -j DROP

iptables -A INPUT -p tcp --tcp-flags ALL NONE -j DROP

iptables -I INPUT -i wan -s 10.0.0.0/8 -j DROP

iptables -I INPUT -i wan -s 172.16.0.0/12 -j DROP

iptables -I INPUT -i wan -s 192.168.0.0/16 -j DROP

iptables -I INPUT -i wan -s 127.0.0.0/8 -j DROP

sleep 1

echo "Dropping Pings..."

iptables -A INPUT -p icmp --icmp-type echo-request -i eth0 -j DROP

sleep 1

echo "Setting Up Forward Chain..."

iptables -F FORWARD

iptables -N fw-interfaces

iptables -N fw-open

iptables -A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT

iptables -A FORWARD -j fw-interfaces

iptables -A FORWARD -j fw-open

iptables -A FORWARD -j REJECT --reject-with icmp-host-unreachable

iptables -P FORWARD DROP

sleep 1

echo "Adding Rules For FW-Interfaces And FW-Open..."

iptables -A fw-interfaces -i lan -j ACCEPT

iptables -t nat -A POSTROUTING -s 192.168.0.0/255.255.255.0 -o wan -j MASQUERADE

# --------------[PORT FORWARDING 02]--------------

# FGor - Torrent

iptables -A fw-open -d 192.168.0.1 -p tcp --dport 40463 -j ACCEPT

iptables -t nat -A PREROUTING -i wan -p tcp --dport 40463 -j DNAT --to 192.168.0.1

iptables -A fw-open -d 192.168.0.2 -p tcp --dport 44001 -j ACCEPT

iptables -t nat -A PREROUTING -i wan -p tcp --dport 44001 -j DNAT --to 192.168.0.2

# Server - Torrent

iptables -A fw-open -d 192.168.0.100 -p tcp --dport 49100:49300 -j ACCEPT

iptables -t nat -A PREROUTING -i wan -p tcp --dport 49100:49300 -j DNAT --to 192.168.0.100

sleep 1

echo "Setting Up Squid Prerouting..."

iptables -t nat -A PREROUTING -i lan -p tcp --dport 80 -j REDIRECT --to-port 2000

sleep 1

echo "Enabeling Routing In The Kernel..."

echo 1 > /proc/sys/net/ipv4/ip_forward

sleep 1

echo "Saving settings and restarting iptables..."

sleep 1

/etc/rc.d/iptables save

/etc/rc.d/iptables restart

exit 0;

```

and here is my rtorrent.rc:

```

# Maximum and minimum number of peers to connect to per torrent.

min_peers = 1

max_peers = 2000

# Same as above but for seeding completed torrents (-1 = same as downloading)

# min_peers_seed = 10

max_peers_seed = 50

# Maximum number of simultanious uploads per torrent.

max_uploads = 10

# Global upload and download rate in KiB. "0" for unlimited.

download_rate = 0

upload_rate = 60

# Default directory to save the downloaded torrents.

directory = /data/rtorrent/download

# Default session directory.

session = /data/rtorrent/session

# Watch a directory for new torrents, and stop those that have been deleted.

schedule = watch_directory,5,5,load_start=/data/rtorrent/torrentz/*.torrent

schedule = untied_directory,5,5,stop_untied=

schedule = tied_directory,5,5,start_tied=

# Move the downloaded content into the ~/Completed folder upon completion.

system.method.set_key = event.download.finished,move_complete,"execute=mv,$d.get_base_path=,/data/rtorrent/done/"

# Stop torrents when reaching upload ratio in percent,

# when also reaching total upload in bytes, or when

# reaching final upload ratio in percent.

# schedule = ratio,60,60,"stop_on_ratio=150,100M,200"

# Close torrents when diskspace is low.

schedule = low_diskspace,5,60,close_low_diskspace=1024M

# Start opening ports at a random position within the port range.

port_random = yes

# Port range to use for listening.

port_range = 49100-49300

dht_port = 6880

# Check hash for finished torrents. Might be usefull until the bug is

# fixed that causes lack of diskspace not to be properly reported.

check_hash = yes

# Open scgi port for rtGui

scgi_port = localhost:5000

# Enable the default ratio group.

ratio.enable=

# Change the limits, the defaults should be sufficient.

ratio.min.set=100

# Change the limits, the defaults should be sufficient.

ratio.min.set=100

ratio.max.set=300

ratio.upload.set=20M

# Changing the command triggered when the ratio is reached.

system.method.set = group.seeding.ratio.command, d.close=, d.erase=

```

eny toughts?

----------

