linux user group brescia

immagine del castello

Archivio della mailing list

[LugBS] iptables e proxy

Giuseppe Rossi bofh68 a gmail.com
Mar 19 Maggio 2009 13:45:50 UTC
2009/5/19 Stefano Pedretti <stefano.pedretti a gmail.com>

> 2009/5/19 Nicola Gatta <nicola.gatta a gmail.com>:
> > 2009/5/18 Carlo Bertoldi <mcbain a tiscali.it>
> >>
> >> Ci ho perso una mezzoretta, fra ricerche in /proc/sys/net e su google,
> >> ma non sono riuscito a trovare molto relativamente a timeout del genere.
> >>...
>
> hum
>
> > iptables -t nat -A PREROUTING -i ethx -p tcp -m tcp --dport 80 -j
> REDIRECT
> > --to-ports 80
> > (ma poi, perdonami la domanda: a che ti serve questa regola? Non è
> > sufficiente non metterla ed eventualmente togliere il DROP che forse hai
> > messo in INPUT?)
> >
>
> Questa regola serve per girare tutti il traffico in forward alla porta
> 80 locale in modo da evitare la navigazione e fornire una pagina di
> comunicazione "navigazione disabilitata"
>
> Prima inizializzavo il masquerading con un colpo di "ipmasq" ma
> pensandoci meglio non dovrebbe servire in quanto il server non fa NAT,
> ma ci pensa il proxy. L'ho tolto e faccio altre prove.
>
>
> --
> -----------------------------
> Pedretti Stefano
> stefano.pedretti a gmail.com
> PGP Fingerprint: 5B00129E
> http://paroledisilicio.wordpress.com
> Skype : ste.pedro83
> mobile: +393292348186
>

Magari dico una stupidata, ma non hai pensato di usare delle regole su squid
per gestire quando si può e non si può navigare?
Io ho fatto delle prove con Squid e funzionava. Di seguito un esempio tratto
dal sito linuxnetworking.com:
Restricting Web Access By Time

You can create access control lists with time parameters. For example, you
can allow only business hour access from the home network, while always
restricting access to host 192.168.1.23.

#
# Add this to the bottom of the ACL section of squid.conf
#
acl home_network src 192.168.1.0/24
acl business_hours time M T W H F 9:00-17:00
acl RestrictedHost src 192.168.1.23

#
# Add this at the top of the http_access section of squid.conf
#
http_access deny RestrictedHost
http_access allow home_network business_hours

Or, you can allow morning access only:

#
# Add this to the bottom of the ACL section of squid.conf
#
acl mornings time 08:00-12:00

#
# Add this at the top of the http_access section of squid.conf
#
http_access allow mornings


Per maggiori informazioni:

http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch32_:_Controlling_Web_Access_with_Squid#Introduction

Spero ti possa essere utile.

Ciao, GR


> -----------------------------
>
> --
>
-------------- parte successiva --------------
Un allegato HTML è stato rimosso...
URL: <http://lugbs.linux.it/pipermail/lug/attachments/20090519/b2fb556b/attachment.html>


Maggiori informazioni sulla lista Lug