Community discussions

MikroTik App
 
sakalsk
just joined
Topic Author
Posts: 5
Joined: Fri Jul 03, 2020 6:31 pm

Torrent blocking working in y2020

Sun Jul 05, 2020 4:31 pm

Block Bittorrent and P2P using latest MikroTik RouterOS 6.43.3
Mikrotik new version software stops blocking torrents and p2p with the error P2P matcher is obsolete please use layer7 matcher instead - MikroTik
Here are the new and revise configuration what is still working in year 2020 - steps that will block torrents and p2p traffic from mikrotik router:

In terminal:

/ip firewall layer7-protocol
add comment="Block Bit Torrent" name=layer7-bittorrent-exp regexp="^(\\x13bitt\
orrent protocol|azver\\x01\$|get /scrape\\\?info_hash=get /announce\\\?inf\
o_hash=|get /client/bitcomet/|GET /data\\\?fid=)|d1:ad2:id20:|\\x08'7P\\)[\
RP]"
/ip firewall filter
add action=add-src-to-address-list address-list=Torrent-Conn \
address-list-timeout=2m chain=forward layer7-protocol=\
layer7-bittorrent-exp src-address=192.168.2.0/24 src-address-list=\
!allow-bit
/ip firewall filter
add action=drop chain=forward dst-port=\
!0-1024,8291,5900,5800,3389,14147,5222,59905 protocol=tcp \
src-address-list=Torrent-Conn
/ip firewall filter
add action=drop chain=forward dst-port=\
!0-1024,8291,5900,5800,3389,14147,5222,59905 protocol=udp \
src-address-list=Torrent-Conn
 
sakalsk
just joined
Topic Author
Posts: 5
Joined: Fri Jul 03, 2020 6:31 pm

Re: Torrent blocking working in y2020

Sun Jul 05, 2020 4:34 pm

This future is not 100% working...

regarding my testing after 5 minutes of inactive torrent it find first seeder and that other and other... it will slow down downloaders but there is still possibility torrent will work.
 
User avatar
nithinkumar2000
Member Candidate
Member Candidate
Posts: 157
Joined: Wed Sep 11, 2019 7:42 am
Location: Coimbatore
Contact:

Re: Torrent blocking working in y2020

Sun Jul 05, 2020 9:19 pm

Block Bittorrent and P2P using latest MikroTik RouterOS 6.43.3
Mikrotik new version software stops blocking torrents and p2p with the error P2P matcher is obsolete please use layer7 matcher instead - MikroTik
Here are the new and revise configuration what is still working in year 2020 - steps that will block torrents and p2p traffic from mikrotik router:

In terminal:

/ip firewall layer7-protocol
add comment="Block Bit Torrent" name=layer7-bittorrent-exp regexp="^(\\x13bitt\
orrent protocol|azver\\x01\$|get /scrape\\\?info_hash=get /announce\\\?inf\
o_hash=|get /client/bitcomet/|GET /data\\\?fid=)|d1:ad2:id20:|\\x08'7P\\)[\
RP]"
/ip firewall filter
add action=add-src-to-address-list address-list=Torrent-Conn \
address-list-timeout=2m chain=forward layer7-protocol=\
layer7-bittorrent-exp src-address=192.168.2.0/24 src-address-list=\
!allow-bit
/ip firewall filter
add action=drop chain=forward dst-port=\
!0-1024,8291,5900,5800,3389,14147,5222,59905 protocol=tcp \
src-address-list=Torrent-Conn
/ip firewall filter
add action=drop chain=forward dst-port=\
!0-1024,8291,5900,5800,3389,14147,5222,59905 protocol=udp \
src-address-list=Torrent-Conn
Anyone Else Tried This???
 
sakalsk
just joined
Topic Author
Posts: 5
Joined: Fri Jul 03, 2020 6:31 pm

Re: Torrent blocking working in y2020

Sun Jul 05, 2020 11:51 pm

Just try it on your own. It really helps but not for 100%
 
User avatar
vecernik87
Forum Veteran
Forum Veteran
Posts: 882
Joined: Fri Nov 10, 2017 8:19 am

Re: Torrent blocking working in y2020

Mon Jul 06, 2020 2:45 am

well, if it does not work 100% then it does not really help, don't you think? I mean - what difference it makes if the download takes bit more? Idea of blocking is, that NOTHING goes through.
If it still starts after a while, it likely means you missed some port or regexp part, which still gets through.
 
User avatar
Jotne
Forum Guru
Forum Guru
Posts: 3279
Joined: Sat Dec 24, 2016 11:17 am
Location: Magrathean

Re: Torrent blocking working in y2020

Mon Jul 06, 2020 8:10 am

Block Bittorrent and P2P using latest MikroTik RouterOS 6.43.3
This was posted 5 Juli 2020. 6.43.3 is very old and far far from latest Router OS (from 18.10.2018). Latest stable 6.47 and long term 6.45.9
I would not have used this old version due to lots of missing security patches.
 
jeanmichaeltagui
just joined
Posts: 6
Joined: Tue Apr 10, 2018 10:21 am

Re: Torrent blocking working in y2020

Wed Sep 16, 2020 4:03 pm

Yes it's work in my RB2011

/ip firewall layer7-protocol
add comment="Block Bit Torrent" name=layer7-bittorrent-exp regexp="^(\\x13bitt\
orrent protocol|azver\\x01\$|get /scrape\\\?info_hash=get /announce\\\?inf\
o_hash=|get /client/bitcomet/|GET /data\\\?fid=)|d1:ad2:id20:|\\x08'7P\\)[\
RP]"

/ip firewall filter
add action=add-src-to-address-list address-list=Torrent-Conn \
address-list-timeout=2m chain=forward layer7-protocol=\
layer7-bittorrent-exp src-address=192.168.88.0/24 src-address-list=\
!allow-bit
add action=drop chain=forward dst-port=\
!0-1024,8291,5900,5800,3389,14147,5222,59905 protocol=tcp \
src-address-list=Torrent-Conn
add action=drop chain=forward dst-port=\
!0-1024,8291,5900,5800,3389,14147,5222,59905 protocol=udp \
src-address-list=Torrent-Conn
 
User avatar
Jotne
Forum Guru
Forum Guru
Posts: 3279
Joined: Sat Dec 24, 2016 11:17 am
Location: Magrathean

Re: Torrent blocking working in y2020

Mon Sep 21, 2020 1:16 pm

Im uTorrent
Options->Prefences->BitTorrent-Protocol Encryption set it to Enabled, then test if your rule still blocks it.
 
jeanmichaeltagui
just joined
Posts: 6
Joined: Tue Apr 10, 2018 10:21 am

Re: Torrent blocking working in y2020

Tue Sep 29, 2020 3:12 pm

Im uTorrent
Options->Prefences->BitTorrent-Protocol Encryption set it to Enabled, then test if your rule still blocks it.
I don't know how but it is still blocking torrent after i enabled BitTorrent-Protocol Encryption.
You do not have the required permissions to view the files attached to this post.
 
neutronlaser
Member
Member
Posts: 445
Joined: Thu Jan 18, 2018 5:18 pm

Re: Torrent blocking working in y2020

Tue Sep 29, 2020 5:08 pm

Why would you want to do this?
 
jeanmichaeltagui
just joined
Posts: 6
Joined: Tue Apr 10, 2018 10:21 am

Re: Torrent blocking working in y2020

Sat Oct 03, 2020 8:08 pm

Why would you want to do this?
Torrent is illegal where i live,,,,,, if i don't block it then our small ISP will be charge by the internet authority
 
User avatar
Jotne
Forum Guru
Forum Guru
Posts: 3279
Joined: Sat Dec 24, 2016 11:17 am
Location: Magrathean

Re: Torrent blocking working in y2020

Sat Oct 03, 2020 9:06 pm

So if the speed limit is 100 kph and I have a car that can run 200 kph, we need to close the road?
Torrent are not illegal, sharing copyright material are.
Closing one service just move user to another :)
 
