I have a MikroTik router. I want to allow only Youtube videos and block all other videos. I tried to write an extended ACL but I really have no idea. Maybe allow only Youtube videos source URL and block other URLs? Can you guys help me?
-
3This is going to be an incredibly difficult, if not impossible task to accomplish. Why would you like to do that?– user163495Oct 29, 2019 at 10:39
-
2Let me guess: you want to block porn? If so, there are many, many other better ways to do that.– schroeder ♦Oct 29, 2019 at 10:47
-
There's porn on YouTube anyways, so this isn't a very good way to stop people from looking at it.– userOct 29, 2019 at 13:05
-
@user yes, but Google has controls to block that.– schroeder ♦Oct 29, 2019 at 13:09
-
@schroeder If the question author is concerned about blocking sites at the router level then I'm pretty sure that the network users can bypass local restrictions.– userOct 29, 2019 at 13:27
2 Answers
As Far As I know, you have 3 choices:
- You can use URL filtering by allowing "youtube" or any URLs in the MikroTik firewall in the layer7 protocol field and deny the other specifically or deny all as that link shows.
- You can use content filtering to block Adult WebSites in your MikroTik.
- You can use proxy servers such as Squid for URL filtering.
There is also another solution that may help you, you can monitor your network NetFlow Traffic and find out what is exactly going on, on your network and based on that you can provide a good and suitable solution for issue.
You can read a detailed article at the squid-cache wiki: https://wiki.squid-cache.org/EliezerCroitoru/Drafts/YouTubeFiltering
Technically you will need to use the next REGEX to block or allow a specific video. To define a policy you will need to use some wildcard match at the end of the policy in the Proxy/firewall.
(^|.*\.)youtube\.com/embed/##VID##
(^|.*\.)youtube\.com/watch\?v=##VID##
(^|.*\.)ytimg\.com/.*/##VID##/
(^|.*\.)youtu\.be/.*##VID##.*