fbpx

Can you create rules for incoming Wi-Fi connections, so that they can only make WhatsApp calls on a MikroTik router?

The Mikrotik firewall is layer 3 and layer 4, we can make certain configurations at layer 7 but not all of them will work. In this case, we would have to identify ports and protocols to dial WhatsApp calls, but this does not guarantee that the dialing will work.

You can configure rules on a MikroTik router to limit incoming Wi-Fi connections so that only WhatsApp calls are allowed. This is achieved using the firewall capabilities of the MikroTik router, specifically through the Layer7 Protocol and mangle rules.

Although WhatsApp uses various IP ranges and ports for its services, and these may change, it is possible implement an approach For this purpose.

To make a configuration that attempts to limit traffic to only WhatsApp calls, you would need to follow these general steps:

1. Identify the IP Addresses and Ports Used by WhatsApp

WhatsApp uses a variety of IP addresses and ports. For calling, it typically uses the UDP port range 3478-3481, although it can also use other ports and protocols (TCP) for signaling and other services. Specific IP addresses may vary and belong to blocks assigned to Facebook (owner of WhatsApp).

2. Create Layer7 Protocol Rules

This involves identifying the WhatsApp traffic pattern (which can be complex and subject to change) and creating a rule in the firewall that recognizes it.

3. Create Mangle Rules to Mark Traffic

Using the mangle feature, you can mark traffic that matches the Layer7 pattern or specific ports used by WhatsApp.

4. Create Firewall Rules to Allow/Deny Traffic

With flagged traffic, you can create rules that specifically allow WhatsApp calls and reject all other traffic.

Here is a basic example of how you could start configuring this, keep in mind that you will need to adapt the rules to the specific IP addresses and ports that WhatsApp is using at the time of your configuration:

/ip firewall layer7-protocol
add name=whatsapp regexp=".*(whatsapp).*"

/ip firewall mangle
add action=mark-connection chain=prerouting dst-port=3478-3481 protocol=udp layer7-protocol=whatsapp new-connection-mark=whatsapp_conn passthrough=yes
add action=mark-packet chain=prerouting connection-mark=whatsapp_conn new-packet-mark=whatsapp_pkt passthrough=no

/ip firewall filter
add action=accept chain=forward packet-mark=whatsapp_pkt
add action=drop chain=forward connection-mark=!whatsapp_conn

These rules are very basic and general. WhatsApp and other services frequently change their IPs and methods to prevent this specific type of filtering, so keeping rules for this purpose up to date can be challenging and require constant monitoring of network sessions to adjust settings as network patterns change. traffic.

Last

Please note that implementing this type of control may affect the quality of WhatsApp calls or even prevent them from connecting, depending on how WhatsApp decides to route calls at the time. Additionally, these types of setups can be affected by end-to-end encryption and other obfuscation techniques that WhatsApp might use.

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