How to automatically break a port when it reaches 20 requests per minute in debian? I think it can be done using iptables

  • There is a limit module - vp_arth

1 answer 1

Something like this (for new connections):

iptables -A INPUT -m state --state NEW -p tcp --dport nash_port -m limit --limit 20/minute --limit-burst 1 -j ACCEPT iptables -A INPUT -m state --state NEW -p tcp --dport nash_port -j REJECT 

See man iptables-extensions for limit and limit-burst.