≡ Menu

bittorrent client

Consider this ... the stupidest example of law. From the blog post:

French record labels have received the green light to sue four US-based companies that develop P2P applications, including the BitTorrent client Vuze, Limewire and Morpheus. Shareaza is the fourth application, for which the labels are going after the open source development platform SourceForge.

By this logic they will sue hard disk manufacture companies (for providing data storage equipment) and ISPs (for transferring out P2P traffic). Putting aside the discussion on the responsibilities of application developers for their users activities, the decision to go after SourceForge for hosting a application that can potentially infringe, is stretching credibility beyond all bounds.

=> Record Labels to Sue Vuze, Limewire and SourceForge

Today Ubuntu Linux 8.10 final will be released to all mirrors world wild. However, FTP/HTTP mirrors server may down due to heavy demands from users. You can now use BitTorrent to upgrade Ubuntu Linux to 8.10 from old 8.04 version. Help Ubuntu project to spread Linux to humanity.

In the past, the update servers would crash very quickly on a big release day, making it hard for people to get the latest update. With BitTorrent, however, this can be easily avoided.

Most users of Linux based operating systems such as Ubuntu are familiar with BitTorrent. In fact, Ubuntu even comes with a BitTorrent client, and millions of Ubuntu users got their install disk via the popular filesharing protocol.

Use BitTorrent to Upgrade to Ubuntu Intrepid Ibex | TorrentFreak

You can now easily determine if your ISP throttling and shaping Bittorrent traffi with simple online tool.

From the project web page:

Certain ISPs have been shown to rate limit or block BitTorrent traffic sent by their customers. While there are multiple reports of this on the web, only a few ISPs have admitted that they manipulate BitTorrent traffic. And, to date, it is hard for users without networking expertise to gain evidence about the behavior of their ISP.

This test suite creates a BitTorrent-like transfer between your machine and our server, and determines whether or not your ISP is limiting such traffic. This is a first step towards making traffic manipulation by ISPs more transparent to their customers.

=> Glasnost: Test if your ISP is manipulating BitTorrent traffic

You can also load this tool on your own server or laptop computer running Apache and PHP 4.3 or above:
$ cd /var/www/
$ sudo apt-get install libpcap0.8 libpcap0.8-dev
$ wget http://broadband.mpi-sws.mpg.de/transparency/glasnost-1.1.tgz
$ tar -zxvf glasnost-1.1.tgz
$ cd glasnost
$ make
$ su -c "chmod a+s bt_client"
$ mkdir logs
$ chmod 0777 logs

Fire a web browser and type http://localhost/glasnost/selftest.php or http://your-domain.com/glasnost/selftest.php

Updated for accuracy!


A long time ago I wrote about Linux command line bittorrent client. Recently I switched from command line client to a GUI based client called Deluge.

Deluge is a lightweight, open source free software and cross-platform BitTorrent client (bt client). A Bittorrent client written in Python/PyGTK which offers following benefits:

[a] Full Encryption - To avoid ISP's bandwidth throttling system (note encryption is not here to protect you from other users)

[b] Plugin System - Just like Firefox it has features rich plugin collection; in fact, most of Deluge's functionality is available in the form of plugins.

[c] In built RSS support to grab latest and greatest stuff.

[d] Global and per bittorrent bandwidth control.

[e] Support for selective file downloading - For example, it allows to grab a single file from 100 of files

[f] Ability to create torrent with Torrent Creator plugin

[g] Proxy support

[h] Network activity graph

[i] Network Health Monitor

[j] And much more

Quick Deluge Installation

Use apt-get command,
$ sudo apt-get install deluge-torrent
You can start Deluge by visiting Application > Internet > Deluge Bittorrent Client
Linux / MAC / WIndows / UNIX - Deluge Bittorrent client written in Python/PyGTK
(Fig. 01: Deluge Bittorent Client in Action)

Change port settings

The official ports for BitTorrent are 6881-6889, but most ISPs block or at least throttle those ports, so I recommend to use a port range of something between 50000 and 65535 or any other random range. You can change port range from Preference > Select Network tab > Setup new range > Close
Change port settings
(Fig. 02: Change Port Settings [ Image Credit Official Project])

Download Deluge Bittorrent Client

=> Visit Official Deluge Bittorrent Client project web site to grab latest version.

I already wrote about Linux command line bittorrent client. However, I received few more queries regarding firewall issues. Basically you need to open ports using iptables.

Bittorrent client by default uses tcp 6881 to 6889 ports only. In order to work with Bittorrent client you need to open these ports on firewall. Remember, if you are behind a firewall (hardware or software) you need to enable port forwarding to internal systems.

Scenario # 1: Windows or Linux desktop behind router firewall

Internet ->     Hardware Router    -> Your Linux Desktop
          with port forwarding          Client

You have router (ADSL/DSL/Cable modem+router) and you have already enabled port forwarding on router (open web browser > Open router web admin interface > Find port forwarding > Enable port forwarding for bittorent protocol). You also need to open port using following iptables rules on Linux desktop (open TCP port 6881 to 6999):

iptables -A INPUT -p tcp --destination-port 6881:6999 -j ACCEPT
iptables -A OUTPUT -p tcp --source-port 6881:6999 -j ACCEPT

Here is a complete sample firewall script:

