1
2
3
4
5
6
7
8
# Source: https://serverfault.com/a/200642/88004

iptables-save | awk '/^[*]/ { print $1 } 
                     /^:[A-Z]+ [^-]/ { print $1 " ACCEPT" ; }
                     /COMMIT/ { print $0; }' | iptables-restore

# "All policies will be reset to ACCEPT as well as flushing every table in current use.
#     All chains other than the built in chains will no longer exist."