neutronlaser
Member
Member
Posts: 445
Joined: Thu Jan 18, 2018 5:18 pm

Re: Torrent blocking working in y2020

Sat Oct 03, 2020 10:07 pm

Why would you want to do this?
Torrent is illegal where i live,,,,,, if i don't block it then our small ISP will be charge by the internet authority
Where do you live? I don't believe they are illegal.
 
creatin
Member Candidate
Member Candidate
Posts: 108
Joined: Sat Nov 23, 2019 2:59 am

Re: Torrent blocking working in y2020

Sun Oct 04, 2020 6:13 pm

Try to use it in Germany :)
 
neutronlaser
Member
Member
Posts: 445
Joined: Thu Jan 18, 2018 5:18 pm

Re: Torrent blocking working in y2020

Sun Oct 04, 2020 6:18 pm

Eek I just read about Germany.
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7038
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: Torrent blocking working in y2020

Mon Oct 05, 2020 1:46 pm

The Torrent system on it's own is not illegal.
Downloading copyrighted content is illegal.
 
User avatar
CZFan
Forum Guru
Forum Guru
Posts: 2098
Joined: Sun Oct 09, 2016 8:25 pm
Location: South Africa, Krugersdorp (Home town of Brad Binder)
Contact:

Re: Torrent blocking working in y2020

Mon Oct 05, 2020 2:26 pm

The Torrent system on it's own is not illegal.
Downloading copyrighted content is illegal.

This is my understanding also, read an article yesterday that in Germany, some law firms are not so ethical (who would have thought) and sending very threatening letters to people to pay up, and the normal Joe does not know better, so he pays. Case of big brother bullying little brother
 
freemannnn
Forum Veteran
Forum Veteran
Posts: 700
Joined: Sun Oct 13, 2013 7:29 pm

Re: Torrent blocking working in y2020

Fri Oct 09, 2020 12:13 pm

rules are working for me also. i try to download various torrents with qbittorrent and they dont start. "force encryption" is enabled in qbittorrent options.
just a small remark. in second rule you have to change subnet to match your setup. the photo is after one hour trying to download random torrents.
i am not sure if there are any Concequenses in apps like facetime,viber,whatsapp, tv boxes etc. further testing needed.

/ip firewall filter
add action=add-src-to-address-list address-list=Torrent-Conn \
address-list-timeout=2m chain=forward layer7-protocol=\
layer7-bittorrent-exp src-address=192.168.2.0/24 src-address-list=\
!allow-bit
You do not have the required permissions to view the files attached to this post.
 
User avatar
Jotne
Forum Guru
Forum Guru
Posts: 3279
Joined: Sat Dec 24, 2016 11:17 am
Location: Magrathean

Re: Torrent blocking working in y2020

Fri Oct 09, 2020 6:30 pm

If you go to some PitateBay proxy or other Torrent site they tell you to not download if you do not use a VPN, and with VPN your rules does not work at all.
 
jeanmichaeltagui
just joined
Posts: 6
Joined: Tue Apr 10, 2018 10:21 am

Re: Torrent blocking working in y2020

Tue Oct 13, 2020 7:33 pm

rules are working for me also. i try to download various torrents with qbittorrent and they dont start. "force encryption" is enabled in qbittorrent options.
just a small remark. in second rule you have to change subnet to match your setup. the photo is after one hour trying to download random torrents.
i am not sure if there are any Concequenses in apps like facetime,viber,whatsapp, tv boxes etc. further testing needed.

/ip firewall filter
add action=add-src-to-address-list address-list=Torrent-Conn \
address-list-timeout=2m chain=forward layer7-protocol=\
layer7-bittorrent-exp src-address=192.168.2.0/24 src-address-list=\
!allow-bit
Yes there are consequences, after applying the rules, i have also notice that it affect whatsapp audio reception and speedtest websites is not working at all......i solved whatsapp issue but not speedtest!
 
jeanmichaeltagui
just joined
Posts: 6
Joined: Tue Apr 10, 2018 10:21 am

