leandro_silvas
(usa Debian)
Enviado em 21/03/2008 - 17:05h
mudei as regras e meu script d firewall ficou assim:
#lembrando q minha eth0 é a rede interna e eth1 a internet.
#só q agora ninguém navega.
#ajudem por favor!
IPLB1="192.168.1.34"
IPLB2="192.168.1.35"
IPLB3="192.168.1.37"
IPLB4="192.168.1.43"
IPLB5="192.168.1.96"
IPLB6="192.168.1.141"
echo 1 > /proc/sys/net/ipv4/ip_forward
echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_all
/sbin/modprobe ip_conntrack
/sbin/modprobe ip_conntrack_ftp
/sbin/modprobe ip_nat_ftp
/sbin/modprobe iptable_nat
/sbin/iptables -P INPUT DROP
/sbin/iptables -P OUTPUT DROP
/sbin/iptables -P FORWARD DROP
/sbin/iptables -F INPUT
/sbin/iptables -F OUTPUT
/sbin/iptables -F FORWARD
/sbin/iptables -t nat -F PREROUTING
/sbin/iptables -A INPUT -j ACCEPT -i eth1
/sbin/iptables -A INPUT -j ACCEPT -i lo
/sbin/iptables -A INPUT -j ACCEPT -p tcp -i eth0 --sport 20
/sbin/iptables -A INPUT -j ACCEPT -p tcp -i eth0 --dport 20
/sbin/iptables -A INPUT -j ACCEPT -p tcp -i eth0 --sport 21
/sbin/iptables -A INPUT -j ACCEPT -p tcp -i eth0 --dport 21
/sbin/iptables -A INPUT -j ACCEPT -p tcp -i eth0 --sport 22
/sbin/iptables -A INPUT -j ACCEPT -p tcp -i eth0 --dport 22
/sbin/iptables -A INPUT -j ACCEPT -p tcp -i eth0 --sport 25
/sbin/iptables -A INPUT -j ACCEPT -p tcp -i eth0 --dport 25
/sbin/iptables -A INPUT -j ACCEPT -p tcp -i eth0 --sport 53
/sbin/iptables -A INPUT -j ACCEPT -p tcp -i eth0 --dport 53
/sbin/iptables -A INPUT -j ACCEPT -p udp -i eth0 --sport 53
/sbin/iptables -A INPUT -j ACCEPT -p udp -i eth0 --dport 53
/sbin/iptables -A INPUT -j ACCEPT -p tcp -i eth0 --sport 80
/sbin/iptables -A INPUT -j ACCEPT -p tcp -i eth0 --dport 80
/sbin/iptables -A INPUT -j ACCEPT -p tcp -i eth0 --sport 85
/sbin/iptables -A INPUT -j ACCEPT -p tcp -i eth0 --dport 85
/sbin/iptables -A INPUT -j ACCEPT -p tcp -i eth0 --sport 86
/sbin/iptables -A INPUT -j ACCEPT -p tcp -i eth0 --dport 86
/sbin/iptables -A INPUT -j ACCEPT -p tcp -i eth0 --sport 110
/sbin/iptables -A INPUT -j ACCEPT -p tcp -i eth0 --dport 110
/sbin/iptables -A INPUT -j ACCEPT -p udp -i eth0 --sport 123
/sbin/iptables -A INPUT -j ACCEPT -p udp -i eth0 --dport 123
/sbin/iptables -A INPUT -j ACCEPT -p tcp -i eth0 --sport 443
/sbin/iptables -A INPUT -j ACCEPT -p tcp -i eth0 --dport 443
#Libera Porta CAGED
/sbin/iptables -A INPUT -j ACCEPT -p tcp -i eth0 --sport 2500
/sbin/iptables -A INPUT -j ACCEPT -p tcp -i eth0 --dport 2500
#Libera Porta CONECTIVIDADE
/sbin/iptables -A INPUT -j ACCEPT -p tcp -i eth0 --sport 2631
/sbin/iptables -A INPUT -j ACCEPT -p tcp -i eth0 --dport 2631
/sbin/iptables -A INPUT -j ACCEPT -p tcp -i eth0 -s 200.201.174.0/24
/sbin/iptables -A INPUT -j ACCEPT -p tcp -i eth0 -d 200.201.174.0/24
#Libera Porta RECEITA FEDERAL (ReceitaNET)
/sbin/iptables -A INPUT -j ACCEPT -p tcp -i eth0 --sport 3456
/sbin/iptables -A INPUT -j ACCEPT -p tcp -i eth0 --dport 3456
#Libera Porta CAT-INSS
/sbin/iptables -A INPUT -j ACCEPT -p tcp -i eth0 --sport 5017
/sbin/iptables -A INPUT -j ACCEPT -p tcp -i eth0 --dport 5017
#Libera Porta SINTEGRA / POSTO FISCAL
/sbin/iptables -A INPUT -j ACCEPT -p tcp -i eth0 --sport 8017
/sbin/iptables -A INPUT -j ACCEPT -p tcp -i eth0 --dport 8017
/sbin/iptables -A FORWARD -j ACCEPT -s $IPLB1
/sbin/iptables -A FORWARD -j ACCEPT -d $IPLB1
/sbin/iptables -A FORWARD -j ACCEPT -s $IPLB2
/sbin/iptables -A FORWARD -j ACCEPT -d $IPLB2
/sbin/iptables -A FORWARD -j ACCEPT -s $IPLB3
/sbin/iptables -A FORWARD -j ACCEPT -d $IPLB3
/sbin/iptables -A FORWARD -j ACCEPT -s $IPLB4
/sbin/iptables -A FORWARD -j ACCEPT -d $IPLB4
/sbin/iptables -A FORWARD -j ACCEPT -s $IPLB5
/sbin/iptables -A FORWARD -j ACCEPT -d $IPLB5
/sbin/iptables -A FORWARD -j ACCEPT -s $IPLB6
/sbin/iptables -A FORWARD -j ACCEPT -d $IPLB6
/sbin/iptables -A FORWARD -j ACCEPT -p tcp --sport 25
/sbin/iptables -A FORWARD -j ACCEPT -p tcp --dport 25
/sbin/iptables -A FORWARD -j ACCEPT -p udp --sport 53
/sbin/iptables -A FORWARD -j ACCEPT -p udp --dport 53
/sbin/iptables -A FORWARD -j ACCEPT -p tcp --sport 80
/sbin/iptables -A FORWARD -j ACCEPT -p tcp --dport 80
/sbin/iptables -A FORWARD -j ACCEPT -p tcp --sport 85
/sbin/iptables -A FORWARD -j ACCEPT -p tcp --dport 85
/sbin/iptables -A FORWARD -j ACCEPT -p tcp --sport 86
/sbin/iptables -A FORWARD -j ACCEPT -p tcp --dport 86
/sbin/iptables -A FORWARD -j ACCEPT -p tcp --sport 110
/sbin/iptables -A FORWARD -j ACCEPT -p tcp --dport 110
/sbin/iptables -A FORWARD -j ACCEPT -p udp --sport 137
/sbin/iptables -A FORWARD -j ACCEPT -p udp --dport 137
/sbin/iptables -A FORWARD -j ACCEPT -p tcp --sport 143
/sbin/iptables -A FORWARD -j ACCEPT -p tcp --dport 143
/sbin/iptables -A FORWARD -j ACCEPT -p tcp --sport 443
/sbin/iptables -A FORWARD -j ACCEPT -p tcp --dport 443
/sbin/iptables -A FORWARD -j ACCEPT -p tcp --sport 2500
/sbin/iptables -A FORWARD -j ACCEPT -p tcp --dport 2500
/sbin/iptables -A FORWARD -j ACCEPT -p tcp --sport 2631
/sbin/iptables -A FORWARD -j ACCEPT -p tcp --dport 2631
/sbin/iptables -A FORWARD -j ACCEPT -p tcp --sport 3456
/sbin/iptables -A FORWARD -j ACCEPT -p tcp --dport 3456
/sbin/iptables -A FORWARD -j ACCEPT -p tcp --sport 5017
/sbin/iptables -A FORWARD -j ACCEPT -p tcp --dport 5017
/sbin/iptables -A FORWARD -j ACCEPT -p tcp --sport 8017
/sbin/iptables -A FORWARD -j ACCEPT -p tcp --dport 8017
/sbin/iptables -A INPUT -j DROP
/sbin/iptables -A OUTPUT -j ACCEPT
/sbin/iptables -A FORWARD -j DROP
/sbin/iptables -A POSTROUTING -j MASQUERADE -t nat
# habilita Squid - PROXY TRANSPARENTE
/sbin/iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 3128
/sbin/iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE