Dario Pilori ha scritto:
> [cut]
> A doverlo ammettere, mi sembra un po' un casino questo script :-)
> Provo ad interpretare i tuoi desideri, e lo riscrivo più
> "ordinatamente".
> Allora:
>
> #!/bin/bash
> # Interface connected to Internet
> INTERNET="eth0"
> # Interface connected to LAN
> LAN_IN="eth1"
> # Squid port
> SQUID_PORT="3128"
>
> # Pulisci vecchio firewall
> iptables -F
> iptables -X
> iptables -Z
> iptables -t nat -F
> iptables -t nat -X
> iptables -t nat -Z
> iptables -t mangle -F
> iptables -t mangle -X
> iptables -t mangle -Z
>
> # IP Forward
> echo 1 > /proc/sys/net/ipv4/ip_forward
>
> # Policy di default
> iptables -P OUTPUT ACCEPT
> iptables -P INPUT DROP
> iptables -P FORWARD DROP
>
> # Catena INPUT
> iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
> iptables -A INPUT -i $LAN_IN -j ACCEPT
> iptables -A INPUT -p icmp --icmp-type ! echo-request -j ACCEPT
> iptables -A INPUT -i lo -j ACCEPT
>
> # NAT e Redirect
> iptables -t nat -A POSTROUTING -o $INTERNET -j MASQUERADE
> iptables -t nat -A PREROUTING -i $LAN_IN -p tcp --dport 80 -j REDIRECT
> --to-port $SQUID_PORT
>
> # Altre regole FORWARD
> iptables -A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT
> iptables -A FORWARD -i $LAN_IN -j ACCEPT
> iptables -A FORWARD -p icmp --icmp-type ! echo-request -j ACCEPT
>
>
> Prova così. Ora lo script è un po' più ordinato, e ho preso spunto
> direttamente dallo script del mio proxy trasparente :-)
>
>   
ciao
ti ringrazio, lo script non l'ho fatto io, l'ho copiato dal sito che ho
indicato nella prima email, purtroppo di iptables sono a completo
digiuno, allora
ho riavviato la mia lenny, l'output di iptables e' il seguente (con
iptables -vv -L):

Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source              
destination

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source              
destination

Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source              
destination
libiptc v1.4.1.1. 620 bytes.
Table `filter'

dal portatile navigo solo dopo aver inserito il proxy a mano nella
configurazione connessione, dopo aver applicato il tuo script con
iptalbes ho il seguente output :

Chain INPUT (policy DROP 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source              
destination
    4   186 ACCEPT     all  --  any    any     anywhere            
anywhere            state RELATED,ESTABLISHED
    0     0 ACCEPT     all  --  eth1   any     anywhere             anywhere
    0     0 ACCEPT     icmp --  any    any     anywhere            
anywhere            icmp !echo-request
    0     0 ACCEPT     all  --  lo     any     anywhere             anywhere

Chain FORWARD (policy DROP 1 packets, 52 bytes)
 pkts bytes target     prot opt in     out     source              
destination
    0     0 ACCEPT     all  --  any    any     anywhere            
anywhere            state RELATED,ESTABLISHED
    0     0 ACCEPT     all  --  eth1   any     anywhere             anywhere
    0     0 ACCEPT     icmp --  any    any     anywhere            
anywhere            icmp !echo-request

Chain OUTPUT (policy ACCEPT 4 packets, 327 bytes)
 pkts bytes target     prot opt in     out     source              
destination
libiptc v1.4.1.1. 1800 bytes.
Table `filter'

il risultato e' sempre lo stesso non cambia nulla, devo sempre inserire
il proxy sul browser del portatile, eth0 e' quella collegata ad internet
con fastweb, eth1 e' quella collegata al portatile con cavo incrociato,
secondo te cosa c'e' di sbagliato? teoricamente se ho capito bene il
discorso del firewall trasparente devo forwaddare le richieste di eth1
della porta 80 sulla 3128 dove c'e' squid in ascolto e sul portatile non
dovrei settare nessun proxy dovrebbe funzionare come se fosse
direttamente collegato a fastweb senza nessun intermediario, giusto?

teoricamente dovrebbe bastare solo questa riga

iptables -t nat -A PREROUTING -i $LAN_IN -p tcp --dport 80 -j REDIRECT 
--to-port $SQUID_PORT

ma purtroppo non va, non capisco


-- 
Nobuteru
Linux Registered User #368935 since 01-10-2004
Powered by Debian Lenny
GPG Key fingerprint 0061 6CE8 02EB 0CAA 16E2 7ECD 1AC4 32A2 C30B A8ED
Jabber ID [email protected]

Rispondere a