Skip to content

Instantly share code, notes, and snippets.

@smooker
Last active January 2, 2023 14:09
Show Gist options
  • Save smooker/a78b879ab876798427ed58f04925abf4 to your computer and use it in GitHub Desktop.
Save smooker/a78b879ab876798427ed58f04925abf4 to your computer and use it in GitHub Desktop.
#!/bin/bash
#iptables -A LOG_DROP -j LOG --log-prefix "INPUT:DROP: " --log-level 6
#
iptables -F LAI4
iptables -F LAO4
iptables -F LAF4
iptables -F LDI4
iptables -F LDO4
iptables -F LDF4
iptables -F LAI6
iptables -F LAO6
iptables -F LAF6
iptables -F LDI6
iptables -F LDO6
iptables -F LDF6
#
iptables -X LAI4
iptables -X LAO4
iptables -X LAF4
iptables -X LDI4
iptables -X LDO4
iptables -X LDF4
iptables -X LAI6
iptables -X LAO6
iptables -X LAF6
iptables -X LDI6
iptables -X LDO6
iptables -X LDF6
#
iptables -N LAI4
iptables -N LAO4
iptables -N LAF4
iptables -N LDI4
iptables -N LDO4
iptables -N LDF4
iptables -N LAI6
iptables -N LAO6
iptables -N LAF6
iptables -N LDI6
iptables -N LDO6
iptables -N LDF6
#
iptables -A LAI4 -m limit --limit 20/sec -j LOG --log-prefix "LAI4: " --log-level 6
iptables -A LAI4 -j ACCEPT
iptables -A LAO4 -m limit --limit 20/sec -j LOG --log-prefix "LAO4: " --log-level 6
iptables -A LAO4 -j ACCEPT
iptables -A LAF4 -m limit --limit 20/sec -j LOG --log-prefix "LAF4: " --log-level 6
iptables -A LAF4 -j ACCEPT
iptables -A LAI6 -m limit --limit 20/sec -j LOG --log-prefix "LAI6: " --log-level 6
iptables -A LAI6 -j ACCEPT
iptables -A LAO6 -m limit --limit 20/sec -j LOG --log-prefix "LAO6: " --log-level 6
iptables -A LAO6 -j ACCEPT
iptables -A LAF6 -m limit --limit 20/sec -j LOG --log-prefix "LAF6: " --log-level 6
iptables -A LAF6 -j ACCEPT
#
iptables -A LDI4 -m limit --limit 20/sec -j LOG --log-prefix "LDI4: " --log-level 6
iptables -A LDI4 -j DROP
iptables -A LDO4 -m limit --limit 20/sec -j LOG --log-prefix "LDO4: " --log-level 6
iptables -A LDO4 -j DROP
iptables -A LDF4 -m limit --limit 20/sec -j LOG --log-prefix "LDF4: " --log-level 6
iptables -A LDF4 -j DROP
iptables -A LDI6 -m limit --limit 20/sec -j LOG --log-prefix "LDI6: " --log-level 6
iptables -A LDI6 -j DROP
iptables -A LDO6 -m limit --limit 20/sec -j LOG --log-prefix "LDO6: " --log-level 6
iptables -A LDO6 -j DROP
iptables -A LDF6 -m limit --limit 20/sec -j LOG --log-prefix "LDF6: " --log-level 6
iptables -A LDF6 -j DROP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment