BitTorrentBlockingIPs

From TheoryOrg
Jump to navigation Jump to search

http://groups.yahoo.com/group/BitTorrent/message/2890:

From: michaelmoorr
Sent: Tuesday, May 20, 2003 12:23 PM
Subject: BitTorrent Feature request

hi!

Due to traffic restrictions applied in our country, we would like to
create a feature in bittorrent tracker that allowed only certain IP
adresses to connect, (local adresses it is).

We downloaded the source code, but we had some difficulties to
understand it (first time with Python :P). We'd like to know if u
could give us some hints in how to do it (i mean what part of the
source should we change), or if there is a working java, c++, etc
port of bittorrent.

Answer 1

Modify tracker.py (was around lines 207 - 210) to get an idea of how to reject certain IPs.

If you are feeling tricky, you could also hook into geoip to check that people were connecting from the same country.

Answer 2

Use linux and use iptables.

iptables is used to construct firewalls. It could be used to allow specific IP's on specific ports easily enough. Drop all others.

Probably a lot more ways to do this but this will work.

Answer 3

Setup some smart firewall rules to block external access. It doesn't have to be linux.


Back to BitTorrentFAQ