iptables and Torrent

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I wish to download Torrent files to one of my computers which is
behind a Linux firewall.  uTorrent is configured to use port 31234 for
incoming connections but the uTorrent Port Checker states:
Error! Port 31234 does not appear to be open.

iptables -L -v shows the counters increasing for TCP and UDP packets
to this dport but my download speed is VERY slow so I presume that the
uTorrent Port Checker is correct and detected a problem that I am not

Can someone point out the error in my iptables config?  Here are the
relevant lines:

iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
iptables -t nat -A PREROUTING -p tcp -d $global --dport 31234 -j DNAT
--to $bob1
iptables -t nat -A PREROUTING -p udp -d $global --dport 31234 -j DNAT
--to $bob1

iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A FORWARD -d $bob1 -p tcp --dport 31234 -j ACCEPT
iptables -A FORWARD -d $bob1 -p udp --dport 31234 -j ACCEPT

Re: iptables and Torrent

Quoted text here. Click to load it
I have:

MSTATE="--match state --state"
TORRENT_HOST="<local ip>"
        # for torrent (1 of 2)
        if [ -n "$TORRENT_PORT" ]
                iptables -t nat -A PREROUTING -p tcp -i $X_WORLD \
                                --dport $TORRENT_PORT \
                                -j DNAT --to-destination $TORRENT_HOST
                iptables -t nat -A PREROUTING -p udp -i $X_WORLD \
                                --dport $TORRENT_PORT \
                                -j DNAT --to-destination $TORRENT_HOST
        # for torrent, tcp only (2 of 2, other part in NAT)
        if [ -n "$TORRENT_PORT" ]
                iptables -A FORWARD -p tcp $MSTATE NEW \
                                --dport $TORRENT_PORT -j ACCEPT
                iptables -A FORWARD -p udp --dport $TORRENT_PORT -j DROP

You might decide to accept UDPs.

http://bugsplatter.mine.nu /

Site Timeline