# Block Torrents & p2p Traffic 100% working on all versions

**URL:** <https://forum.mikrotik.com/t/block-torrents-p2p-traffic-100-working-on-all-versions/54137>\
**Category:** General\
**Created:** [February 9, 2012, 9:40pm UTC](https://forum.mikrotik.com/t/block-torrents-p2p-traffic-100-working-on-all-versions/54137 "2012-02-09T21:40:15Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![lsavvaid](https://forum.mikrotik.com/letter_avatar/lsavvaid/32/6_449c533f586939b6e5f246632a46421f.png) [@lsavvaid](https://forum.mikrotik.com/u/lsavvaid)\
**Post date:** [February 3, 2014, 7:15pm UTC](https://forum.mikrotik.com/t/block-torrents-p2p-traffic-100-working-on-all-versions/54137/21 "2014-02-03T19:15:13Z")

</div>

> [@estdata](#):
>
> /ip firewall filter  
> add action=drop chain=forward comment="P2P drop " disabled=no p2p=all-p2p  
> add action=drop chain=forward comment=“more connection closed” disabled=no

this rule

add action=drop chain=forward comment=“more connection closed” disabled=no  
  
  
block all traffic my network ( rb433ah , bridge mode)

is correct?

the others works properly

---

<div class="post-metadata">

**Author:** ![lsavvaid](https://forum.mikrotik.com/letter_avatar/lsavvaid/32/6_449c533f586939b6e5f246632a46421f.png) [@lsavvaid](https://forum.mikrotik.com/u/lsavvaid)\
**Post date:** [February 3, 2014, 7:20pm UTC](https://forum.mikrotik.com/t/block-torrents-p2p-traffic-100-working-on-all-versions/54137/22 "2014-02-03T19:20:51Z")

</div>

> [@estdata](#):
>
> /ip firewall filter  
> add action=drop chain=forward comment="P2P drop " disabled=no p2p=all-p2p  
> add action=drop chain=forward comment=“more connection closed” disabled=no

this rule : add action=drop chain=forward comment=“more connection closed” disabled=no

block all traffic my network (rb433ah, bridge wlan1-eth1)

is correct?

all others rules works perfect

---

<div class="post-metadata">

**Author:** ![joshamo](https://forum.mikrotik.com/letter_avatar/joshamo/32/6_449c533f586939b6e5f246632a46421f.png) [@joshamo](https://forum.mikrotik.com/u/joshamo)\
**Post date:** [June 30, 2014, 10:23pm UTC](https://forum.mikrotik.com/t/block-torrents-p2p-traffic-100-working-on-all-versions/54137/23 "2014-06-30T22:23:04Z")

</div>

Hey guys! I have done this, and it works pretty great for what I needed, but I have one question. Is there a way to make it redirect to a website instead of just dropping? I want to tell all customers that it is against ToS to use torrents through a web page. Thanks

---

<div class="post-metadata">

**Author:** ![joshamo](https://forum.mikrotik.com/letter_avatar/joshamo/32/6_449c533f586939b6e5f246632a46421f.png) [@joshamo](https://forum.mikrotik.com/u/joshamo)\
**Post date:** [June 30, 2014, 10:31pm UTC](https://forum.mikrotik.com/t/block-torrents-p2p-traffic-100-working-on-all-versions/54137/24 "2014-06-30T22:31:46Z")

</div>

The only problem I really see with this, is that it blocks things for keywords. Like me making this post, since it has the keywords in it, I have to use a different gateway to post.. Any idea for a way around that?

---

<div class="post-metadata">

**Author:** ![spaxton](https://forum.mikrotik.com/letter_avatar/spaxton/32/6_449c533f586939b6e5f246632a46421f.png) [@spaxton](https://forum.mikrotik.com/u/spaxton)\
**Post date:** [June 9, 2015, 6:11pm UTC](https://forum.mikrotik.com/t/block-torrents-p2p-traffic-100-working-on-all-versions/54137/25 "2015-06-09T18:11:00Z")

</div>

> [@joshamo](#):
>
> Hey guys! I have done this, and it works pretty great for what I needed, but I have one question. Is there a way to make it redirect to a website instead of just dropping? I want to tell all customers that it is against ToS to use torrents through a web page. Thanks

great! This would be very useful!

---

<div class="post-metadata">

**Author:** ![Uqbar](https://forum.mikrotik.com/user_avatar/forum.mikrotik.com/uqbar/32/1501_2.png) [@Uqbar](https://forum.mikrotik.com/u/Uqbar)\
**Post date:** [August 6, 2015, 8:23am UTC](https://forum.mikrotik.com/t/block-torrents-p2p-traffic-100-working-on-all-versions/54137/26 "2015-08-06T08:23:25Z")

</div>

Maybe I am wrong, but the proposed solution blocks the downloads of the .torrent files (GET) from known torrent repositories. This is of course important but not effective.  
But it won’t block the torrent protocol (file sharing) itself. Which is what I’d like to block, as torrent files can be exchanged via email or even through removable media.  
Any idea?

---

<div class="post-metadata">

**Author:** ![Petzl](https://forum.mikrotik.com/letter_avatar/petzl/32/6_449c533f586939b6e5f246632a46421f.png) [@Petzl](https://forum.mikrotik.com/u/Petzl)\
**Post date:** [August 6, 2015, 8:54pm UTC](https://forum.mikrotik.com/t/block-torrents-p2p-traffic-100-working-on-all-versions/54137/27 "2015-08-06T20:54:31Z")

</div>

this even blocks news sites if there is something mentioned about torrents.

this does not work if you use https

---

<div class="post-metadata">

**Author:** ![dunga](https://forum.mikrotik.com/user_avatar/forum.mikrotik.com/dunga/32/563_2.png) [@dunga](https://forum.mikrotik.com/u/dunga)\
**Post date:** [March 22, 2016, 11:03am UTC](https://forum.mikrotik.com/t/block-torrents-p2p-traffic-100-working-on-all-versions/54137/28 "2016-03-22T11:03:42Z")

</div>

> [@javedshotline](#):
>
> Asume you want to block torrent & p2p traffic on 192.168.1.0/24  
> replace ip according to your need  
>   
>   
>   
> /ip firewall layer7-protocol\>  
> use winbox to copy paste name=torrentsites  
> regexp:  
> ^.\*(get|GET).+(torrent|
> 
> thepiratebay|isohunt|entertane|demonoid|btjunkie|mininova|flixflux|
> 
> torrentz|vertor|h33t|btscene|bitunity|bittoxic|thunderbytes|
> 
> entertane|zoozle|vcdq|bitnova|bitsoup|meganova|fulldls|btbot|
> 
> flixflux|seedpeer|fenopy|gpirate|commonbits).\*$  
>   
>   
> /ip firewall filter\>  
> add chain=forward src-address=192.168.1.0/24 layer7-protocol=torrentsites action=drop comment=torrentsites  
> add chain=forward src-address=192.168.1.0/24 protocol=17 dst-port=53 layer7-protocol=torrentsites action=drop comment=dropDNS  
> add chain=forward src-address=192.168.1.0/24 content=torrent action=drop comment=keyword\_drop  
> add chain=forward src-address=192.168.1.0/24 content=tracker action=drop comment=trackers\_drop  
> add chain=forward src-address=192.168.1.0/24 content=getpeers action=drop comment=get\_peers\_drop  
> add chain=forward src-address=192.168.1.0/24 content=info\_hash action=drop comment=info\_hash\_drop  
> add chain=forward src-address=192.168.1.0/24 content=announce\_peers action=drop comment=announce\_peers\_drop
> 
> & also use default rule to drop p2p traffic which alone is not working for me
> 
> add chain=forward src-address=192.168.1.0/24 p2p=all-p2p action=drop comment=p2p\_drop  
>   
>   
> Enjoy 🙂

I just copied this from somewhere in the forum, I want to integrate it with blocking downloading of .mp3, \*.mp4 etc, how will I add this to the l7-layer, is this one correct cus i dont see it catching any traffic

1./ip firewall layer7-protocol  
add name=streaming2 regexp=""^.\*get.+\\.(3gp|mov|mpe|mpeg|mpeg2|mpeg3|mpeg4|mkv|avi|flv|f4v|f4p|f4a  
|f4b|x-flv|msi|wmv|mp2|mp3|mp4|swf|rm|rmvb|vcd|pdf|dat|iso|nrg|bin|cab|vcd|ogg|wma|divx|d2v|qt|0[0-9][0-9])

1. /ip firewall mangle  
add action=mark-packet chain=prerouting comment=“Mark Packet Streaming” disabled=no   
layer7-protocol=streaming new-packet-mark=streaming2 passthrough=no

You can adjust the max-limit to anything higher like 128k  
3. /queue tree add name=“streaming2” parent=global packet-mark=streaming2 limit-at=0 queue=default   
priority=8 max-limit=48k burst-limit=0   
burst-threshold=0 burst-time=0s

---

<div class="post-metadata">

**Author:** ![chechito](https://forum.mikrotik.com/user_avatar/forum.mikrotik.com/chechito/32/1416_2.png) [@chechito](https://forum.mikrotik.com/u/chechito)\
**Post date:** [March 22, 2016, 11:30am UTC](https://forum.mikrotik.com/t/block-torrents-p2p-traffic-100-working-on-all-versions/54137/29 "2016-03-22T11:30:05Z")

</div>

today there is so many ways of using torrent, because that blocking it is a never ending work

the main reason to block torrent is because use too much bandwidth

i think there is no need to block torrent i think is better to properly identify torrent and p2p traffic to give it a lower priority and control the congestion it generates and guarantee the good performance on the other applications

---

<div class="post-metadata">

**Author:** ![Uqbar](https://forum.mikrotik.com/user_avatar/forum.mikrotik.com/uqbar/32/1501_2.png) [@Uqbar](https://forum.mikrotik.com/u/Uqbar)\
**Post date:** [March 24, 2016, 9:32am UTC](https://forum.mikrotik.com/t/block-torrents-p2p-traffic-100-working-on-all-versions/54137/30 "2016-03-24T09:32:39Z")

</div>

I agree with chechito. The only "small problem"™ is to correctly identifying the torrent traffic.  
Blocking the download of the torrent file itself is useless as torrents can be added manually from other sources.  
I think that only Deep Packet Inspection can help.  
Any ideas?

---

<div class="post-metadata">

**Author:** ![chechito](https://forum.mikrotik.com/user_avatar/forum.mikrotik.com/chechito/32/1416_2.png) [@chechito](https://forum.mikrotik.com/u/chechito)\
**Post date:** [March 24, 2016, 3:43pm UTC](https://forum.mikrotik.com/t/block-torrents-p2p-traffic-100-working-on-all-versions/54137/31 "2016-03-24T15:43:51Z")

</div>

> [@Uqbar](#):
>
> I agree with chechito. The only "small problem"™ is to correctly identifying the torrent traffic.  
> Blocking the download of the torrent file itself is useless as torrents can be added manually from other sources.  
> I think that only Deep Packet Inspection can help.  
> Any ideas?

in my case i have identified torrent traffic by discard, detecting another protocols and services usually leave me with torrent on the “unclassified” part of the traffic leaving it with low priority

---

<div class="post-metadata">

**Author:** ![Uqbar](https://forum.mikrotik.com/user_avatar/forum.mikrotik.com/uqbar/32/1501_2.png) [@Uqbar](https://forum.mikrotik.com/u/Uqbar)\
**Post date:** [March 24, 2016, 5:54pm UTC](https://forum.mikrotik.com/t/block-torrents-p2p-traffic-100-working-on-all-versions/54137/32 "2016-03-24T17:54:01Z")

</div>

> [@chechito](#):
>
> in my case i have identified torrent traffic by discard

Do you mean “everything else” (everything but HTTP, HTTPS, SSH, SMTPS, IMAP4S POP3S..) is considered torrent?  
If so, which protocols are you considering?  
If not, please elaborate.  
As I cannot really block P2P in general, I am trying to throttle “everything else”.  
The problem is that outgoing P2P can also go to TCP:80, TCP:443, TCP:53 and UDP:53 and so on…  
In these cases throttling wouldn’t apply. And this is why I am talking about DPI.

---

<div class="post-metadata">

**Author:** ![chechito](https://forum.mikrotik.com/user_avatar/forum.mikrotik.com/chechito/32/1416_2.png) [@chechito](https://forum.mikrotik.com/u/chechito)\
**Post date:** [March 25, 2016, 12:46am UTC](https://forum.mikrotik.com/t/block-torrents-p2p-traffic-100-working-on-all-versions/54137/33 "2016-03-25T00:46:36Z")

</div>

> [@Uqbar](#):
>
> > [@chechito](#):
> >
> > in my case i have identified torrent traffic by discard
> 
> Do you mean “everything else” (everything but HTTP, HTTPS, SSH, SMTPS, IMAP4S POP3S..) is considered torrent?  
> If so, which protocols are you considering?  
> If not, please elaborate.  
> As I cannot really block P2P in general, I am trying to throttle “everything else”.  
> The problem is that outgoing P2P can also go to TCP:80, TCP:443, TCP:53 and UDP:53 and so on…  
> In these cases throttling wouldn’t apply. And this is why I am talking about DPI.

people are using 80 and 443 and 53 or another well known ports because of the blocking, because that is better to throttle than blocking

and with throttle im referencing to give the torrent the possibility of using all the spare bandwidth not throttling it to a ridiculous speeds

Is not perfect but it works in many cases and its free

if some one need better detection of P2P is better to go with an expensive fortigate or another UTM and pay the expensive annual license fee

for example

fortigate 80d recommended for 65mbps of wan channel cost ~750US without services, and ~1.740US with 3 year service subscription that is ~330 US per year of subscription

fortigate 200d recommended for 150mbps of wan channel cost ~2.300US without services, and ~5.200US with 3 year service subscription that is ~960 US per year of subscription

fortigate 600d recommended for 1.100mbps of wan channel cost ~8.000US without services, and ~17.840US with 3 year service subscription that is ~3.280 US per year of subscription

fortigate 1500d recommended for 2.300mbps of wan channel cost ~30.000US without services, and ~66.900US with 3 year service subscription that is ~12.300 US per year of subscription

fortigate 3000d recommended for 6.000mbps of wan channel cost ~60.000US without services, and ~133.800US with 3 year service subscription that is ~24.600 US per year of subscription

---

<div class="post-metadata">

**Author:** ![Uqbar](https://forum.mikrotik.com/user_avatar/forum.mikrotik.com/uqbar/32/1501_2.png) [@Uqbar](https://forum.mikrotik.com/u/Uqbar)\
**Post date:** [March 25, 2016, 6:17am UTC](https://forum.mikrotik.com/t/block-torrents-p2p-traffic-100-working-on-all-versions/54137/34 "2016-03-25T06:17:01Z")

</div>

> [@chechito](#):
>
> > [@Uqbar](#):
> >
> > > [@chechito](#):
> > >
> > > in my case i have identified torrent traffic by discard
> > 
> > Do you mean “everything else” (everything but HTTP, HTTPS, SSH, SMTPS, IMAP4S POP3S..) is considered torrent?  
> > If so, which protocols are you considering?  
> > If not, please elaborate.  
> > As I cannot really block P2P in general, I am trying to throttle “everything else”.  
> > The problem is that outgoing P2P can also go to TCP:80, TCP:443, TCP:53 and UDP:53 and so on…  
> > In these cases throttling wouldn’t apply. And this is why I am talking about DPI.
> 
> people are using 80 and 443 and 53 or another well known ports because of the blocking, because that is better to throttle than blocking
> 
> and with throttle im referencing to give the torrent the possibility of using all the spare bandwidth not throttling it to a ridiculous speeds
> 
> Is not perfect but it works in many cases and its free
> 
> if some one need better detection of P2P is better to go with an expensive fortigate or another UTM and pay the expensive annual license fee
> 
> for example
> 
> fortigate 80d recommended for 65mbps of wan channel cost ~750US without services, and ~1.740US with 3 year service subscription that is ~330 US per year of subscription
> 
> fortigate 200d recommended for 150mbps of wan channel cost ~2.300US without services, and ~5.200US with 3 year service subscription that is ~960 US per year of subscription
> 
> fortigate 600d recommended for 1.100mbps of wan channel cost ~8.000US without services, and ~17.840US with 3 year service subscription that is ~3.280 US per year of subscription
> 
> fortigate 1500d recommended for 2.300mbps of wan channel cost ~30.000US without services, and ~66.900US with 3 year service subscription that is ~12.300 US per year of subscription
> 
> fortigate 3000d recommended for 6.000mbps of wan channel cost ~60.000US without services, and ~133.800US with 3 year service subscription that is ~24.600 US per year of subscription

So, was I right?  
I mean, do you simply throttle “everything else” but a bunch of “well known useful protocols”?

---

<div class="post-metadata">

**Author:** ![chechito](https://forum.mikrotik.com/user_avatar/forum.mikrotik.com/chechito/32/1416_2.png) [@chechito](https://forum.mikrotik.com/u/chechito)\
**Post date:** [March 25, 2016, 3:15pm UTC](https://forum.mikrotik.com/t/block-torrents-p2p-traffic-100-working-on-all-versions/54137/35 "2016-03-25T15:15:54Z")

</div>

> [@Uqbar](#):
>
> So, was I right?  
> I mean, do you simply throttle “everything else” but a bunch of “well known useful protocols”?

yes i priorize traffic in this order:

tcp ack packets, dns, icmp, udp traffic whit characteristics matching most voip and gaming apps, vpns, rdp, http small traffic connections, http big traffic connections, mail connections, other udp tcp small traffic connections.

the remaining traffic are other tcp and udp connections with big traffic, torrent transfer get on this category

---

<div class="post-metadata">

**Author:** ![loveman](https://forum.mikrotik.com/letter_avatar/loveman/32/6_449c533f586939b6e5f246632a46421f.png) [@loveman](https://forum.mikrotik.com/u/loveman)\
**Post date:** [June 5, 2016, 8:27pm UTC](https://forum.mikrotik.com/t/block-torrents-p2p-traffic-100-working-on-all-versions/54137/36 "2016-06-05T20:27:15Z")

</div>

add chain=forward src-address=192.168.1.0/24 p2p=all-p2p action=drop comment=p2p\_drop  
  
  
not working  
buz i need to drop “psiphon vpn” from server ,

how can drop that p2p buz drop vpn?

---

<div class="post-metadata">

**Author:** ![djeniuss](https://forum.mikrotik.com/letter_avatar/djeniuss/32/6_449c533f586939b6e5f246632a46421f.png) [@djeniuss](https://forum.mikrotik.com/u/djeniuss)\
**Post date:** [February 7, 2017, 12:32pm UTC](https://forum.mikrotik.com/t/block-torrents-p2p-traffic-100-working-on-all-versions/54137/37 "2017-02-07T12:32:21Z")

</div>

I have tried all the methods posted above and torrents still download.I am new to Mikrotik. Please help

---

<div class="post-metadata">

**Author:** ![Uqbar](https://forum.mikrotik.com/user_avatar/forum.mikrotik.com/uqbar/32/1501_2.png) [@Uqbar](https://forum.mikrotik.com/u/Uqbar)\
**Post date:** [February 7, 2017, 1:01pm UTC](https://forum.mikrotik.com/t/block-torrents-p2p-traffic-100-working-on-all-versions/54137/38 "2017-02-07T13:01:22Z")

</div>

I started by dropping all incoming TCP and UDP traffic (all of it) but those services that go to DMZ.  
So there’s no traffic going to LAN, which means “low ID” in the P2P lingo.

Then I started throttling (I’d like to drop, actually) all outgoing traffic from LAN with UDP ports other than 53 (DNS) and 123 (NTP) and TCP ports higher than 1023.

My situation is much better now, while still not completely closing P2 traffic.

---

<div class="post-metadata">

**Author:** ![fiery2](https://forum.mikrotik.com/letter_avatar/fiery2/32/6_449c533f586939b6e5f246632a46421f.png) [@fiery2](https://forum.mikrotik.com/u/fiery2)\
**Post date:** [November 12, 2017, 2:26am UTC](https://forum.mikrotik.com/t/block-torrents-p2p-traffic-100-working-on-all-versions/54137/39 "2017-11-12T02:26:12Z")

</div>

This thread is somewhat old but gold.  
On theory,wouldnt it any better if we throthle or drop connection exceed certain threshold?  
Afterall,nobody but the most determined user would download torrent with low seed/peer per downloaded file?

---

<div class="post-metadata">

**Author:** ![Jotne](https://forum.mikrotik.com/user_avatar/forum.mikrotik.com/jotne/32/56097_2.png) [@Jotne](https://forum.mikrotik.com/u/Jotne)\
**Post date:** [November 12, 2017, 7:40am UTC](https://forum.mikrotik.com/t/block-torrents-p2p-traffic-100-working-on-all-versions/54137/40 "2017-11-12T07:40:22Z")

</div>

You can throttle download traffic, but you cant separate download from a web site and download from a p2p site, so you would throttle all download.  
When p2p traffic is encrypted, it blends inn to normal traffic.

[Previous page](https://forum.mikrotik.com/t/block-torrents-p2p-traffic-100-working-on-all-versions/54137.md?page=1)

[Next page](https://forum.mikrotik.com/t/block-torrents-p2p-traffic-100-working-on-all-versions/54137.md?page=3)
