#!/bin/bash # See: http://linux.overshoot.tv/wiki/server/setting_your_first_firewall_ssh # reset.fw - Reset firewall # set x to 0 - No reset # set x to 1 - Reset firewall # --------------------------------------------------------------------------------------------------------------- # Added support for IPV6 Firewall # --------------------------------------------------------------------------------------------------------------- # Written by Vivek Gite # Source: http://www.cyberciti.biz/faq/turn-on-turn-off-firewall-in-linux/ # --------------------------------------------------------------------------------------------------------------- # You can copy / paste / redistribute this script under GPL version 2.0 or above # ============================================================= x=1 # set to true if it is CentOS / RHEL / Fedora box RHEL=false ### no need to edit below ### IPT=/sbin/iptables IPT6=/sbin/ip6tables if [ "$x" == "1" ]; then if [ "$RHEL" == "true" ]; then # reset firewall using redhat script /etc/init.d/iptables stop /etc/init.d/ip6tables stop else # for all other Linux distro use following rules to reset firewall ### reset ipv4 iptales ### $IPT -P INPUT ACCEPT $IPT -P OUTPUT ACCEPT $IPT -P FORWARD ACCEPT $IPT -F $IPT -X $IPT -Z for table in $(