Saturday, July 9, 2016

limit youtube speed on mikrotik using layer7

1- add layer7 regex
/ip firewall layer7-protocol add name=youtube regexp="^.+(youtube.com).*"

/ip firewall layer7-protocol add name=youtubes regexp="^.+(googlevideo.com).*"



2- mark packets that match our layer7
 /ip firewall mangle add chain=prerouting action=mark-packet new-packet-mark=youtubep1 passthrough=yes layer7-protocol=youtubes log=no log-prefix="" 

 /ip firewall mangle add chain=prerouting action=mark-packet new-packet-mark=youtubep1 passthrough=no layer7-protocol=youtube log=no log-prefix=""



3- add queue for individual host that you want to set the limit, example host 192.168.1.23 with 1M/1M
/queue simple add name="client1" target=192.168.1.23/32 parent=none packet-marks=youtubep1 priority=8/8 queue=default/default limit-at=0/0 max-limit=1M/1M burst-limit=0/0 burst-threshold=0/0 burst-time=0s/0s bucket-size=0.1/0.1

No comments:

Post a Comment