Score:0

Can not block torrent traffic in my Ubuntu 22.04 vps

lk flag
sam

I have an Ubuntu 22.04 vps which I want to block all torrent traffic on it.

I tried Iptables by this commands :

iptables -I FORWARD -m string --algo bm --string "BitTorrent" -j DROP
iptables -I FORWARD -m string --algo bm --string "BitTorrent protocol" -j DROP
iptables -I FORWARD -m string --algo bm --string "peer_id=" -j DROP
iptables -I FORWARD -m string --algo bm --string ".torrent" -j DROP
iptables -I FORWARD -m string --algo bm --string "announce.php?passkey=" -j DROP
iptables -I FORWARD -m string --algo bm --string "torrent" -j DROP
iptables -I FORWARD -m string --algo bm --string "announce" -j DROP
iptables -I FORWARD -m string --algo bm --string "info_hash" -j DROP

and i installed iptables-persistent to keep configs.

But the torrent traffic is still passing in my vps and it has caused copyright issues. recently i recived dmca_p2p abuse warning and ...

how can i block all torrent traffic in my vps ?

user535733 avatar
cn flag
Since you are merely conveying encrypted packets (P2P is usually encrypted), string filtering won't work. A similar scenario was asked and answered at https://serverfault.com/questions/27088/using-linux-iptables-how-to-block-torrents-or-any-p2p-protocols back in 2009. Some of those strategies are still quite appropriate.
Score:0
lk flag
sam

i solved this problem by this scipt :

https://github.com/nikzad-avasam/block-torrent-on-server

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.