viny_ubuntu
(usa Ubuntu)
Enviado em 11/08/2010 - 12:22h
Olá, onde trabalho estou com um problema sério. Meu servidor conecta à internet e pinga normalmente ao IP-PAI. Contudo, não consigo rotear a mesma conexão para as demais estações de trabalho. Abaixo, cito como configurei o meu squid.
#*************INICIO DO SQUID************************************
#IP deste servidor e porta onde o squid vai ouvir as requisicoes:
#****************************************************************
http_port 10.133.4.1:3128
#Porta onde este squid se comunica com o Proxy-Pai:
#**********************************************************
icp_port 3130
#IP do servidor-Pai:
#***************************
cache_peer 10.67.0.10 parent 3128 3130 no-query
#Limita o dominio com o cache-pai:
#*****************************************
cache_peer_domain 10.67.0.10 !endereco.br
#Tempo limite para as requisicoes icpp:
#**************************************
icp_query_timeout 1000
#Tempo maximo para as requisicoes icp:
#*************************************
maximum_icp_query_timeout 2000
#Tempo que este squid espera p/ declarar o cache-pai como inoperante:
#********************************************************************
dead_peer_timeout 20 seconds
hierarchy_stoplist cgi-bin ?
acl QUERY urlpath_regex cgi-bin \?
no_cache deny QUERY
acl conexao dstdomain .eb.mil.br
no_cache deny EBNet
acl conexaoAddr dst 10.0.0.0/255.0.0.0
no_cache deny conexaoAddr
#Quantidade de memoria utilizada pelo squid:
#*******************************************
cache_mem 3000 MB
#Determina o percentual minimo e maximo de utilizacoes cache pelo squid:
#***********************************************************************
cache_swap_low 80
cache_swap_high 95
#Autenticacao de usuario:
#********************************************************
auth_param basic children 5
auth_param basic realm INFORME SEU LOGIN SENHA. Seus acessos estao sendo monitorados $
auth_param basic credentialsttl 20 minutes
auth_param basic program /usr/lib/squid/ncsa_auth /etc/squid/passwd
#Tamanho maximo dos objetos gravados no disco:
#*********************************************
maximum_object_size 15000 KB
# Diretorio onde o squid armazena o cache na ordem capacidade em mb, qt diretorios criados e qt subdiretorios:
#*************************************************************************************************************
cache_dir ufs /var/spool/squid 3000 32 256
# Altera o padrao do log, gerando-o de uma forma mais compreensivel:
#*******************************************************************
emulate_httpd_log on
#
ftp_passive on
#
#Diretorio onde o squid armazena o access.log:
#*********************************************
cache_access_log /var/log/squid/access.log
#Diretorio onde o squid armazena o cache.log:
#********************************************
cache_log /var/log/squid/cache.log
#Para que o squid nao faca cache da atividade de armazenamento:
#**************************************************************
cache_store_log none
#Determina o local onde o squid grava o PID. Para nao gravar coloque:
#********************************************************************
# pid_filename "none".
#*********************
pid_filename /var/run/squid.pid
#Default sugerido:
#*****************
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern . 0 20% 4320
# Listas de Controle de Acesso (ACL) criadas pelo squid na instalacao do mesmo:
#******************************************************************************
acl all src all
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
#AUTENTICACAO:
#*************
acl passwd proxy_auth "/etc/squid/passwd"
acl SSL_ports port 443 563 # https, snews
acl SSL_ports port 873 # fap
acl SSL_ports port 2811 # cics
acl SSL_ports port 23000 444 447 7443 5005 1741 8999 1352 # criadas por n�s
acl SSL_ports port 13353 13352 # Modulo avaliador
acl Safe_ports port 23000 # Siafi WEB SERPRO
acl Safe_ports port 80 # http
acl Safe_ports port 21 20 990 # ftp
acl Safe_ports port 23 # telnet
acl Safe_ports port 443 563 # https, snews
acl Safe_ports port 70 # gopher
acl Safe_ports port 210 # wais
acl Safe_ports port 1023-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 Safe_ports port 2811 # cics
acl Safe_ports port 1741 465 85 995 # (Criada por nos)
acl Safe_ports port 7000 990 #(criado por nos)
acl Safe_ports port 13353 13352 # Modulo avaliador
acl Safe_ports port 8600 # DigiFort
acl SSL_ports port 8600 # DigiFort
acl Safe_ports port 8080 # DigiFort
acl purge method PURGE
acl CONNECT method CONNECT
#Definindo ACLs
#***********
#Restringem o acessos a determinados sites no horario especificado:
#******************************************************************
acl servidor01 src 10.133.4.0/255.255.255.0
acl proibido url_regex -i "/etc/squid/proibido.txt"
#acl sites_liberados dstdomain "/etc/squid/sites_liberados"
# TAG http_access
#****************
# Permite ou nega o acesso para as ACLs criadas pelo squid:
#**********************************************************
Only allow cachemgr access from localhost
http_access allow manager localhost
http_access deny manager
Only allow purge requests from localhost
http_access allow purge localhost
http_access deny purge
# Deny requests to unknown ports
http_access deny !Safe_ports
# Deny CONNECT to other than SSL ports
http_access deny CONNECT !SSL_ports
#http_access allow our_networks
http_access allow localhost
#http_access deny sites_liberados
#Permite ou nega o acesso para as nossas ACLs
#AUTORIZA COM SENHA:
#*******************
http_access deny passwd
http_access allow Safe_ports
http_access allow SSL_ports
http_access allow servidor01
#E finalmente nega todos os outros acessos para este proxy:
#**********************************************************
http_access deny all
http_reply_access allow all
icp_access allow all
miss_access allow all
cache_mgr viny016@gmail.com
#Usuario e Grupo utilizado pelo squid:
#*************************************
cache_effective_user proxy
cache_effective_group proxy
#Determina que o squid compacte e rotei o access.log e o cache.log:
#******************************************************************
#logfile_rotate 10
never_direct deny EBNet
never_direct deny EBNetAddr
never_direct allow all
#Determina que o squid mostre as mensagens de erro em portugues:
#***************************************************************
error_directory /usr/share/squid/errors/pt-br
coredump_dir /var/spool/squid
server_persistent_connections on
----------------------------------------------------
SEGUE ABAIXO, A CONFIGURAÇÃO DA MINHA INTERFACE DE REDE
#Configuracao Loopback ou Localhost.
auto lo
iface lo inet loopback
#Configuracoes Interfaces de Rede
auto eth0
allow-hotplug eth0
iface eth0 inet static
address 10.133.4.1
netmask 255.255.255.0
network 10.133.4.0
broadcast 10.133.4.255
auto eth1
allow-hotplug eth1
iface eth1 inet static
address 10.133.7.7
netmask 255.255.255.0
network 10.133.7.0
broadcast 10.133.7.255
gateway 10.133.7.251
dns-search caminho.br
Se alguem puder ajudar, agradeço muito.
Abç