fbpx

Can MikroTik firewall block specific pages?

Domain blocking can be done using address list first so that the domain names can be resolved and those address lists can be converted into a rule that allows blocking clients who would like to go to those pages.

The MikroTik RouterOS firewall is capable of blocking access to specific web pages using various techniques. This type of filtering is usually done through the firewall rules in the Layer 7 Protocol (Layer 7 Protocol) and/or DNS address filtering. Here I explain how:

Locking via Layer 7 (L7) Protocol

This technique involves creating a Layer 7 Protocol rule that identifies traffic to the specific web page you want to block and then applying a firewall rule that uses this classification to block the traffic.

  1. Create a Layer 7 Protocol Rule:
    • Go to IPFirewallLayer7 Protocols and click + to add a new rule.
    • In the countryside Name, give it an identifying name.
    • In the countryside Regexp, enter a regular expression that matches the domain name of the web page. For example, ^.+(example\.com).*\$ to block “example.com”.
  2. Create a Firewall Rule:
    • Go to IPFirewallFilter Rules and add a new rule.
    • Set the Chain in “forward”.
    • En Advanced, set the Layer7 Protocol to the name of the rule you created.
    • En Action, select “drop” to block traffic.

Blocking via DNS Filtering

DNS filtering is another effective technique, especially useful for blocking all addresses associated with a domain name. This is done by intercepting DNS requests for the specific domain and preventing them from being resolved correctly.

  1. Configure Static DNS:
    • Go to IPDNSStatic and add a new record.
    • In the countryside Name, enter the domain name you want to block.
    • In the countryside Address, you can enter an invalid IP address (such as “0.0.0.0”) or the address of a warning page if you have one configured.

Considerations

  • Effectiveness: These methods may not be effective against all encrypted (HTTPS) traffic without also intercepting SSL traffic, which requires additional configuration and privacy and security considerations.
  • Maintenance: Domain names and IP addresses may change. Blocklists may need regular updates to remain effective.
  • Privacy & Security: Intercepting and filtering HTTPS traffic to block specific sites involves decrypting the traffic, which raises important privacy and security considerations and requires user consent.

The MikroTik firewall offers a powerful tool for network administrators seeking to control and restrict access to specific content on the network, although it should always be used responsibly and in accordance with applicable privacy and security policies.

There are no tags for this post.
Did this content help you?
Facebook
Twitter
LinkedIn
WhatsApp
Telegram

Other documents in this category

Leave your comment

Your email address will not be published. Required fields are marked with *

Tutorials available at MikroLABs

No Courses Found!

DISCOUNT CODE

AN24-LIB

applies to MikroTik books and book packs

Days
Hours
Minutes
Seconds

Introduction to
OSPF - BGP - MPLS

Sign up for this Free course

MAE-RAV-ROS-240118
Days
Hours
Minutes
Seconds

Sign up for this Free course

MAS-ROS-240111

Promo for Three Kings Day!

KINGS24

15%

all the products

MikroTik courses
Academy courses
MikroTik books

Take advantage of the Three Kings Day discount code!

* promotion valid until Sunday January 7, 2024
** the code (KINGS24) applies to shopping cart
*** buy your course now and take it until March 31, 2024

New Year's Eve Promo!

NY24

20%

all the products

MikroTik courses
Academy courses
MikroTik books

Take advantage of the New Year's Eve discount code!

* promotion valid until Monday, January 1, 2024
** the code (NY24) applies to shopping cart
*** buy your course now and take it until March 31, 2024

Christmas discounts!

XMAS23

30%

all the products

MikroTik courses
Academy courses
MikroTik books

Take advantage of the discount code for Christmas!!!

**codes are applied in the shopping cart
Promo valid until Monday December 25, 2023

CYBER WEEK DISCOUNTS

CW23-MK

17%

all MikroTik OnLine courses

CW23-AX

30%

all Academy courses

CW23-LIB

25%

all MikroTik Books and Book Packs

Take advantage of the discount codes for Cyber ​​Week!!!

**codes are applied in the shopping cart
Promo valid until Sunday December 3, 2023

BLACK FRIDAY DISCOUNTS

BF23-MX

22%

all MikroTik OnLine courses

BF23-AX

35%

all Academy courses

BF23-LIB

30%

all MikroTik Books and Book Packs

Take advantage of the discount codes for Black Friday!!!

**Codes are applied in the shopping cart

codes are applied in the shopping cart
valid until Sunday November 26, 2023

Days
Hours
Minutes
Seconds

Sign up for this Free course

MAE-VPN-SET-231115

Halloween promo

Take advantage of discount codes for Halloween.

Codes are applied in the shopping cart

HW23-MK

11% discount on all MikroTik OnLine courses

11%

HW23-AX

30% discount on all Academy courses

30%

HW23-LIB

25% discount on all MikroTik Books and Book Packs

25%

Register and participate in the free course Introduction to Advanced Routing with MikroTik (MAE-RAV-ROS)

Today (Wednesday) October 11, 2023
7pm to 11pm (Colombia, Ecuador, Peru)

MAE-RAV-ROS-231011