Skip to content

Instantly share code, notes, and snippets.

@fedir
Last active February 10, 2016 17:00
Show Gist options
  • Save fedir/ed3d729340425b045407 to your computer and use it in GitHub Desktop.
Save fedir/ed3d729340425b045407 to your computer and use it in GitHub Desktop.
iptables modification with backup
# Backup
iptables-save > my-iptables
# Forbid access by an IP
iptables -A INPUT -p tcp --dport 8000 -s 1.2.3.4 -j ACCEPT
iptables -A INPUT -p tcp --dport 8000 -j DROP
# Optional restore OR manual modification apply
#iptables-restore < my-iptables
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment