How to block Website in Mikrotik Router OS from Winbox [URL & Keywords]

The simple way to restrict unusual and pornography sites on your Mikrotik router using Firewall filtering rules. Read the full post to know how to use firewall policy to protect network using Mikrotik routers. see here quick user guide for block Website in Mikrotik Router OS from Winbox for beginners.

How to block Website in Mikrotik Router OS from Winbox [URL & Keywords]

Mikrotik router OS one of my favorite device to play with it. If you love to play in networking then you may also like the Mikrotik Router OS because of it’s all in one router software. In this post I am going to share the best feature of Mikrotik firewall filter rules to protect the internet and block any website like Facebook, YouTube. I have already posted several tutorials about Miktorik Hotspot configuration and Mikrotik Hotspot Page design to personalize your login page for your business and brand. In this post, you will get a detailed configuration guide to block any unwanted website using layer7 protocol and MikroTik Firewall filter rule from Winbox software.

There is no direct URL and content filtering option available like other firewalls and routers. But there is a complete firewall feature that allows you to block IP address, Mac address, URL, and website keywords as well. You should be familiar with router OS to using firewall filtering rules proper and not only block the website but also protect the unauthorized access from outside networks. Mikrotik firewall is a powerful feature and tool to manage all the network access and blocking such as port block, WAN IP blocks, access from different networks and many more. If you are using the Mikrotik Hotspot login page and looking to block YouTube, Facebook page, WhatsApp and any other sites which may waste your time during office hours.

It is not necessary to use Hotspot in Mikrotik to block both types of HTTP and HTTPS websites. The website blocking is the part of layer 7 firewall rules and also can be blocked using the Mikrotik web proxy server. So enjoy the quick user manual to know How to block the Website in Mikrotik Router OS from Winbox.

Read Also:

Block YouTube, Facebook, and other websites in Mikrotik Router

To use the content filtering feature in Router OS your Mikrotik device should in router mode and configured with the internet connection using WAN port. Follow the steps to block the Website in Mikrotik Router OS from Winbox.

 

Step1: Connect Router and Login in Winbox Utility.

Just open your router in Winbox via mac address or IP address to manage the firewall rules in your router.

block website mikrotik winbox

Step2: Now you have to go to Mikrotik firewall settings option in router OS.

From the left side, menu Go to IPFirewall  (ref below image)

 mikrotik маршрутизатор блок сайтів facebook і youtube

Step3: Create the Mikrotik Firewall Website block Rules.

Now to block any website using address and keyword needs to create firewall filtering rules.

There is two part of configuring content filtering in router OS to restrict Facebook, YouTube and other sites.

  • Configure the Layer 7 Protocols
  • Creating Filter Rules

 

1: Layer 7 Protocols Rule Create

Under the Layer 7 option, we create the site URL, Keyword using regular expressions used in Router OS RegExp. Here you can add the website complete URL which you want to block in your networks.

Here I use block Facebook to restrict in my location networks.

  1. Under Firewall find the Layer 7 Protocols in the last tab
  2. Name- type the name you want to give the URL/website going to block.
  3. RefExp – Under Regexp text box type the website name you want to block in your networks.

block website from mikrotik router using web proxy

Note: please use the prefix expression to completely block any website using keywords, URL, and through IP address and a single character.

Layer 7 Firewall – Regular Expression

The expression rules help you to bypass any particular keywords and website you want to only work and others all block. Read the complete expression table to understand blocking rules.

.*(facebook)+.*  (  it will also block all the website content Facebook keywords so hard to unblock Facebook through any third party proxy sites)

 mikrotik website block time schedule

Download website block user manual in pdf

Read more:

2: Creating Filter Rules

Now set the URL filtering rules to block the desired website you have added in Regexp table.

Filter rules itself having 3 parts.

  • New filter Rules
  • Advance (Layer 7 Protocol )
  • Action ( to drop the URL)

 

1: Add New Filter Rules

Now go to the first tab “Filter Rules”

Press the plus (+) button to add new rules

General tab – Chain: Forward

Press the Apply button and move to next steps “Advanced”

 block website in mikrotik hotspot

2: Advance (Layer 7 Protocol)

Now go to “Advanced” tab next to filter rules.

Layer 7 Protocol:  select the website you want to block from the list you have created under Layer 7 tab in first steps.

Press Apply and move to Action tab.

mikrotik block facebook

3: Action

This option will let you choose you to want to accept and drop the website you have added in Layer 7 protocols.

Action: Press the down arrow button and choose the “drop” option and press the Apply button.

mikrotik web proxy https

After finish, this setting your filter rules should show Red Cross as shown in below image.

 mikrotik block websites by url

How to Block Website in Mikrotik WAN source IP address

You can also direct block websites in the source IP address of your internet using simply adding your WAN ip to filter rules with forwarding options.

Chain- Forward

Src Address: add your WAN IP address network id here to restrict website in WAN IP itself.

Follow the Advanced, Action settings as done in the above steps as it is.

mikrotik filter rules

After block Website in Mikrotik Router OS from Winbox, you may be required to unblock some websites for personal use. so also know the unblock websites in MikroTik router using winbox in the below steps.

How to unblock website in Mikrotik router from Firewall

After blocking the website if you wish to unblock any website you have to restrict firewall rules. Just follow the steps to unblock sites.

  1. Go to IP-Firewall
  2. Filter Rules
  3. Open the filter rules you have the drop to block the website.
  4. Go to Action tab and change the Action – accept
  5. Press Apply button

mikrotik firewall setup for port block

Check your website should unblock and start working

 Conclusion:

Using the firewall and content filtering is the best way to protect your network from hackers attack and spams and fishing sites. It also provides you a parental control to protect visiting unusual sites. Although blocking a website in Mikrotik routerboard can be done using multiple ways, like web proxy filter, firewall rules, layer 7 protocols. Hope this post “block Website in Mikrotik Router OS from Winbox” easily untestable and helpful you to secure your Mikrotik router from attackers.

 

Related Post: