miércoles, 30 de enero de 2013

Servidor Proxy con Squid3 en Linux

Instalamos el Squid3 con el aptitude y editamos el squid.conf

> aptitude install
squid3

> vim /etc/squid3/squid.conf
> cd /etc/squid3/
> cp squid.conf squid.conf.copia
*** Quitamos los comentarios

> grep -v ^# squid.conf.copia  | grep -v ^$ > squid.conf > squid.conf


 Archivo limpio de "#" :



acl manager proto cache_object
acl localhost src 127.0.0.1/32 ::1
acl to_localhost dst 127.0.0.0/8 0.0.0.0/32 ::1
acl aula202 src 172.20.202.0/24                 # Se indica los rangos de ip con nombres

#acl tiempo time MTWHF 9:00-13:30         # Se le pone horas con nombres.
#acl tiempo2 time MTWHF 13:31-13:42
acl nerea src 172.20.202.111
acl inigo src 172.20.202.112
acl eduardo dstdomain www.eduardo.com 

#acl palabraproxy url_regex proxy hackear sex
acl SSL_ports port 443acl Safe_ports port 80          # http 

#acl Safe_ports port 21          # ftp
#acl Safe_ports port 443         # https 
#acl Safe_ports port 70          # gopher
#acl Safe_ports port 210         # wais
#acl Safe_ports port 1025-65535  # unregistered ports
acl Safe_ports port 280         # http-mgmt
acl Safe_ports port 488         # gss-http 

#acl Safe_ports port 591         # filemaker
#acl Safe_ports port 777         # multiling http
acl CONNECT method CONNECT                                   # Conecta

http_access allow manager localhost       # Acceso total al localhost y cache 
#http_access deny palabraproxy     # Deniegas acceso a palabraproxy y sus palabras.
http_access allow eduardo              # Se permite acceso a la web eduardo.com 
# http_access deny tiempo2            # Se deniega el tiempo en esas horas. 
#http_access deny !tiempo2                                          

http_access allow nerea               # Concedo acceso a Nerea
http_access deny inigo                  #  Deniego acceso a Inigo.
http_access deny aula202             # Deniego acceso a todo el aula202
#http_access deny aula202                                                   
http_access deny !Safe_ports     # Se deniega el acceso a todos los puertos menos esos.

http_access allow CONNECT !SSL_ports
http_access allow localhost
http_port 3128
cache_dir ufs /var/spool/squid3 100 16 256
coredump_dir /var/spool/squid3
refresh_pattern ^ftp:           1440    20%     10080
refresh_pattern ^gopher:        1440    0%      1440
refresh_pattern -i (/cgi-bin/|\?) 0     0%      0
refresh_pattern (Release|Packages(.gz)*)$      0       20%     2880
refresh_pattern .               0       20%     4320

cache_peer proxyaulas.diocesanas.org parent 8080 0 proxy-only

No hay comentarios:

Publicar un comentario