Page 1 of 1

Download limit for websites like youtube, rapidshare etc.

Posted: Sun Sep 11, 2011 3:14 pm
by amit22004
I am using pppoe on Mikrotik 3.20.
I want limit speed for Youtube, rapidshare or all possible websites.
can anybody can help me to do this.
I tried so many rules in mangle and queues but I am not able to limit.


:( :( :(

Re: Download limit for websites like youtube, rapidshare etc

Posted: Mon Sep 12, 2011 9:57 pm
by heleopless
try this
this ill help you limit youtube download

/ip firewall layer7-protocol
add comment="" name="YouTube Download" regexp=videoplayback

add action=mark-connection chain=prerouting comment="youtube DOWNS" disabled=no layer7-protocol="YouTube Download" new-connection-mark="youtube DOWNS" passthrough=yes protocol=tcp
add action=mark-packet chain=postrouting comment="" connection-mark="youtube DOWNS" disabled=no new-packet-mark=youtube passthrough=no protocol=tcp


/queue type
set default-small kind=pcq name=default-small pcq-classifier=src-address,dst-address,src-port,dst-port pcq-limit=50 pcq-rate=0 pcq-total-limit=2000

/queue tree
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=512K name=queue1 packet-mark=youtube parent=global-out priority=8 queue=default-small



in this code it is limited by 512k you can change it to what you want

Re: Download limit for websites like youtube, rapidshare etc

Posted: Thu Oct 25, 2012 10:25 am
by nazzeem
Does this work? How does it know the bandwidth used comes from Youtube?
try this
this ill help you limit youtube download

/ip firewall layer7-protocol
add comment="" name="YouTube Download" regexp=videoplayback

add action=mark-connection chain=prerouting comment="youtube DOWNS" disabled=no layer7-protocol="YouTube Download" new-connection-mark="youtube DOWNS" passthrough=yes protocol=tcp
add action=mark-packet chain=postrouting comment="" connection-mark="youtube DOWNS" disabled=no new-packet-mark=youtube passthrough=no protocol=tcp


/queue type
set default-small kind=pcq name=default-small pcq-classifier=src-address,dst-address,src-port,dst-port pcq-limit=50 pcq-rate=0 pcq-total-limit=2000

/queue tree
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=512K name=queue1 packet-mark=youtube parent=global-out priority=8 queue=default-small



in this code it is limited by 512k you can change it to what you want

Re: Download limit for websites like youtube, rapidshare etc

Posted: Thu Oct 25, 2012 12:14 pm
by Discus
It works by examining the packets for Layer7 traffic containing "videoplayback" (which youtube uses) and then assigning packet marks based on this which are then used in the queues to limit traffic.

You may find (if you have space/computer lying about the place) that squid offers more power for this kind of thing.