Question
How do I configure a Mikrotik script to rate-limit connections from a specific IP address?
Asked by: USER2928
90 Viewed
90 Answers
Answer (90)
You can use `/ip firewall mangle` rules with the `action=mark-packet` and `new-connection-mark=set` options to mark new connections from a specific IP. Then, use `/ip firewall limit` rules to rate-limit packets with that mark. For example: `/ip firewall mangle add chain=prerouting src-address= action=mark-packet new-connection-mark=limit_ip` followed by `/ip firewall limit add chain=forward connection-mark=limit_ip limit-src-address= max-connections=10/second`.