#! /bin/sh FW_SCRIPT=..... # If no rules, do nothing. if [ ! -x $FW_SCRIPT ]; then echo "Can't execute $FW_SCRIPT" exit 0 fi case "$1" in start) echo -n "Turning on packet filtering:" $FW_SCRIPT echo "." ;; stop) echo -n "Turning off packet filtering:" echo 0 > /proc/sys/net/ipv4/ip_forward iptables -F; iptables -t nat -F; iptables -t mangle -F iptables -P OUTPUT ACCEPT iptables -P INPUT ACCEPT iptables -P FORWARD ACCEPT echo "." ;; *) echo "Usage: /etc/init.d/firewall {start|stop}" exit 1 ;; esac exit 0