Galera,
Não estou conseguindo direcionar toda requisisão na porta 80, ir para o squid (3128)
Olha minha configuração:
# Primeiro: Zerar as regras do IPTABLES
/sbin/iptables -F
/sbin/iptables -X
/sbin/iptables -F -t nat
/sbin/iptables -X -t nat
/sbin/iptables -F -t mangle
/sbin/iptables -X -t mangle
echo "Regras do filtro de pacotes zeradas!!!"
echo " "
#Negando todo trafico de pacotes.
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT ACCEPT
#Barrando SSH (porta 4632)
#iptables -A INPUT -p TCP --dport 4632 -j DROP
#Barrando Time
iptables -A INPUT -p TCP --dport 113 -j DROP
#Barrando Auth
iptables -A INPUT -p TCP --dport 37 -j DROP
#Barrando VNC
iptables -A INPUT -p TCP --dport 5901 -j DROP
iptables -A INPUT -p TCP --dport 5900 -j DROP
#Barrando X11
iptables -A INPUT -p TCP --dport 6000 -j DROP
iptables -A INPUT -p TCP --dport 6001 -j DROP
##################### PARTE 2 #####################
#liberando tráfego de rede local (127.0.0.1)
iptables -A INPUT -i lo -j ACCEPT
#Liberando o palm para navegar na internet via "ip forward"
echo 1 > /proc/sys/net/ipv4/ip_forward
echo "1" > /proc/sys/net/ipv4/ip_dynaddr
iptables -A POSTROUTING -t nat -j MASQUERADE -o eth0
#Liberando nessus (habilite somente quando precisar)
#iptables -A INPUT -p tcp --destination-port 1241 -j ACCEPT
#Liberando socks
iptables -A OUTPUT -p tcp --sport 1024:5999 --dport 1080:1080 -m state --state NEW -j ACCEPT
#Liberando SSH (porta 4632)
iptables -A INPUT -p tcp --destination-port 4632 -j ACCEPT
#Liberando SSH (porta 22)
iptables -A INPUT -p tcp --destination-port 22 -j ACCEPT
#Liberando Samba (portas 137 à 139) somente para pc da rede local
#iptables -A INPUT -p tcp --dport 137:139 -s 192.168.254.15/255.255.255.0 -j ACCEPT
#iptables -A INPUT -p udp --dport 137:139 -s 192.168.254.15/255.255.255.0 -j ACCEPT
#iptables -A OUTPUT -p tcp --dport 137:139 -s 192.168.254.15/255.255.255.0 -j ACCEPT
#iptables -A OUTPUT -p udp --dport 137:139 -s 192.168.254.15/255.255.255.0 -j ACCEPT
#Abrindo interface lo
iptables -A INPUT -p tcp --syn -s 127.0.0.1/255.0.0.0 -j ACCEPT
#Liberando pacotes que realmente devem estabelecer conexão.
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A OUTPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
#Liberar Apache (porta 8080)
iptables -A INPUT -p tcp --destination-port 80 -j ACCEPT
#Liberar acesso http (www)
iptables -A OUTPUT -p tcp --sport 1024:5999 --dport 80:80 -m state --state NEW -j ACCEPT
iptables -A OUTPUT -p tcp --sport 1024:5999 --dport 8080:8080 -m state --state NEW -j ACCEPT
#Liberando MSN
iptables -A OUTPUT -p tcp --sport 1024:5999 --dport 1863:1863 -m state --state NEW -j ACCEPT
#Liberando ping externo local p internet
#iptables -A OUTPUT -p icmp --icmp-type echo- request -j ACCEPT
#Liberando conexão (P2P Gnutela)
#iptables -A OUTPUT -p tcp --sport 0:65535 --dport 6346:6346 -m state --state NEW -j ACCEPT
#Liberando conexão (P2P aMule)
#iptables -A INPUT -p tcp --destination-port 4662 -j ACCEPT
#iptables -A OUTPUT -p tcp --sport 0:65535 --dport 4632:4732 -m state --state NEW -j ACCEPT
#iptables -A FORWARD -j ACCEPT -p tcp --dport 4672
#Liberando conexão (Limewire)
#iptables -A INPUT -p tcp --destination-port 4666 -j ACCEPT
#iptables -A FORWARD -j ACCEPT -p tcp --dport 4666
#iptables -A OUTPUT -p tcp --sport 0:65535 --dport 4666:4666 -m state --state NEW -j ACCEPT
#Liberando Torrent (Azureus e Ktorrent)
#iptables -A INPUT -p tcp --destination-port 6881 -j ACCEPT
#iptables -A FORWARD -j ACCEPT -p tcp --dport 6881
#direcionando para squid
iptables -t nat -A PREROUTING -i eth1 -p tcp -d ! 200.201.174.207 --dport 80 -j REDIRECT --to-port 3128
#################### fim do firewall ####################