[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

squid - redirecionamento



   All

Estou com dificldades para configurar o squid, então resovi começar desde o começo. Começando pelo script de firewall. Fiz um script o mais simples possivel, somente nat e o redirecionamento da porta 80 para a 3128. O script ficou assim:

#!/bin/bash
IPTABLES=/sbin/iptables
# recover IPs
ETH0IP=`ifconfig eth0 | grep "inet addr:" | sed 's/.*inet addr://' | cut -d ' ' -f 1` ETH1IP=`ifconfig eth1 | grep "inet addr:" | sed 's/.*inet addr://' | cut -d ' ' -f 1`
# clean all possible old mess
$IPTABLES -F
$IPTABLES -t nat -F
$IPTABLES -t mangle -F
# masquerading
$IPTABLES -t nat -A POSTROUTING -o eth0 -j MASQUERADE
echo 1 > /proc/sys/net/ipv4/ip_forward
# opening all
$IPTABLES -P INPUT ACCEPT
$IPTABLES -P OUTPUT ACCEPT
$IPTABLES -P FORWARD ACCEPT
$IPTABLES -t nat -P POSTROUTING ACCEPT
$IPTABLES -t nat -P PREROUTING ACCEPT
$IPTABLES -t filter -P FORWARD ACCEPT
# redirecionamento de portas para poder trabalhar com o squid
$IPTABLES -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 3128

    O objetivo é verificar se o problema esta na firewall ou não.

    Isso é o suficiente !?!?!?!?



Reply to: