Hi, I am a bit confused with the following concepts and hope someone could clarify this for me.
According to the wiki at: http://wiki.mikrotik.com/wiki/Manual:IP/Firewall/Filter#Properties
The “limit” function “Matches packets if given pps limit is exceeded.”
I suppose this means that the rule will ignore packets that are under the limit.
However, according to various other examples in the wiki, people use this limit rule to allow certain flow of packets to be accepted and add another rule which drops all remaining packets.
An example can be found here: http://wiki.mikrotik.com/wiki/Securing_New_RouterOs_Router in the ICMP chain section
Also here: http://wiki.mikrotik.com/wiki/DoS_attack_protection in the SYN filtering section
Taking a section from the second example:
/ip firewall filter add chain=forward protocol=tcp tcp-flags=syn connection-state=new action=jump jump-target=SYN-Protect comment=“SYN Flood protect” disabled=yes
/ip firewall filter add chain=SYN-Protect protocol=tcp tcp-flags=syn limit=400,5 connection-state=new action=accept comment=“” disabled=no
/ip firewall filter add chain=SYN-Protect protocol=tcp tcp-flags=syn connection-state=new action=drop comment=“” disabled=no
The first rule jumps to the SYN-Protect chain which makes sense to me but the second rule “accepts” connections with a limit of 400,5 really confuses me. From my understanding, the rule accepts packet that exceeds this limit. Then the third rule drops all remaining packets. Therefore wouldn’t the end result be that all packets under the limit 400,5 be dropped? Isn’t this the opposite of what we wanted?
Could someone comment on this?