Emmanuel Santini
(usa Nenhuma)
Enviado em 13/06/2008 - 17:55h
Olá pessoal.
Vou postar meu aquivo squid.conf onde tudo está rodando 100%.
Primeiramente estou com as linhas no firewall onde libero para acesso a Conectividade Social e depois a regra para o proxy:
# Regras de Conectividade Social da Caixa;
iptables -t nat -A PREROUTING -p tcp -d 200.201.0.0/16 -j ACCEPT
iptables -A FORWARD -p tcp -d 200.201.0.0/16 -j ACCEPT
# PROXY TRANSPARENTE;
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 3128
Agora o /etc/squid/squid.conf:
# INICIO
#-------------------------------------------------------------------------------
http_port 3128 transparent
visible_hostname Proxy XXXXX
hierarchy_stoplist cgi-bin ?
acl QUERY urlpath_regex cgi-bin \?
no_cache deny QUERY
# CONFIGURACOES DO CACHE
#-------------------------------------------------------------------------------
cache_mem 16 MB
cache_dir ufs /var/spool/squid 1024 8 128
# LOCALIZACAO DO LOG DE ACCESSOS DO SQUID
#-------------------------------------------------------------------------------
cache_access_log /var/log/squid/access.log
cache_log /var/log/squid/cache.log
cache_store_log /var/log/squid/store.log
log_ip_on_direct on
# ATUALIZACAO DO CACHE
#-------------------------------------------------------------------------------
refresh_pattern ^ftp: 15 20% 2280
refresh_pattern ^gopher: 15 20% 2280
refresh_pattern . 15 20% 22820
# CONTROLE DAS ACL'S
#-------------------------------------------------------------------------------
acl all src 0.0.0.0/0.0.0.0
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl to_localhost dst 127.0.0.0/8
acl SSL_ports port 443 # https
acl SSL_ports port 563 # snews
acl SSL_ports port 873 # rsync
acl 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 Safe_ports port 631 # cups
acl Safe_ports port 873 # rsync
acl Safe_ports port 901 # SWAT
acl purge method PURGE
acl CONNECT method CONNECT
# PROTOCOLOS
#-------------------------------------------------------------------------------
acl protocolos proto HTTP HTTPS FTP
# IP'S_LIBERADOS
#-------------------------------------------------------------------------------
acl ips_liberados src "/etc/squid/regras/ips_liberados"
# SITES RESTRITOS
#-------------------------------------------------------------------------------
acl sites_restritos url_regex -i "/etc/squid/regras/sites_restritos"
# SITES ESPECIFICOS
#-------------------------------------------------------------------------------
acl sites_especificos url_regex -i "/etc/squid/regras/sites_especificos"
# IPS_FILTRADOS
#-------------------------------------------------------------------------------
acl ips_filtrados src "/etc/squid/regras/ips_filtrados"
# IPS BLOQUIADOS
#-------------------------------------------------------------------------------
acl ips_bloquiados src "/etc/squid/regras/ips_bloquiados"
# CONTROLE HTTP_ACCESS
#-------------------------------------------------------------------------------
http_access allow manager localhost
http_access deny manager
http_access allow purge localhost
http_access deny purge
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow localhost
http_access deny ips_bloquiados
http_access allow ips_liberados
http_access allow sites_especificos
http_access deny sites_restritos
http_access allow ips_filtrados
http_access deny all
icp_access allow all
always_direct allow protocolos
ftp_sanitycheck on
# CAMINHO DAS MENSAGENS DE ERRO
#------------------------------------------------------------------------------
error_directory /etc/squid/errors/Portuguese
coredump_dir /var/spool/squid
ignore_unknown_nameservers on
# CONTROLE DE HTML
#------------------------------------------------------------------------------
deny_info site_bloqueado.html sites_restritos
# E-MAIL DO ADMINISTRADOR E USUARIO/GRUPO DO SQUID
#------------------------------------------------------------------------------
cache_mgr xx@xxxx.xxx.xx
cache_effective_user proxy
cache_effective_group proxy