#!/usr/bin/bash # Echoing what is happening echo "Stopping IPv4 firewall and allowing everyone..." # Create var for ''iptables'' ipt=$(which iptables) ## Failsafe - die if /sbin/iptables not found [ ! -x "$ipt" ] && { echo "$0: \"${ipt}\" command not found."; exit 1; } # Set ''INPUT'' policy to ''ACCEPT'' $ipt -P INPUT ACCEPT # Set ''FORWARD'' policy to ''ACCEPT'' $ipt -P FORWARD ACCEPT # Set ''OUTPUT'' policy to ''ACCEPT'' $ipt -P OUTPUT ACCEPT # Flush all rules $ipt -F # Delete all user defined chains $ipt -X # Flush all from table ''nat'' $ipt -t nat -F # Delete table ''nat'' $ipt -t nat -X # Flush all from table ''mangle'' $ipt -t mangle -F # Delete table ''mangle'' $ipt -t mangle -X # Flush all from table ''raw'' $ipt -t raw -F # Delete table ''raw'' $ipt -t raw -X