hugoalvarez
(usa Debian)
Enviado em 11/10/2007 - 15:48h
Meio confuso, tente assim, alterei a primeira linha depois da seção ## ativa proxy transparente ### coloque o ip que desejar no 192.168.0.xxx
#Ativando Roteamento e Compartilhamento de Conex�o
echo "1" > /proc/sys/net/ipv4/ip_forward
#Protege contra IP spoofing
echo "1" > /proc/sys/net/ipv4/conf/default/rp_filter
#Impedindo a Abertura de novas conexoes
$iptables -A INPUT -p tcp --syn -j DROP
#Ignora Pings
$iptables -A INPUT -p icmp --icmp-type echo-request -j DROP
# Liberando acesso da rede interna e loopback
$iptables -A INPUT -p ALL -s 127.0.0.1 -i lo -j ACCEPT
$iptables -A INPUT -p ALL -s 192.168.0.0/24 -i lo -j ACCEPT
#Estabilizando e/ou relacionando as conexoes INPUT
$iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
$iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
# desvia sites do proxy
$iptables -t nat -A PREROUTING -s 0.0.0.0/0 -d 200.155.80.0/24 -j RETURN #Bradesco
$iptables -t nat -A PREROUTING -s 0.0.0.0/0 -d 200.155.80.15 -j RETURN #Bradesco
$iptables -t nat -A PREROUTING -s 0.0.0.0/0 -d 200.199.249.50 -j RETURN #BB
$iptables -t nat -A PREROUTING -s 0.0.0.0/0 -d 170.66.11.10 -j RETURN #BB
$iptables -t nat -A PREROUTING -s 0.0.0.0/0 -d 200.152.233.40/24 -j RETURN #HSBC
##Ativa Proxy Transparente ####
$iptables -t nat -A PREROUTING -i bond0 -s 192.168.0.xxx --dport 80 -j DROP
$iptables -t nat -A PREROUTING -i bond0 -p tcp --dport 80 -j REDIRECT --to-port 3128
#Redirecionando portas 25,80,110 para servidor de email
$iptables -t nat -A PREROUTING -s 0/0 -p tcp -i eth0 --dport 22 -j DNAT --to-destination 192.168.0.251
$iptables -t nat -A PREROUTING -s 0/0 -p tcp -i eth0 --dport 80 -j DNAT --to-destination 192.168.0.253
$iptables -t nat -A PREROUTING -s 0/0 -p tcp -i eth0 --dport 25 -j DNAT --to-destination 192.168.0.253
$iptables -t nat -A PREROUTING -s 0/0 -p tcp -i eth0 --dport 110 -j DNAT --to-destination 192.168.0.253
$iptables -t nat -A PREROUTING -s 0/0 -p tcp -i eth0 --dport 21 -j DNAT --to-destination 192.168.0.251
$iptables -t nat -A PREROUTING -s 0/0 -p tcp -i eth0 --dport 3389 -j DNAT --to-destination 192.168.0.248
$iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE