#!/bin/sh # Linux Firewall: Simple Shell Script To Stop and Flush All Iptables Rules # Some Linux distros like Debian do not have /etc/init.d/iptables stop script # This can be also called from cron job if you are testing new firewall on # remote box to avoid lock out # ------------------------------------------------------------------------- # Copyright (c) 2004 nixCraft project # This script is licensed under GNU GPL version 2.0 or above # ------------------------------------------------------------------------- # This script is part of nixCraft shell script collection (NSSC) # Visit http://bash.cyberciti.biz/ for more information. # ------------------------------------------------------------------------- PATH=/usr/sbin:/sbin:/usr/bin:/bin iptables -F iptables -X iptables -t nat -F iptables -t nat -X iptables -t mangle -F iptables -t mangle -X iptables -t raw -F iptables -P INPUT ACCEPT iptables -P OUTPUT ACCEPT iptables -P FORWARD ACCEPT ip6tables -F ip6tables -X ip6tables -t nat -F ip6tables -t nat -X ip6tables -t mangle -F ip6tables -t mangle -X ip6tables -t raw -F ip6tables -P INPUT ACCEPT ip6tables -P OUTPUT ACCEPT ip6tables -P FORWARD ACCEPT