This HOWTO explains howto configure a BitTorrent tracker and seeder on 
a private LAN behind a iptables masquerading firewall.

Prerequisites : Make sure your have the python based BitTorrent package 
installed. See the official BitTorrent web site at or get your favorate rpm for your distro : 
search for bittorrent at or

next make sure your iptables masquerading firewall has the following 
tcp port redirected to the machine you will run the BitTorrent programs 

TCP_ALLOW : 6881 6882 6883 6884 6885 6886 6887 6888 6889 6969
TCP_FW : 6881:6881>$BTTR_IP \
	 6882:6882>$BTTR_IP \
	 6883:6883>$BTTR_IP \
	 6884:6884>$BTTR_IP \
	 6885:6885>$BTTR_IP \
	 6886:6886>$BTTR_IP \
	 6887:6887>$BTTR_IP \
	 6888:6888>$BTTR_IP \
	 6889:6889>$BTTR_IP \

Next if you have a ADSL connection tweak you internal DNS so that a 
DNS-lookup of e.g. points to (your 
bittorrent machine) . At the same time make sure that a DNS lookup of 
the same name somewhere on the Internet points to 
the ip-number of your ADSL connection. For more into howto do this see In this example the following lines 
should be added :

inside :

bttr	IN 	A

inside :	IN	A

For more details on the steps below see also the README.txt from the
official BitTorrent source package.

1. fire up your tracker :

# nohup --port 6969 --dfile dstate > tracker.log 2>&1 &

2. create your torrent file :

# linux-distro.iso

3. fireup your 1st downloader (start a downloader as a resume on the complete
   file) :

# --ip linux-distro.iso.torrent

The trick is inside the --ip option. Because you point to a DNS name 
instead of a ip-number, it works like expected : On your local private 
LAN points to which your tracker 
understands.  If however someone on the Internet starts a bittorrent 
download with your linux-distro.iso.torrent it not only find (, it also will immediately will find 
your 1st seeder without problems as your tracker announces it as and not as ip-number. Using the DNS trick will translate to and not 
outside on the Internet.

Robert M. Stockmann
Sun Jan 30 01:54:59 CET 2005