Re: Torrent blocking working in y2020

Tue Oct 13, 2020 7:39 pm

rules are working for me also. i try to download various torrents with qbittorrent and they dont start. "force encryption" is enabled in qbittorrent options.
just a small remark. in second rule you have to change subnet to match your setup. the photo is after one hour trying to download random torrents.
i am not sure if there are any Concequenses in apps like facetime,viber,whatsapp, tv boxes etc. further testing needed.

/ip firewall filter
add action=add-src-to-address-list address-list=Torrent-Conn \
address-list-timeout=2m chain=forward layer7-protocol=\
layer7-bittorrent-exp src-address=192.168.2.0/24 src-address-list=\
!allow-bit
After disabling the firewall rules then torrent start seeding, i think it is working for now, !!!!!!! will get you updated when it fails.
You do not have the required permissions to view the files attached to this post.
 
zimkasongo
just joined
Posts: 1
Joined: Sun Jun 21, 2020 1:45 am

Re: Torrent blocking working in y2020

Thu Apr 01, 2021 2:20 am

hi all regarding how to block torrent, I use the below

/ip firewall layer7-protocol
add comment="Block Bit Torrent" name=layer7-bittorrent-exp regexp="^(\\x13bittorrent protocol|azver\\x01\$|get /scrape\\\?info_hash=get /announce\\\?info_hash=|get /client/bitcomet/|GET /data\\\?fid=)|d1:ad2:id20:|\\x08'7P\\)[RP]"

/ip firewall mangle
add action=mark-connection chain=prerouting connection-mark=no-mark dst-address-type=local layer7-protocol=layer7-bittorrent-exp new-connection-mark=torrent_conn passthrough=yes
add action=mark-packet chain=prerouting connection-mark=torrent_conn layer7-protocol=layer7-bittorrent-exp new-packet-mark=torrent_packet passthrough=no

/ip firewall filter
add action=drop chain=forward dst-address-type=local packet-mark=torrent_packet
add action=drop chain=forward content=tracker
add action=drop chain=forward content=info_hash
add action=drop chain=forward content=annonce_peers
add action=drop chain=forward content=getpeers
add action=drop chain=forward content=torrent

it'is working 100%
 
User avatar
Jotne
Forum Guru
Forum Guru
Posts: 3279
Joined: Sat Dec 24, 2016 11:17 am
Location: Magrathean

Re: Torrent blocking working in y2020

Thu Apr 01, 2021 11:06 am

In uTorrent
Options->Prefences->BitTorrent-Protocol Encryption set it to Enabled, then test if your rule still blocks it.
It still blocks encrypted torrent as asked about above?
 
callef
just joined
Posts: 1
Joined: Sat Apr 10, 2021 8:47 pm

Re: Torrent blocking working in y2020

Sat Apr 10, 2021 8:48 pm

how can i use these rules to limit speed instead of blocking?
 
dad2312
Frequent Visitor
Frequent Visitor
Posts: 73
Joined: Sun Nov 17, 2019 12:55 pm

Re: Torrent blocking working in y2020

Sun Apr 11, 2021 11:46 am

hi all regarding how to block torrent, I use the below

/ip firewall layer7-protocol
add comment="Block Bit Torrent" name=layer7-bittorrent-exp regexp="^(\\x13bittorrent protocol|azver\\x01\$|get /scrape\\\?info_hash=get /announce\\\?info_hash=|get /client/bitcomet/|GET /data\\\?fid=)|d1:ad2:id20:|\\x08'7P\\)[RP]"

/ip firewall mangle
add action=mark-connection chain=prerouting connection-mark=no-mark dst-address-type=local layer7-protocol=layer7-bittorrent-exp new-connection-mark=torrent_conn passthrough=yes
add action=mark-packet chain=prerouting connection-mark=torrent_conn layer7-protocol=layer7-bittorrent-exp new-packet-mark=torrent_packet passthrough=no

