Skip to content

Instantly share code, notes, and snippets.

@demofly
Forked from thoward/iptables-udp-flood.txt
Created June 29, 2016 15:36
Show Gist options
  • Save demofly/7ff9e22d6847b4de1fc3eed82ebcdb4b to your computer and use it in GitHub Desktop.
Save demofly/7ff9e22d6847b4de1fc3eed82ebcdb4b to your computer and use it in GitHub Desktop.
Prevent UDP flood
# Outbound UDP Flood protection in a user defined chain.
iptables -N udp-flood
iptables -A OUTPUT -p udp -j udp-flood
iptables -A udp-flood -p udp -m limit --limit 50/s -j RETURN
iptables -A udp-flood -j LOG --log-level 4 --log-prefix 'UDP-flood attempt: '
iptables -A udp-flood -j DROP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment