dalveson
(usa Debian)
Enviado em 26/08/2009 - 16:03h
eu criei um outro apenas com o necessario so para mim ver se era o script agora ele ficou assim:
#!bin/bash
firewall_start(){
echo "firewall iniciando..."
sleep 1
echo "ok"
sleep 1
}
firewall_stop(){
iptables -F
iptables -X
iptables -P OUTPUT ACCEPT
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -t nat -P PREROUTING ACCEPT
iptables -t nat -P OUTPUT ACCEPT
iptables -t nat -P POSTROUTING ACCEPT
iptables -t mangle -P PREROUTING ACCEPT
iptables -t mangle -P OUTPUT ACCEPT
}
case "$1" in
"start")
firewall_start
;;
"stop")
firewall_stop
echo "desativando firewall..."
sleep 2
echo "firewall desativado"
;;
"restart")
echo "firewall reiniciando..."
sleep 1
echo "firewall reiniciado"
firewall_stop; firewall_start
;;
*)
iptables -L -n
esac