/ip firewall filter
add action=drop chain=forward dst-address-type=local packet-mark=torrent_packet
add action=drop chain=forward content=tracker
add action=drop chain=forward content=info_hash
add action=drop chain=forward content=annonce_peers
add action=drop chain=forward content=getpeers
add action=drop chain=forward content=torrent

it'is working 100%
don't work for me with utorrent client
 
User avatar
Jotne
Forum Guru
Forum Guru
Posts: 3279
Joined: Sat Dec 24, 2016 11:17 am
Location: Magrathean

Re: Torrent blocking working in y2020

Sun Apr 11, 2021 12:27 pm

As long as the client uses encryption (that can be turned on for utorrent) this does not work.
 
b3h3m07h
newbie
Posts: 40
Joined: Sat Dec 28, 2013 3:06 am

Re: Torrent blocking working in y2020

Thu Jun 03, 2021 8:49 am

I find this set of firewall rules and layer 7 works well with encrypted torrents. Tested with Deluge full encryption and Flud on Android full encryption.

/ip firewall layer7-protocol
add comment="Mikrotik Block Torrent" name=layer7-bittorrent-expp regexp="^(\\x13bittorrent protocol|azver\\x01\$|get /scrape\\\?info_hash=get /announce\\\?info_hash=|get /client/bitcomet/|GET /data\\\?fid=)|d1:ad2:id20:|\\x08'7P\\)[RP]"

/ip firewall filter
add action=jump chain=forward comment="Torrent Blocker" jump-target=forward-torrents-non-allowed-devices out-interface-list=WAN src-address-list=!torrents-allowed-devices
add action=add-src-to-address-list address-list=torrent-connections address-list-timeout=1w chain=forward-torrents-non-allowed-devices comment="Torrent Blocker" layer7-protocol=layer7-bittorrent-expp
add action=add-src-to-address-list address-list=torrent-connections address-list-timeout=1w chain=forward-torrents-non-allowed-devices comment="Torrent Blocker" content=tracker
add action=add-src-to-address-list address-list=torrent-connections address-list-timeout=1w chain=forward-torrents-non-allowed-devices comment="Torrent Blocker" content=info_hash
add action=add-src-to-address-list address-list=torrent-connections address-list-timeout=1w chain=forward-torrents-non-allowed-devices comment="Torrent Blocker" content=annonce_peers
add action=add-src-to-address-list address-list=torrent-connections address-list-timeout=1w chain=forward-torrents-non-allowed-devices comment="Torrent Blocker" content=getpeers
add action=add-src-to-address-list address-list=torrent-connections address-list-timeout=1w chain=forward-torrents-non-allowed-devices comment="Torrent Blocker" content=torrent
add action=return chain=forward-torrents-non-allowed-devices comment="Torrent Blocker"
add action=drop chain=forward comment="Torrent Blocker" dst-port=!53,80,443,110,143,993,995,465,587,8080,8291,3389 protocol=tcp src-address-list=torrent-connections
add action=drop chain=forward comment="Torrent Blocker" dst-port=!53,80,443,110,143,993,995,465,587,8080,8291,3389 protocol=udp src-address-list=torrent-connections

Make sure UPnP is not enabled on the the subnet you wish to block torrents or selectively enabled per IP.
I found that increasing the timeout on src-address-list entries helped alot as some torrent client apps did not trigger/reset the original 2m timeout on the address addition.

You can also add these rules above est-rel connections in addition to the others.

/ip firewall filter
add action=drop chain=forward comment="Torrent Blocker" dst-port=!53,80,443,110,143,993,995,465,587,8080,8291,3389 protocol=tcp src-address-list=torrent-connections
add action=drop chain=forward comment="Torrent Blocker" dst-port=!53,80,443,110,143,993,995,465,587,8080,8291,3389 protocol=udp src-address-list=torrent-connections

Helps to catch already running torrent connections.
 
User avatar
memelchenkov
Member Candidate
Member Candidate
Posts: 202
Joined: Sun Oct 11, 2020 12:00 pm
Contact:

Re: Torrent blocking working in y2020

Thu Jun 03, 2021 9:43 am

