Mikrotik Limit Youtube and All Download and Unlimit Browsing

At the Mikrotik router firewall layer 7 levels, we will now see how to restriction youtube or all downloads.

Code is written in the new terminal winbox. Restrictions are made in layer 7 on the firewall side.

Here is a code:

/ip firewall layer7-protocol
add name=L7-Youtube regexp=youtube.com|googlevideo.com

/ip firewall mangle
add action=mark-connection chain=prerouting connection-bytes=\
262146-4294967295 in-interface=ether1-gateway new-connection-mark=\
All_Download protocol=tcp src-port=21,80
add action=mark-packet chain=prerouting connection-mark=All_Download \
in-interface=ether1-gateway new-packet-mark=All_Download passthrough=no
add action=mark-packet chain=forward comment=youtube layer7-protocol=\
L7-Youtube new-packet-mark=Youtube-Packet

/queue simple
add max-limit=3M/3M name=Youtube packet-marks=Youtube-Packet queue=\
default/default target=""
add max-limit=1M/1M name=Download packet-marks=All_Download queue=\
default/default target=""

Let’s see how to apply speed limit to youtube in winbox without code in Mikrotik router firewall.

I hope it has been a useful article.