Page 1 of 1

ICMP Drop

Posted: Mon Mar 11, 2019 7:04 pm
by raikone51
Hello guys, it is possible to permit icmp but dropping 10 percentage of the packets ?

Re: ICMP Drop

Posted: Mon Mar 11, 2019 7:28 pm
by kiaunel
Think like this :
How can routeros imagine how many packets will receive in future?
If it will receive 100 it will have to drop 10
If it will receive 10 it will have to drop 1
if it will receive 1000 it will have to drop 100
How can some os or you predict this?

Re: ICMP Drop

Posted: Mon Mar 11, 2019 7:41 pm
by k6ccc
Hello guys, it is possible to permit icmp but dropping 10 percentage of the packets ?
As kiaunel said, I don't know of a way to drop a certain percentage of packets. However you can rate limit certain packets to some number. For example 5 packets per second.
add action=accept chain=ICMP comment=\
    "Accept ICMP type 0:0 (Echo reply) and limit to 5 packets / sec" \
    icmp-options=0:0-255 limit=5,5 protocol=icmp
Note that I have a specific ICMP chain that handles almost all events relating to ICMP packets. Hence the reason that the above code is in the ICMP chain and not the Input chain.
add action=jump chain=input comment=\
    "Jump to ICMP chain to prevent being ping flooded." in-interface=\
    E1-p2_Cable_Internet jump-target=ICMP protocol=icmp
What are you trying to accomplish?

Re: ICMP Drop

Posted: Tue Mar 12, 2019 12:31 am
by sebastia
You could use the "nth" filter option to drop every nth packet. so for 10% every 10 packet should be dropped.

Re: ICMP Drop

Posted: Tue Mar 12, 2019 12:36 am
by k6ccc
You could use the "nth" filter option to drop every nth packet. so for 10% every 10 packet should be dropped.
Just learned something new. Did not even know that existed, but sure enough - it's there...