{"id":9669,"date":"2022-09-09T10:53:02","date_gmt":"2022-09-09T08:53:02","guid":{"rendered":"https:\/\/knowal.sfida.me\/blocking-youtube-traffic-on-mikrotik-without-the-use-of-layer-7-protocol\/"},"modified":"2022-09-09T11:22:43","modified_gmt":"2022-09-09T09:22:43","slug":"blocking-youtube-traffic-on-mikrotik-without-the-use-of-layer-7-protocol","status":"publish","type":"post","link":"https:\/\/know.al\/en\/blocking-youtube-traffic-on-mikrotik-without-the-use-of-layer-7-protocol\/","title":{"rendered":"Blocking Youtube traffic on MikroTik without the use of Layer 7 Protocol"},"content":{"rendered":"<p>In this lesson, we will show how you can on <strong>MikroTik<\/strong> block <strong>YouTube<\/strong> traffic without you use<strong> Layer 7<\/strong> protocol. Why without <strong>Layer 7<\/strong> regular expression? Because <strong>Layer 7<\/strong> is to heavy on your router resources like CPU and memory as for each packet the Firewall on the router is inspecting the<strong> Layer 7<\/strong> and that&#8217;s not the best and will cause on heavy traffic usage a lot of packet drops.<\/p>\n<p>So what I am going to use instead is the<strong> TLS Host<\/strong>. That feature is available on <strong>MikroTik RouterOS<\/strong> since version&nbsp;<strong>6.41<\/strong>&nbsp;so why not to profit from using it. I have made my homework and find out what is the best <strong>TLS host<\/strong> to use for <strong>YouTube<\/strong> Traffic. Other applications, for example Facebook has other <strong>TLS Host.<\/strong><\/p>\n<h6>So let me start showing you about the configuration that you need to do on the MikroTik Router to block the YouTube Traffic.<\/h6>\n<h6>First let&#8217;s open a YouTube video on the PC.<\/h6>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-7355\" src=\"https:\/\/know.al\/wp-content\/uploads\/2020\/08\/FilterRuleYoutube1.png\" alt=\"\" width=\"1271\" height=\"933\"><\/p>\n<h6>Now let&#8217;s start doing the work on the MikroTik Router.<\/h6>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-7357\" src=\"https:\/\/know.al\/wp-content\/uploads\/2020\/08\/FilterRuleYoutube2.png\" alt=\"\" width=\"1858\" height=\"751\"><\/p>\n<p>So I made a filter rule on the chain Forward because the traffic is passing via the router to the internet and I have put on the Src. Address my LAN Network ID (If you have another Network ID then put yours). Then <strong>Youtube<\/strong> traffic is all based on TCP port 443 so I have put them. Then on advance you have to only write on the tls host this regular expression *youtube*. Finally, as <strong>Youtube<\/strong> has many servers so I wanted to collect all of them and put them in an address list for 30 days, and that&#8217;s what I have done on the action.<\/p>\n<h6>Now the next stop is to apply a rule to drop everything which is in the address list.<\/h6>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-7359\" src=\"https:\/\/know.al\/wp-content\/uploads\/2020\/08\/FilterRuleYoutube3.png\" alt=\"\" width=\"1268\" height=\"810\"><\/p>\n<h6>So I have created a 2nd filter rule saying that all what I have in the Dst Address list Youtube will be dropped.<\/h6>\n<p>I have made already some traffic to collect the YouTube servers in the address list, and here is the result inside the address list:<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-7361\" src=\"https:\/\/know.al\/wp-content\/uploads\/2020\/08\/FilterRuleYoutube4.png\" alt=\"\" width=\"587\" height=\"351\"><\/p>\n<p>You can see that many YouTube servers addresses have been collected and they will stay for 30 days inside the address list. All Traffic to those YouTube servers will be dropped from my <strong>MikroTik<\/strong> Router.<\/p>\n<h6>Let&#8217;s open a YouTube video again:<\/h6>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-7363\" src=\"https:\/\/know.al\/wp-content\/uploads\/2020\/08\/FilterRuleYoutube5.png\" alt=\"\" width=\"624\" height=\"456\"><\/p>\n<p>You can see that the <strong>YouTube<\/strong> page is not opening. Same if you do from the smart phone application, it will not work.<\/p>\n<h6><strong><u>Conclusion:<\/u><\/strong><\/h6>\n<p>Blocking YouTube on <strong>MikroTik<\/strong> can be challenge. Most of people use<strong> Layer 7<\/strong> protocol to block it but then this is too heavy on the <strong>MikroTik<\/strong> router. In this way, I have showed you using the<strong> TLS host<\/strong> how you can collect the servers of YouTube and then you apply a drop filter rule on all traffic going to those server.<\/p>\n<h4>If you would like to learn more and certify your knowledge in MikroTik, don\u2019t hesitate to contact us and participate in our trainings. Thank you!<\/h4>\n","protected":false},"excerpt":{"rendered":"<p>In this lesson, we will show how you can on MikroTik block YouTube traffic without you use Layer 7 protocol. Why without Layer 7 regular expression? Because Layer 7 is to heavy on your router resources like CPU and memory as for each packet the Firewall on the router is inspecting the Layer 7 and [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":9677,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_seopress_robots_primary_cat":"","footnotes":""},"categories":[26],"tags":[],"class_list":["post-9669","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","post-wrapper","thrv_wrapper"],"_links":{"self":[{"href":"https:\/\/know.al\/en\/wp-json\/wp\/v2\/posts\/9669","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/know.al\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/know.al\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/know.al\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/know.al\/en\/wp-json\/wp\/v2\/comments?post=9669"}],"version-history":[{"count":0,"href":"https:\/\/know.al\/en\/wp-json\/wp\/v2\/posts\/9669\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/know.al\/en\/wp-json\/wp\/v2\/media\/9677"}],"wp:attachment":[{"href":"https:\/\/know.al\/en\/wp-json\/wp\/v2\/media?parent=9669"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/know.al\/en\/wp-json\/wp\/v2\/categories?post=9669"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/know.al\/en\/wp-json\/wp\/v2\/tags?post=9669"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}