Blocking BitTorrent

r00igev@@r

Honorary Master
Joined
Dec 14, 2009
Messages
15,640
Reaction score
14,157
Location
Draadloos Bantha poo doo in 4ways
Any good ideas on stopping BitTorrent on debian buster

I'm trying this but it doesn't seem to work!

# Block BitTorrent file
iptables -A FORWARD -m string --algo bm --string ".torrent" -j DROP
# Block BitTorrent Distributed Hash Table (DHT) keywords
iptables -A FORWARD -m string --algo kmp --string "find_node" -j DROP
iptables -A FORWARD -m string --algo kmp --string "info_hash" -j DROP
iptables -A FORWARD -m string --algo kmp --string "get_peers" -j DROP
iptables -A FORWARD -m string --algo kmp --string "announce_peers" -j DROP
 
Your going to need a bit of deep packet inspection to block it at a network layer.

Far easier to simply block the applications from running on managed devices.
 
I assume its your network

So:

slap-slapping.gif
 

Attachments

  • 1648382595302.png
    1648382595302.png
    162.8 KB · Views: 20
Your going to need a bit of deep packet inspection to block it at a network layer.

Far easier to simply block the applications from running on managed devices.
I have a dpi engine but need to write/modify code in python to implement an IPSET block. Might as well start but was hoping there was an easy workaround that I haven't thought about.
 
Although it doesn't really help the OP, I find that the IDS/IPS on the Ubiquiti UDM Pro is exceptionally good at blocking torrent and tor connections.
 
I spoke to the SD-WAN traffic analytics guys we use and they provided a linux agent that does dpi and then pumps the bittorent matches into IPSET. Unluckily its commercial but its works like the bomb.
 
Top
Sign up to the MyBroadband newsletter
X