To create Layer 7 Protocols (L7P) in the firewall and use them to block specific websites, follow the steps below.
Click the + (blue icon) to open the New Firewall Layer 7 Protocol window.
In the Name field, enter a unique name for your script. Like Block Websites
In the Regexp (Regular Expression) field, input the pattern for the website you wish to block.
/.*youtube|ibomma|udemy|nyaa.si|utorrent|instagram|torrentgalaxy|yts.mx|telegram|movierulz.*/gm
Click Apply and OK to save your L7 Protocol.
To activate the Layer 7 Protocols you have created:
With these steps, you can effectively create and implement custom Layer 7 Protocol rules to restrict access to designated websites through the firewall.
Now that the L7P script has been created, you can proceed to create filter rules to apply this script. Follow these steps:
This will prevent access to Facebook or any other specified website on your PC.
Note: All users attempting to access the URL defined in the L7P script (in the Advanced tab) will be forwarded (Chain: Forward) and have their actions blocked (Action: Drop).
This is the method we are following to block a website in MikroTik. Another methods also exists!