====== Как заблокировать торренты (хоть чуть-чуть, всё же не заблокируешь лол кек чебурек) ======
===== Вариант 1 =====
Источник: https://www.adminsehow.com/2015/05/block-torrent-trackers-on-linux/
Создаём файл ''/etc/trackers''
9.rarbg.com
announce.torrentsmd.com
bigfoot1942.sektori.org
bt.careland.com.cn
bttrack.9you.com
bttracker.crunchbanglinux.org
coppersurfer.tk
explodie.org
i.bandito.org
mgtracker.org
open.demonii.com
opensharing.org
torrent.fedoraproject.org
torrent.gresille.org
tracker.best-torrents.net
tracker.blucds.com
tracker.btzoo.eu
tracker.coppersurfer.tk
tracker.dler.org
tracker.istole.it
tracker.leechers-paradise.org
tracker.nwps.ws
tracker.openbittorrent.com
tracker.publicbt.com
tracker.tfile.me
tracker1.wasabii.com.tw
Создаём скрипт ''/usr/bin/blocktrackers''
#!/bin/bash
IFS=$'\n'
L=$(/usr/bin/sort /etc/trackers | /usr/bin/uniq)
for fn in $L; do
/sbin/iptables -D INPUT -d $fn -j DROP -m comment --comment "Tracker"
/sbin/iptables -D FORWARD -d $fn -j DROP -m comment --comment "Tracker"
/sbin/iptables -D OUTPUT -d $fn -j DROP -m comment --comment "Tracker"
/sbin/iptables -A INPUT -d $fn -j DROP -m comment --comment "Tracker"
/sbin/iptables -A FORWARD -d $fn -j DROP -m comment --comment "Tracker"
/sbin/iptables -A OUTPUT -d $fn -j DROP -m comment --comment "Tracker"
done
Делаем файл исполняемым и добавляем в cron
===== Вариант 2 =====
Источник: http://blog.asidorov.name/2015/02/iptables.html
# iptables -I FORWARD 1 -m string --string "BitTorrent" --algo bm --to 65535 -j DROP
# iptables -I FORWARD 1 -m string --string "BitTorrent protocol" --algo bm --to 65535 -j DROP
# iptables -I FORWARD 1 -m string --string "peer_id=" --algo bm --to 65535 -j DROP
# iptables -I FORWARD 1 -m string --string ".torrent" --algo bm --to 65535 -j DROP
# iptables -I FORWARD 1 -m string --string "announce.php?passkey=" --algo bm --to 65535 -j DROP
# iptables -I FORWARD 1 -m string --string "torrent" --algo bm --to 65535 -j DROP
# iptables -I FORWARD 1 -m string --string "announce" --algo bm --to 65535 -j DROP
# iptables -I FORWARD 1 -m string --string "info_hash" --algo bm --to 65535 -j DROP
# iptables -L FORWARD -vn --line-numbers
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
num pkts bytes target prot opt in out source destination
1 95 24353 DROP all -- * * 0.0.0.0/0 0.0.0.0/0 STRING match "info_hash" ALGO name bm TO 65535
2 28 40328 DROP all -- * * 0.0.0.0/0 0.0.0.0/0 STRING match "announce" ALGO name bm TO 65535
3 16 912 DROP all -- * * 0.0.0.0/0 0.0.0.0/0 STRING match "torrent" ALGO name bm TO 65535
4 0 0 DROP all -- * * 0.0.0.0/0 0.0.0.0/0 STRING match "announce.php?passkey=" ALGO name bm TO 65535
5 0 0 DROP all -- * * 0.0.0.0/0 0.0.0.0/0 STRING match ".torrent" ALGO name bm TO 65535
6 0 0 DROP all -- * * 0.0.0.0/0 0.0.0.0/0 STRING match "peer_id=" ALGO name bm TO 65535
7 95 12940 DROP all -- * * 0.0.0.0/0 0.0.0.0/0 STRING match "BitTorrent protocol" ALGO name bm TO 65535
8 0 0 DROP all -- * * 0.0.0.0/0 0.0.0.0/0 STRING match "BitTorrent" ALGO name bm TO 65535