Skip to content

Instantly share code, notes, and snippets.

@jkullick
Created March 10, 2017 15:04
Show Gist options
  • Save jkullick/f85b98bdb179a5d918b0a504eb9023df to your computer and use it in GitHub Desktop.
Save jkullick/f85b98bdb179a5d918b0a504eb9023df to your computer and use it in GitHub Desktop.
IPTables Rate Limit
iptables -N LOGGING
iptables -A LOGGING -m limit --limit 2/min -j LOG --log-prefix "IPTables-Dropped: " --log-level 4

iptables -A INPUT -p tcp --dport 80 -m state --state NEW -m recent --set
iptables -A INPUT -p tcp --dport 80 -m state --state NEW -m recent --update --seconds 60 --hitcount 20 -j LOGGING

iptables -A LOGGING -j DROP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment