Page 1 of 1
How to Block torrent 100%? Only 2 lines. It is solved.
Posted: Sat Jun 08, 2013 2:35 pm
by sontrava
Here my most simple and effective method.
_____________________________________________________________________________________________
/ip f f
a ac=d ch=forward p2=all
a
ac=d ch=forward
in-i=e3 prot=udp cont="d1:ad2:id20:" dst-p=1025-65535
packet-s=95-190 com="torrent-DHT-Out-Magnet d1:ad2:id20:"
a
ac=d ch=forward
in-i=e3 prot=tcp cont="info_hash=" dst-p=2710,80
com="torrent /announce..."
rule №1 - Classic non-security torrent - It is a little used
rule №2 - block outgoing DHT (for .torrent and magnet )
rule №3 - block outgoing TCP announce (for .torrent) or Layer7 Rule - [\?\&]info_hash=.?\%
______________________________________________________________________________________________
this rule №4 - prohibits download .torrent files.
a
ac=d ch=forward
cont="\r\nContent-Type: application/x-bittorrent" out-i=e3 prot=tcp src-p=80 com=".torrent \r\nContent-Type...."
Rule №4 - version 2.
a
ac=d ch=forward
cont="\r\n\r\nd8:announce" out-i=e3 prot=tcp src-p=80 com=".torrent \r\nContent-Type...."
Paste this command only from the console. Because there is \r\n
_______________________________________________________________________________________________
this rule №5 - block LocalBroadcast OutGoing Torrent UDP (Destination MAC: 01:00:5E:40:98:8F)(Destination IP: 239.192.152.143:6771) (It is not required, Not necessarily)
a
ac=d ch=forward
cont="\r\nInfohash: " in-i=e3
prot=udp dst-p=6771 com="torrent 6771 block Local Broadcast ..."
Or it is even simpler - rule №5
a ac=d ch=forward in-i=e3 pr=u dst-p=6771
Paste this command only from the console. Because there is \r\n
________________________________________________________________________________________________
e3=ether3 - LAN
Tested on
uTorrent 3.30
Azureus 2.5.0.0
BitTorrent/4.1.2
BitComet/1.36.5.2
mediaget/2.01.2359
I used sniffer
CommView
________________________________________________________
DHT Outgoing UDP:
È.©!âq..BÔFÙ..EX
._.u..r.YÜÕ¨:’À¨
..‹k .Kk#
d1:ad2
:id20:.×Ù¹¾Z5~'H
óYT….Tu³?e1:q4:
ping1:t4:U&.—1:v
4:UTs¹1:y1:qe
________________________________________________________
ANNOUNCE Outgoing TCP
GET /scrape.php?ak=11c35dbe37&&
info_hash=%f7%9f%25%e6XA%e8bJ%27%3c%a0%7d%fa%8cQ%fd%3e%e3%c5 HTTP/1.1
Host: tracker.tfile.me %87%ee%ac9%95%e5%2f%acQw%cc%80%a9%bf%ea%e6%02%
User-Agent: u
Torrent/3300(29544)
Accept-Encoding: gzip
Connection: Close
GET /001deb4fb4e08d85d887783284607ce2/scrape?
info_hash=y%87%ee%ac9%95%e5%2f%acQw%cc%80%a9%bf%ea%e6%02%16_ HTTP/1.1
Host: bt.nnm-club.ru:2710
User-Agent: u
Torrent/3300(29544)
Accept-Encoding: gzip
Connection: Close
User-Agent: uTorrent/3300(29544)
User-Agent: Azureus 2.5.0.0
User-Agent: BitTorrent/4.1.2
User-Agent: BitComet/1.36.5.2
User-Agent: mediaget/2.01.2359/
User-Agent: Mozilla/4.0
________________________________________________________
.torrent-link - Incoming TCP
HTTP/1.1 200 OK
Server: nginx
Date: Fri, 07 Jun 2013 01:28:52 GMT
Content-Type: application/x-bittorrent
Content-Length: 13096
Connection: keep-alive
Keep-Alive: timeout=10
Set-Cookie: phpbb2mysql_4_data=a%3A2%3A%7Bs%3A11%3A%22autologinid%22%3Bs%3A0%3A%22%22%3Bs%3A6%3A%22userid%22%3Bs%3A7%3A%221960783%22%3B%7D; expires=Sat, 07-Jun-2014 01:28:50 GMT; path=/; domain=.nnm-club.ru
Set-Cookie: phpbb2mysql_4_sid=6145015fdfbd1249988a0d51c227a91b; path=/; domain=.nnm-club.ru
Content-Disposition: attachment; filename="[NNM-Club.ru]_Kisti
.torrent"
X-Backend-Status: BYPASS
X-Frontend-Status: BYPASS
d8:announce68:
http://bt.nnm-club.ru:2710/001deb4f8ee5 ... e-listll68:
http://bt.nnm-club.ru:2710/001deb4f8ee5 ... announce70:
http://bt.nnm-club.info:2710/001deb4f8e ... ounceel189:
http://retracker.local/announce.php?size=73663513
&comment=http%3A%2F%2Fnnm-club.ru%2Fforum%2Fviewtopic.php%3Fp%3D5651127
&name=%CA%E8%F1%F2%E8+-+%CA%E8%F1%F2%E8+%E4%EB%FF+Photoshop+%5BABR%5Dee7:comment48:
http://nnm-club.ru/forum/viewtopic.php? ... 10:created by13:uTorrent/204013:creation datei1369771330e8:encoding5:
UTF-84:infod5:filesld6:lengthi393490e4:pathl5:1.jpgeed6:lengthi220755e4:pathl5:2.jpgeed6:lengthi903549e4:pathl5:3.jpgeed6:
lengthi490880e4:pathl8:bone.abreed6:lengthi1116986e4:pathl24:chokingonstatic_film.abreed6:lengthi1662462e4:pa.......
________________________________________________________
BroadCast Local Torrent OutGoing UDP
BT-SEARCH * HTTP/1.1
Host: 239.192.152.143:
6771
Port: 41104
Infohash: 47B5A38DD14EC71478EC503B7E3E19E61E230A41
Re: How to Block torrent 100%? Only 2 lines. It is solved.
Posted: Sat Jun 08, 2013 5:04 pm
by pcunite
Thanks for sharing
Re: How to Block torrent 100%? Only 2 lines. It is solved.
Posted: Sat Jun 08, 2013 7:08 pm
by ronix
great work .....
Re: How to Block torrent 100%? Only 2 lines. It is solved.
Posted: Sat Jun 08, 2013 8:08 pm
by sontrava
thanks.
Re: How to Block torrent 100%? Only 2 lines. It is solved.
Posted: Sat Jun 08, 2013 8:47 pm
by alexanders
Look like works only for nnm-club tracker...
№2 has been added from nnm-club and really blocked, №1,3 from another's trackers..
Re: How to Block torrent 100%? Only 2 lines. It is solved.
Posted: Sat Jun 08, 2013 9:03 pm
by sontrava
Give me the URL of trackers
I will check more
Re: How to Block torrent 100%? Only 2 lines. It is solved.
Posted: Sat Jun 08, 2013 9:13 pm
by alexanders
Give me the names of trackers
I will check more
tfile.me
Re: How to Block torrent 100%? Only 2 lines. It is solved.
Posted: Sat Jun 08, 2013 9:55 pm
by sontrava
I Fixed the rule №2. Пользуйтесь на здоровье.
You check how it works
Re: How to Block torrent 100%? Only 2 lines. It is solved.
Posted: Sun Jun 09, 2013 4:49 pm
by sontrava
I checked these torrents - All successfully blocked
tfile.ru
opensharing.org
rutor.org
sharlet.net
fast-torrent.ru
torrent-poisk.com
hdreactor.org
unionpeer.org
streamzone.org
megashara.com
riper.am
goldenshara.com
seedoff.net
kinomagia.tv
torrent.rus.ec
pirat.ca
kinozal.tv
kinokopilka.ru
bigtracker.org
torzona.ru
bigtracker.org
torzone.org
tsearch.iimedia.ru
Re: How to Block torrent 100%? Only 2 lines. It is solved.
Posted: Wed Jun 26, 2013 10:27 pm
by DiegoBAI
Hi, can you please re-post the updated commands?
Thanks
Re: How to Block torrent 100%? Only 2 lines. It is solved.
Posted: Thu Jun 27, 2013 2:04 am
by TonyJr
Add to wiki?
Re: How to Block torrent 100%? Only 2 lines. It is solved.
Posted: Thu Jun 27, 2013 2:06 pm
by n21roadie
Re: How to Block torrent 100%? Only 2 lines. It is solved.
Posted: Fri Jun 28, 2013 11:59 pm
by sontrava
In The Mikrotik All commands can be shortened
example:
/ip f f ----> / ip firewall filter
a ac=d ch=forward ----> add action=drop chain=forward
Re: How to Block torrent 100%? Only 2 lines. It is solved.
Posted: Sat Jun 29, 2013 10:50 am
by ven16
can you please post updated commands
how can i use for below scenario including with squid server.
thank you
Re: How to Block torrent 100%? Only 2 lines. It is solved.
Posted: Sat Jul 06, 2013 7:49 am
by mahnet
/ip firewall filter
add action=drop chain=forward disabled=no p2p=all-p2p
add action=drop chain=forward comment="torrent dht out magnet" content=d1:ad2:ad20 disabled=no dst-port=1025-65535 packet-size=95-190 protocol=udp
add action=drop chain=forward comment=info_hash content=info_hash disabled=no dst-port=2170,80 protocol=tcp
Is the above mentioned a correct interpretation of what has been suggested. I have only not mentioned the IN-INTERFACE so that any traffic detected on any port is stalled.
Is the dst-port=2170.80 correct.
Please suggest.
Re: How to Block torrent 100%? Only 2 lines. It is solved.
Posted: Sun Jul 07, 2013 8:07 pm
by brianlewis
Updated commands without 'IN INTERFACE' defined because not all of us have an E3 interface
/ip f f
a ac=d ch=forward p2=a
a ac=d ch=forward pr=u cont="d1:ad2:id20:" dst-p=1025-65535 packet-s=95-190 com="torrent-DHT-Out-Magnet d1:ad2:id20:"
a ac=d ch=forward pr=t cont="info_hash=" dst-p=2710,80 com="torrent /announce..."
You can then edit with Winbox the 2nd and 3rd rule for the IN Interface to be from your user network.
Re: How to Block torrent 100%? Only 2 lines. It is solved.
Posted: Thu Sep 05, 2013 10:53 pm
by yurichem
not work at all with vuze
ant i tested some torrent downloads, the rule is not working for me
but torrent-traffic is perfectly block for uTorrent and MediaGet
Re: How to Block torrent 100%? Only 2 lines. It is solved.
Posted: Mon Sep 09, 2013 10:49 am
by lilproten
MY IS NOT WORKING I HAVE A MIKROTIK RB2011 AND NO MATTER WHAT I DO THE BLOCKING OF U TORRENT DOES NOT EVEN WORK.PLEASE I REALLY NEED HELP.
Re: How to Block torrent 100%? Only 2 lines. It is solved.
Posted: Tue Sep 10, 2013 7:50 pm
by ohara
I have implemented these rules successfully a few days ago. I would like to create routing marks out of those rules to be albe to route p2p through a different gateway. If anyone has done that already please let me know.
ros code
add action=drop chain=forward comment="TORRENT No 1: Classic non security torrent" disabled=no p2p=all-p2p
add action=drop chain=forward comment="TORRENT No 2: block outgoing DHT" content=d1:ad2:id20: disabled=no dst-port=1025-65535 packet-size=95-190 protocol=udp
add action=drop chain=forward comment="TORRENT No 3: block outgoing TCP announce" content="info_hash=" disabled=no dst-port=2710,80 protocol=tcp
add action=drop chain=forward comment="TORRENT No 4: prohibits download .torrent files. " content="\r\nContent-Type: application/x-bittorrent" disabled=no protocol=tcp src-port=80
add action=drop chain=forward comment="TORRENT No 5: 6771 block Local Broadcast" content="\r\nInfohash:" disabled=no dst-port=6771 protocol=udp
Re: How to Block torrent 100%? Only 2 lines. It is solved.
Posted: Wed Sep 11, 2013 12:13 am
by lilproten
when i paste the code into the winbox terminal i get this error
Re: How to Block torrent 100%? Only 2 lines. It is solved.
Posted: Thu Sep 12, 2013 10:46 pm
by derr12
you forgot the "add" in front of your comment, thats why it fails on the syntax.
Re: How to Block torrent 100%? Only 2 lines. It is solved.
Posted: Fri Sep 13, 2013 11:05 am
by lilproten
when i even add the add it is still the same error i am using ros 6.3 version
Re: How to Block torrent 100%? Only 2 lines. It is solved.
Posted: Sun Sep 15, 2013 7:31 am
by mahnet
when i even add the add it is still the same error i am using ros 6.3 version
thr seems to be an extra space after"="
Re: How to Block torrent 100%? Only 2 lines. It is solved.
Posted: Sun Sep 15, 2013 7:42 am
by mahnet
when i even add the add it is still the same error i am using ros 6.3 version
i thing u have extra space after"="
Re: How to Block torrent 100%? Only 2 lines. It is solved.
Posted: Thu Sep 19, 2013 10:04 pm
by ajhart
Works for me - Good work!
Tested on secure encrypted and non secured torrents.
I wonder if you can take this concept and shape the traffic instead of dropping everything.
I created some mangles instead of filters by marking the connections and packets and adding that to a queue.
It works with no secured torrents in some way (only downloaded traffic), but when I encrypt the torrents, it has a mind of its own.
The queue is fully occupied but traffic is still more than specified.
Here is what I've got.
/ip firewall mangle
add action=mark-connection chain=forward comment=\
"TORRENT No 1: Classic non security torrent" disabled=yes \
new-connection-mark=dst-p2p-conn p2p=all-p2p
add action=mark-packet chain=forward connection-mark=dst-p2p-conn disabled=\
yes new-packet-mark=dst-p2p-packet
add action=mark-connection chain=forward comment=\
"TORRENT No 2: block outgoing DHT" content=d1:ad2:id20: disabled=yes \
dst-port=1025-65535 in-interface=ether1 new-connection-mark=p2p-out-DHT \
packet-size=95-190 protocol=udp
add action=mark-packet chain=forward connection-mark=p2p-out-DHT disabled=yes \
new-packet-mark=dst-p2p-packet
/queue simple
add disabled=yes limit-at=1M/1M max-limit=1M/1M name=p2p packet-marks=\
dst-p2p-packet target=""
Is it maybe possible to make this work
Re: How to Block torrent 100%? Only 2 lines. It is solved.
Posted: Fri Sep 27, 2013 3:54 am
by tamahome
sontrava, your two rules doesn't work for me. The utorrent keeps connecting and downloading.
Re: How to Block torrent 100%? Only 2 lines. It is solved.
Posted: Fri Sep 27, 2013 7:52 pm
by sontrava
sontrava, your two rules doesn't work for me. The utorrent keeps connecting and downloading.
That should do it. Send me your e-mail. I will help you.
Re: How to Block torrent 100%? Only 2 lines. It is solved.
Posted: Fri Sep 27, 2013 9:10 pm
by lilproten
i applied the firewall and it works but what i want to do now is to allow certain ips or disable firewall at 12pm in the evening and end at 6pm
Re: How to Block torrent 100%? Only 2 lines. It is solved.
Posted: Fri Sep 27, 2013 10:53 pm
by tamahome
info (at) tamax.com.ar
Should it stop the downloading once it is started or only works for new downloads?
Thank you
Re: How to Block torrent 100%? Only 2 lines. It is solved.
Posted: Tue Oct 01, 2013 2:08 am
by krajnalic
to lilproten
you can use scheduler to enable/disable firewall rules at given hours
Re: How to Block torrent 100%? Only 2 lines. It is solved.
Posted: Mon Oct 07, 2013 3:30 pm
by jalal79
Thanks Its Work for Me
Re: How to Block torrent 100%? Only 2 lines. It is solved.
Posted: Tue Oct 08, 2013 10:55 am
by lilproten
please with respect to this firewall and mangle rules how do you use the scheduler anybody with knowledge on that and has done that...
secondly someone should help us in terms of limiting the speed of such traffic (p2p)
Re: How to Block torrent 100%? Only 2 lines. It is solved.
Posted: Thu Oct 10, 2013 3:03 pm
by delix
please with respect to this firewall and mangle rules how do you use the scheduler anybody with knowledge on that and has done that...
secondly someone should help us in terms of limiting the speed of such traffic (p2p)
+100
We really do want to this shaping rules instead of just blocking!
Pls someone who familiar with mangle and shaping rules try to make working ones
Re: How to Block torrent 100%? Only 2 lines. It is solved.
Posted: Thu Oct 10, 2013 5:25 pm
by ujemvi
To the wiki... and beyond!
Re: How to Block torrent 100%? Only 2 lines. It is solved.
Posted: Thu Oct 10, 2013 10:38 pm
by summercat
does skype working after applying any listed here rules?
I remember, i added rule like
forward - all-p2p - drop
and skype wouldn't work.
Re: How to Block torrent 100%? Only 2 lines. It is solved.
Posted: Tue Nov 05, 2013 7:33 pm
by Jeanluck
I try it, and works fine, but layer 7
http://l7-filter.sourceforge.net/layer7 ... orrent.pat works better in one rule (I use it in mangle)
Re: How to Block torrent 100%? Only 2 lines. It is solved.
Posted: Tue Nov 05, 2013 11:01 pm
by tamahome
If I'm working with PPP the times you use out/in interface "e3" in the rules 2, 4 and 5, Should I replace it with "!WAN" to select not only the LAN interface but also the virtual ppp sessions?
I entered manual all the lines the "\r\n" does not appear in the rules once entered. Should I edit the rule and add it manually?
Thank you
Re: How to Block torrent 100%? Only 2 lines. It is solved.
Posted: Thu Nov 07, 2013 3:30 pm
by dunga
Hello all,
Can i have the firewall rule to block the torent as you guys suggested. I want to implement it in my network
Re: How to Block torrent 100%? Only 2 lines. It is solved.
Posted: Sat Nov 16, 2013 12:13 am
by tamahome
the rules does not work for ppp sessions. Only work for static IP addresses. What shoud I change to block torrent on PPP?
Thank you
Re: How to Block torrent 100%? Only 2 lines. It is solved.
Posted: Mon Nov 18, 2013 1:52 pm
by baxim69
Does not work rule. What could it be?
Re: How to Block torrent 100%? Only 2 lines. It is solved.
Posted: Mon Mar 03, 2014 12:48 pm
by stleoric
Works perfectly so far on my wifi hotspot interface. Thank you!
Re: How to Block torrent 100%? Only 2 lines. It is solved.
Posted: Tue Mar 04, 2014 7:03 am
by pusspower
2 all & baxim69
Working, except of teredo hole (windows Vista,7,...).
Additionally drop forward dst-port udp 3544.
And all be quiet.
Re: How to Block torrent 100%? Only 2 lines. It is solved.
Posted: Tue Mar 25, 2014 6:30 pm
by freemannnn
can someone help me,
why i get the error "expected end of command (line 1 column 19)" in terminal when i right click to paste the command bellow. "p"r=udp is highlighted
a ac=d ch=forward in-i=ether2-master-local pr=udp cont="d1:ad2:id20:" dst-p=1025-65535 packet-s=95-190 com="torrent-DHT-Out-Magnet d1:ad2:id20:"
Re: How to Block torrent 100%? Only 2 lines. It is solved.
Posted: Sat Apr 05, 2014 3:28 pm
by lil0
RB411R v.4.17
Works perfectly on my wifi hotspot interface. Thank you!
Re: How to Block torrent 100%? Only 2 lines. It is solved.
Posted: Mon Apr 07, 2014 4:38 pm
by gazdi
The blocking scheme doesnt work at me.
I tried other versions too, with packet/connection marking and L7 stuff, without any result.
Client utorrent, router RB951G-2HnD with RouterOS 6.11
Re: How to Block torrent 100%? Only 2 lines. It is solved.
Posted: Sun May 25, 2014 6:59 pm
by coylh
This has worked well for utorrent for me.
/ip firewall mangle
add action=add-src-to-address-list address-list=P2P address-list-timeout=12h chain=prerouting comment="Add src address to list if matches old p2p-all" p2p=all-p2p src-address=192.168.128.0/17
add action=add-src-to-address-list address-list=P2P address-list-timeout=12h chain=prerouting comment="Add src address to list if matches torrent /announce..." content="info_hash=" dst-port=2710,80 protocol=tcp src-address=192.168.128.0/17
add action=add-src-to-address-list address-list=P2P address-list-timeout=12h chain=prerouting comment="Add src address to list if matches torrent-DHT-Out-Magnet d1:ad2:id20:" content=d1:ad2:id20: dst-port=1025-65535 packet-size=95-190 protocol=udp src-address=192.168.128.0/17
Re: How to Block torrent 100%? Only 2 lines. It is solved.
Posted: Thu Aug 14, 2014 9:34 am
by LiquidDave
If I add these rules without adding an interface they should work with all interfaces correct? PPP clients are still downloading torrents and the only thing that is different is I have not added the interfaces,
Re: How to Block torrent 100%? Only 2 lines. It is solved.
Posted: Mon Aug 18, 2014 9:55 am
by gazdi
Until traffic is encrypted as the clients use in usual and in the most cases, there is no chance to block any p2p traffic with stuff based only on L7 traffic recognizing or on L7 pattern detection.
Re: How to Block torrent 100%? Only 2 lines. It is solved.
Posted: Tue Aug 19, 2014 10:41 am
by ven16
HI,
how can we apply these rules for specific IP address in local network?
thank you,
Ven
Re: How to Block torrent 100%? Only 2 lines. It is solved.
Posted: Fri Sep 12, 2014 11:32 pm
by mgawad9
dears
i have RouterBOARD 750 GL
and need to disable all torrent actions in my network
how to do it
note : i have very low experience in mikrotik router
Re: How to Block torrent 100%? Only 2 lines. It is solved.
Posted: Fri Mar 20, 2015 8:02 pm
by LaZyLion
can someone help me,
why i get the error "expected end of command (line 1 column 19)" in terminal when i right click to paste the command bellow. "p"r=udp is highlighted
a ac=d ch=forward in-i=ether2-master-local pr=udp cont="d1:ad2:id20:" dst-p=1025-65535 packet-s=95-190 com="torrent-DHT-Out-Magnet d1:ad2:id20:"
Change "pr=udp" to "pro=udp"
Same with tcp on the next lines.
Re: How to Block torrent 100%? Only 2 lines. It is solved.
Posted: Sat Mar 21, 2015 9:18 am
by loveman
nice method ,, I will try soon ,, I need to ask you about how can I block app viber in (android and iPhone ) from mikrotik server ,,?
if you have idea plz comment here ,,
Thanks
Re: How to Block torrent 100%? Only 2 lines. It is solved.
Posted: Tue Apr 21, 2015 9:35 pm
by karina
can i use these rules without specifying the interfaces. I have 3 ppp interfaces as Wan and 10 interfaces as LAN
Re: How to Block torrent 100%? Only 2 lines. It is solved.
Posted: Wed May 27, 2015 6:00 pm
by tubus
Не блокирует торрент траффик. Использовал первые 3 правила.
Re: How to Block torrent 100%? Only 2 lines. It is solved.
Posted: Thu May 28, 2015 9:01 am
by chechito
most trackers do not use DHT, local peer discovery, and peer exchange.
this rules catch torrent using protocol encryption??
Re: How to Block torrent 100%? Only 2 lines. It is solved.
Posted: Thu May 28, 2015 9:10 pm
by Chupaka
Those rules block peer discovery, afaics. They don't block p2p itself.
Re: How to Block torrent 100%? Only 2 lines. It is solved.
Posted: Wed Dec 09, 2015 7:55 pm
by rado3105
Is anyway to use this rules to mark ongoing p2p traffic? thanks
Re: How to Block torrent 100%? Only 2 lines. It is solved.
Posted: Wed Dec 09, 2015 8:10 pm
by chechito
personally i think is better to allow torrent but throttling it to give it a priority below other services
How to Block torrent 100%? Only 2 lines. It is solved.
Posted: Wed Dec 09, 2015 8:23 pm
by freemannnn
personally i think is better to allow torrent but throttling it to give it a priority below other services
Can u give us and example with code?
Re: How to Block torrent 100%? Only 2 lines. It is solved.
Posted: Thu Dec 10, 2015 10:00 pm
by chechito
i take the example of this page and customize it
https://www.mikrotik-routeros.com/2014/ ... rees-v6-0/
the concept is this give me some time to upload the code
in this schemma indirectly torrent traffic get on queue others big or queue udp no voip, you give that queues the lowest priority and its done
queue concept.jpg