Why would you want to do this?
Torrent is illegal where i live,,,,,, if i don't block it then our small ISP will be charge by the internet authority
What's the problem? Pass the court order to the violator, he will pay the fine. Torrents are not illegal. Downloading/uploading copyrighted content is illegal. If you block torrents you will restrict the rights of honest users.
If you are small ISP it's your uplink headache, why bother and why spend resources on it.
 
Machello
newbie
Posts: 27
Joined: Fri Dec 04, 2020 3:22 pm

Re: Torrent blocking working in y2020

Fri Jul 30, 2021 12:01 am

You need to set up Mangle bandwidth control properly and then you can successfully block torrents:

https://www.youtube.com/watch?v=ZK582jEdgIM
https://www.youtube.com/watch?v=B_Jig1RNY40
https://www.youtube.com/watch?v=RUGzdxBSmTU

I put p2p mangle connections and packets marks above http and other connection and packet marks so it gets filtered out first.
A lot of traffic used by BitTorrent can pass thru as other connection/packet marks that is not p2p/layer 7/http. It can still bypass your layer 7 filter rules as a utp connection so you have to drop connection of the client that is not http/layer 7/p2p. The block needs to time out after a while so that those other connections can be unblocked on the client.
 
DarkNate
Forum Veteran
Forum Veteran
Posts: 997
Joined: Fri Jun 26, 2020 4:37 pm

Re: Torrent blocking working in y2020

Fri Jul 30, 2021 10:38 am



Torrent is illegal where i live,,,,,, if i don't block it then our small ISP will be charge by the internet authority
What's the problem? Pass the court order to the violator, he will pay the fine. Torrents are not illegal. Downloading/uploading copyrighted content is illegal. If you block torrents you will restrict the rights of honest users.
If you are small ISP it's your uplink headache, why bother and why spend resources on it.
I fail to understand these local ISPs who first of all has zero certified network engineers and second of all has some strange obsession for torrent blocking which makes no sense in the age of encryption. Aren't they capping bandwidth per customer using simple queues or what?
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11967
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Torrent blocking working in y2020

Fri Jul 30, 2021 10:43 am

It's a ovebooking problem for some ISP...
Have a 50Mbps and try to sell 10Mbps to 100 users...
When 5 of 100 users use torrents, the uplink is full and all users complain...

Also, using NOT WELL CONFIGURED torrent, can cause more incoming packet on gateway than the client have the right to use
and
the client try to transmit on upload more than what pay for, and the traffic reduce bandwidth available on radio link for other users
because the queue are on Gateway and not on CPE.
 
Cablenut9
Long time Member
Long time Member
Posts: 542
Joined: Fri Jan 08, 2021 5:30 am

Re: Torrent blocking working in y2020

Fri Jul 30, 2021 1:56 pm

Have a 50Mbps and try to sell 10Mbps to 100 users...
When 5 of 100 users use torrents, the uplink is full and all users complain...
Then you need to upgrade, because the customers are using what they're paying for.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11967
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Torrent blocking working in y2020

Fri Jul 30, 2021 2:27 pm

Why wait for the update? Better service (for everyone) is good publicity and drives more customers ...
 
Cablenut9
Long time Member
Long time Member
Posts: 542
Joined: Fri Jan 08, 2021 5:30 am

Re: Torrent blocking working in y2020

Fri Jul 30, 2021 2:28 pm

You can also use a VPN which is even harder to block, if you're using SSTP or Wireguard.
 
pe1chl
Forum Guru
Forum Guru
Posts: 10183
Joined: Mon Jun 08, 2015 12:09 pm

Re: Torrent blocking working in y2020

Fri Jul 30, 2021 2:53 pm

It is the usual thing with these rules. It is not difficult to make a rule that blocks all Torrent traffic. What is difficult is making a rule that blocks all Torrent traffic but not anything else.
When I see those L7 rules above I'm sure it blocks all kinds of unrelated traffic and not all Torrent traffic. Which is exactly what the complaints are about.

Who is online

Users browsing this forum: ko00000000001 and 19 guests