iptables -F
iptables -X
iptables -t nat -F
iptables -t nat -X
iptables -t mangle -F
iptables -t mangle -X
modprobe ip_conntrack
modprobe ip_conntrack_ftp
# Setting default filter policy
iptables -P INPUT DROP
# Unlimited access to loop back
iptables -A INPUT -i lo -j ACCEPT
iptables -A OUTPUT -o lo -j ACCEPT
# Allow UDP, DNS and Passive FTP
iptables -A INPUT -i eth0 -m state --state ESTABLISHED,RELATED -j ACCEPT
#allow bittorent incomming client request
iptables -A INPUT -p tcp --destination-port 6881:6999 -j ACCEPT
#Uncomment below to allow sshd incoming client request
#iptables -A INPUT -p tcp -dport 22 -j ACCEPT
# DROP everything and Log it
iptables -A INPUT -j LOG
iptables -A INPUT -j DROP

Scenario # 2

Internet -> Linux computer Router  ->  Your Linux Desktop
         with port forwarding      OR Windows XP client
         enabled using IPTABLES       IP:

Here you are using a Linux as software firewall and iptables as your NAT (firewall) for internal network ( You need to enable port forwarding to a internal Linux desktop (may be Windows XP desktop) for BitTorrent client system. Add following two line of code to your existing NAT firewall script.

iptables -t nat -A PREROUTING -p tcp --dport 6881:6889
-j DNAT --to-destination
iptables -A FORWARD -s -p tcp --dport 6881:6889

Related: Linux Command line BitTorrent client

Linux > Command line BitTorrent client

BitTorrent is the name of a peer-to-peer (P2P) file distribution protocol, and of a free software implementation of that protocol.

The BitTorrent client is a computer program developed by BitTorrent, Inc. used to download and upload files via the BitTorrent protocol. You can download python based command line BitTorrent client download for Linux/BSD/Mac OS X/UNIX link oses. This is quite useful, if you would like to download file remotely over SSH session. bittorrent.com offers bittorrent client in .deb (Debian Linux) or rpm (RedHat/Fedora Core/CentOS Linux) file formats.

To use the bittorrent in command line one you need to use command bittorrent-console or bittorrent-curses (see below for examples).

Step # 1: Find Python version

Make sure you download file according to your python version. Type following command to find out python version:
$ python -V

Python 2.4.2

Step # 2: Download bittorrent client

Use wget to download bittorrent client

Download bittorrent client for Debian Linux:

$ wget http://download.bittorrent.com/dl/bittorrent_5.0.3_python2.4.deb

Download bittorrent clientFor Red Hat / Fedora Core / Cent OS Linux

$ wget http://download.bittorrent.com/dl/BitTorrent-5.0.3-1-Python2.4.noarch.rpm

Step # 3: Linux Install BitTorrent client

First login as a root user (use su or sudo command). If you are using Debian Linux, use dpkg command install bittorrent client
# dpkg -i bittorrent_5.0.3_python2.4.deb
If you are using Red Hat / Fedora Core /Cent OS Linux, use rpm command install bittorrent client:
# rpm -ivh BitTorrent-5.0.3-1-Python2.4.noarch.rpm

Step # 4: Start using or downloading files

Use bittorrent client as follows:
$ /usr/bin/bittorrent-curses 'http://www.some.org/DesktopBSD.iso.torrent'
$ bittorrent-curses 'http://www.some.org/DesktopBSD.iso.torrent'
$ /usr/bin/bittorrent-curses '/path/to/file.torrent'
You can try out pure console based client bittorrent-console instead of curses based client:
$ bittorrent-console '/path/to/file.torrent'
$ /usr/bin/bittorrent-console 'http://www.some.org/DesktopBSD.iso.torrent'

Tips about using and Troubleshooting BitTorrent client

(A) If you get [Errno 2] No such file or directory, you need to use wget or lynx command to download .torrent file to local hard drive first. For example
$ bittorrent-curses 'http://www.mininova.org/get/some_file[222].torrent'
First download download .torrent file using any one of the following method:
$ lynx 'http://www.mininova.org/get/some_file[222].torrent'
When prompted save .torrent file to a hard-disk. Another option is use wget to download .torrent file:
$ wget 'http://www.mininova.org/get/some_file[222].torrent'
Now start the downloading as follows:
$ bittorrent-curses 'some_file[222].torrent'

(B) If you get error 'This seems to be an old Python version which does not support detecting the filesystem encoding. Assuming 'ascii', then upgrade your python version to 2.4.xx:

Debian user upgrade python version using apt-get command:
# apt-get update
# apt-get install python2.4

Red Hat Linux user try out:
# up2date python2.4
Fedora Linux user try out:
# yum install python2.4

Remember if you have both versions (python v2.3 and v2.4) installed, you need to run bittorent client as follows:
$ python2.4 /usr/bin/bittorrent-curses '/path/to/file.torrent'
Command line BitTorrent client should work with other UNIX like operating systems such as FreeBSD/OpenBSD/Solaris etc (as long as you have Python it should work).

The current client enables a range of features including multiple parallel downloads. It also intermediates peering between itself, source file servers (read as trackers) and other clients, thereby yielding great distribution efficiencies. The client also enables users to create and share torrent files. See help files for more information.

See also: