Reset Iptables
reset_iptables is a simple Bash script to reset iptables--clear the existing firewall rules. reset_iptables sources from the reset_iptables_programs.cfg file.
#!/bin/bash if [ ! -x /usr/sbin/iptables ]; then die "iptables: can't execute /usr/sbin/iptables" fi /usr/sbin/iptables -P INPUT DROP /usr/sbin/iptables -P OUTPUT DROP /usr/sbin/iptables -P FORWARD DROP /usr/sbin/iptables -F /usr/sbin/iptables -X for table in filter nat mangle; do /usr/sbin/iptables -t $table -F /usr/sbin/iptables -t $table -X /usr/sbin/iptables -t $table -Z done
For more examples, see Samples.