Enviado em 21/03/2014 - 14:01h
Use este firewall trocando $iface_int pela sua placa local e $rede_mask pela sua rede Ex 192.166.0.0/24
#!/bin/bash
echo "Limpando as Regras existentes"
/sbin/iptables -F
/sbin/iptables -t nat -F
/sbin/iptables -t mangle -F
/sbin/iptables -t filter -F
/sbin/iptables -X
/sbin/iptables -Z
iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
iptables -P FORWARD ACCEPT
# kernel 3.4 ou menor descomente as duas abaixo
#/sbin/modprobe ip_nat
#/sbin/modprobe ip_queue
# Kernel 3.5 ou maior comente as anteriores e descomente as duas proximas abaixo
/sbin/modprobe nfnetlink_queue
/sbin/modprobe nfnetlink
/sbin/modprobe ip_nat_ftp
/sbin/modprobe ip_conntrack
/sbin/modprobe ip_conntrack_ftp
/sbin/modprobe ip_tables
/sbin/modprobe iptable_filter
/sbin/modprobe iptable_nat
/sbin/modprobe iptable_mangle
/sbin/modprobe ipt_state
/sbin/modprobe ipt_limit
/sbin/modprobe ipt_multiport
/sbin/modprobe ipt_mac
/sbin/modprobe ipt_string
/sbin/iptables -A INPUT -i $iface_int -s $rede_mask -j ACCEPT
/sbin/iptables -A INPUT -i $iface_int -m state --state NEW -j ACCEPT
/sbin/iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -s 0/0 -d 0/0 -o eth+ -j MASQUERADE
rm -rf /var/spool/squid/*
squid -z