How to RESET/FLUSH/DELETE all iptables in Linux

Take backup

iptables-save > ~/iptables-`date +%Y%m%d_%H%M%S`.bak

Flush now

iptables -F
iptables -X
iptables -t nat -F
iptables -t nat -X
iptables -t mangle -F
iptables -t mangle -X
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT

Again to restore from backup

iptables-restore < bak.file
Read more

iptables explained

iptables

Iptables is used to set up, maintain, and inspect the tables of IP packet filter rules in the Linux kernel. Several different tables may be defined. Each table contains a number of built-in chains and may also contain user-defined chains.

Each chain is a list of rules which can match … Read more