Saturday, March 23, 2013

how to limit number of connections to our server per period of time with iptables

sample - allow 2 hits once every 3 seconds

iptables -A INPUT -p tcp --dport 80 -i eth0 -m state --state NEW -m recent --set
iptables -A INPUT -p tcp --dport 80 -i eth0 -m state --state NEW -m recent --update --seconds 3 --hitcount 2 -j DROP

0 comments:

Post a Comment