How to Block any Website in MikroTik Using Layer 7 Protocols. MikroTik is an internet firewall which operating system based on the Linux kernel. there is two type of MikroTik:
- MikroTik Router OS
- MikroTik RouterBoard
There is two way to block the website in MikroTik:
- Using Proxy Server
- Layer 7 Protocol
Today I will show you How to Block Any Website in MikroTik Using Layer 7 Protocols.
Method 1: I will block website facebook Using Winbox Connect MikroTik:
- Open Winbox and connect to your MikroTik using MAC Address
- In the box go to IP => Firewall => Layer 7 Protocols Click on + and insert Name: Block Any Website. Or You can insert any name you want. Regexp: you just insert this regular expression ^(.*)(facebook)(.*)$
Note: if you want to block more website you just add |(website name) you website name must without protocols and extension. Example: https://www.facebook.com so you just insert facebook only.
after you already add regular expression click OK.
- Go to IP => Firewall => Filter Rules and then Click + and Chain Select forward
- Click on Advanced Tab => Layer 7 Protocols: Please Select Block Any Website
- Go to Action Tab => Action: Select drop and click OK to finish Rules Setup.
Method 2: I will block website facebook Using Command Line in MikroTik:
- Login to Winbox New Terminal and Copy Script 2 and 3 and paste in Terminal
- /ip firewall layer7-protocol add name=” Block Any Website” regexp=” ^(.*)(facebook)(.*)\$”
- /ip firewall filter add chain=forward action=drop layer7-protocol=”Block Any Website”
Note: regexp=”^(.*)(facebook)(.*)$” this regular expression is block only one website. if need to block more website you just add