Блокировка BitTorrent’a на Linux-шлюзе

Блокировка скачивания файлов .torrent и сайтов со словами, которые находятся в string:

# 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

Также можно поставить модуль ipp2p, но он устарел и толку мало от него:

# apt-get update
# apt-get install xtables-addons-common
# iptables -I FORWARD -p tcp -m ipp2p --bit -j DROP
# iptables -I FORWARD -p udp -m ipp2p --bit -j DROP

Категории: Linux

Метки:

- 29.06.2018           Просмотры: 360

Заметки в Telegram

Добавить комментарий

Ваш электронный адрес не будет опубликован и он необязателен