SHARE
TWEET

Untitled

a guest Feb 27th, 2012 37 Never
  1. iptables -N INSYNBAN
  2. iptables -A INSYNBAN -m recent --set --name INSYNBANCOUNTER
  3. iptables -A INSYNBAN -m recent --update --name INSYNBANCOUNTER --seconds 120 --hitcount 1 -j DROP
  4. iptables -N INSYNSRCLIMITER
  5. iptables -A INSYNSRCLIMITER -m recent --update --name INSYNBANCOUNTER --seconds 120 --hitcount 1 -j DROP
  6. iptables -A INSYNSRCLIMITER -m hashlimit --hashlimit-mode srcip --hashlimit-name insynlimiter --hashlimit 1/s --hashlimit-burst 10 --hashlimit-htable-size 4096 --hashlimit-htable-max 262144 -j RETURN
  7. iptables -A INSYNSRCLIMITER -m limit --limit 1000/m --limit-burst 1000 -j LOG --log-level 4 --log-ip-options --log-prefix "INSYN_SRC_LIMIT EXCEED: "
  8. iptables -A INSYNSRCLIMITER -j INSYNBAN
  9. iptables -A INPUT -p tcp --syn -m state ! --state RELATED,ESTABLISHED -j INSYNSRCLIMITER
RAW Paste Data
Top