Lompat ke konten Lompat ke sidebar Lompat ke footer

How To give Highest Priority for ICMP (Ping) On Mikrotik

Mikrotik Queuing is heuristic , means every packet leaving mikrotik destined to your IP is capped, even ICMP too.

So when you do browsing or downloading any data , there will be less or no bandwidth available for PING/ ICMP packets and ping form client to mikrotik OR to internet will face frequent timeout and high latency in case of full usage of allowed bandwidth.

As showed in the image below …
How To give Highest Priority for ICMP (Ping) On Mikrotik

NOTE:
It is recommended to block the ICMP/PING protocol on every network to avoid flooding and un wanted queries from the client end. (You can exempt your admin pc or other from this restriction via source address list)
Or if you still want to allow icmp , then simply mark icmp packets and and create a queue that allows more bandwidth to icmp marked packets.

1. EXAMPLE OF PING/ICMP QUEUE USING SIMPLE QUEUE [overall capping]

###########################################
# PING/ICMP Priority Script for Mikrotik
# lamerstech 
https://lamerstech.blogspot.com/
###########################################

# Connection PACKET marking for ICMP, valid for both 5.x and 6.x ROS versions
/ip firewall mangle
add chain=prerouting protocol=icmp action=mark-connection new-connection-mark=icmp-con passthrough=yes comment="" disabled=no
# PACKET marking for ICMP, valid for both 5.x and 6.x ROS versions
add chain=prerouting protocol=icmp connection-mark=icmp-con action=mark-packet new-packet-mark=icmp-pkt passthrough=no comment="" disabled=no

# QUEUE TREE For Mikrotik 5.x Version to allow 128k Bandwidth for ICMP/PING Packets
/queue tree
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=128k max-limit=128k name=Hi-Prio-to-icmp-aacable packet-mark=icmp-pkt parent=global-out priority=1 queue=default
# For 5.x All Done. Now check your PING results. t.c

###################################################################
# IF you are using Mikrotik 6.x then above queue wont work,instead use SIMPLE queue 
# SIMPLE QUEUE approach is valid For both 5.x and 6.x Versions.
# DO Make sure to move it on TOP [order wise 0]

/queue simple
add max-limit=128k/128k name=ICMP_Priority packet-marks=icmp-pkt target=""

Result after implementing above code.
How To give Highest Priority for ICMP (Ping) On Mikrotik

2. SECOND EXAMPLE OF PING/ICMP QUEUE USING PCQ TREE | (FOR PER USER DISTRIBUTION)

The following script will mark icmp packets and will allow 32k per user for icmp traffic via PCQ / QUEUE TREE

/ip firewall mangle
add action=mark-packet chain=prerouting comment="Mark ICMP I / zaib" new-packet-mark=ping_pkts_i protocol=icmp
add action=mark-packet chain=postrouting comment="Mark ICMP O / zaib" new-packet-mark=ping_pkts_o protocol=icmp

/queue type
add kind=pcq name="ping_pkts_i_32K" pcq-classifier=dst-address pcq-dst-address6-mask=64 pcq-rate=32k pcq-src-address6-mask=64
add kind=pcq name="ping_pkts_o_32K" pcq-classifier=src-address pcq-dst-address6-mask=64 pcq-rate=32k pcq-src-address6-mask=64


/queue tree
add name=ping_pkts_i packet-mark=ping_pkts_i parent=global-out queue="ping_pkts_i_32K / lamerstech"
add name=ping_pkts_o packet-mark=ping_pkts_o parent=global-out queue="ping_pkts_o_32K / lamerstech"

TIP
You can also use PRIORITY base queuing to give priority to ICMP packets from user own queue over other protocols.

Posting Komentar untuk "How To give Highest Priority for ICMP (Ping) On Mikrotik"