How to block Facebook, Twitter, Youtube on Mikrotik

In case you want to block access to Facebook, Twitter, Youtube or other websites, it is easy to do this job on Mikrotik RouterOS. You can use either web proxy or directly from firewall rule to block websites.

According to Mikrotik Wiki, you can block users from accessing websites using content option in Mikrotik Firewall rule. One rule per content you want to block. So if you want to block, for example, Facebook, Youtube, and Twitter, you have to create rule for each content.

Here’s I show you how to block websites (e.g. Facebook, Youtube, and Twitter) using Firewall Rule in Mikrotik RouterOS. Change the src-address value to the source of IP addresses you want to block.

Drop Access to Facebook

/ip firewall filter add chain=forward src-address=192.168.1.0/24 protocol=tcp 
dst-port=80 content="facebook" action=drop comment="Block Facebook HTTP"

/ip firewall filter add chain=forward src-address=192.168.1.0/24 protocol=tcp 
dst-port=443 content="facebook" action=drop comment="Block Facebook HTTPS"

Drop Access to Youtube

/ip firewall filter add chain=forward src-address=192.168.1.0/24 protocol=tcp 
dst-port=80 content="youtube" action=drop comment="Block Youtube HTTP"

/ip firewall filter add chain=forward src-address=192.168.1.0/24 protocol=tcp 
dst-port=443 content="youtube" action=drop comment="Block Youtube HTTPS"

Drop Access to Twitter

/ip firewall filter add chain=forward src-address=192.168.1.0/24 protocol=tcp 
dst-port=80 content="twitter" action=drop comment="Block Twitter HTTP"

/ip firewall filter add chain=forward src-address=192.168.1.0/24 protocol=tcp 
dst-port=443 content="twitter" action=drop comment="Block Twitter HTTPS"

Now try to access those website above. If the above rules work properly, you should not be able to access those website now.