silasmg
(usa Debian)
Enviado em 14/06/2010 - 15:48h
Mais uma vez eu aqui :D
Seguinte, tenho instalado SQUID + WEBMIN
Pra começar o problema: SQUID TRANSPARENTE ainda não está funcionando.
Se eu configurar na estação o IP 192.168.1.1 na porta 80 ou 3128 o squid navega normalmente, mas se eu deixar a configuração em branco não navega.
O Servidor DHCP está distribuindo os IPs normalmente e nas máquinas o gateway está configurado para o endereço do servidor.
Detalhes:
O iptables eu gerencio direto pelo WEBMIN que achei bem interessante
Por via de dúvidas eu deixei tudo no ACCEPT (INPUT, FORWARD e OUTPUT)
Segue o arquivo:
###########################################################
# Generated by iptables-save v1.4.2 on Fri Jun 11 11:02:23 2010
*filter
:FORWARD ACCEPT [0:0]
:INPUT ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -p tcp --dport 3128 -j ACCEPT
COMMIT
# Completed on Fri Jun 11 11:02:23 2010
# Generated by iptables-save v1.4.2 on Fri Jun 11 11:02:23 2010
*mangle
:FORWARD ACCEPT [0:0]
:INPUT ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:PREROUTING ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
COMMIT
# Completed on Fri Jun 11 11:02:23 2010
# Generated by iptables-save v1.4.2 on Fri Jun 11 11:02:23 2010
*nat
:OUTPUT ACCEPT [0:0]
:PREROUTING ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
-A PREROUTING -p tcp -s 192.168.1.0/24 --dport 80 -j REDIRECT --to-port 3128
-A POSTROUTING -p tcp -s 192.168.1.0/24 -j MASQUERADE
COMMIT
# Completed on Fri Jun 11 11:02:23 2010
###########################################################
SQUID:
###########################################################
#NOME_DO_PROXY
cache_mgr cpdsaude@capaodacanoa.rs.gov.br
visible_hostname Proxy Sec. da Saude
unique_hostname Proxy Sec. da Saude
coredump_dir /var/spool/squid
extension_methods REPORT MERGE MKACTIVITY CHECKOUT
#PORTA
http_port 3128 transparent
#CONFIGURACAO MINIMA
hierarchy_stoplist cgi-bin ?
acl QUERY urlpath_regex cgi-bin \?
cache deny QUERY
acl apache rep_header Server ^Apache
broken_vary_encoding allow apache
cache_mem 2000 MB
maximum_object_size 128096 KB
maximum_object_size_in_memory 64 KB
cache_dir ufs /var/spool/squid 2048 16 256
access_log /var/log/squid/access.log
hosts_file /etc/hosts
auth_param basic program /usr/lib/squid/ncsa_auth /etc/squid/senhas
auth_param basic children 5
auth_param basic realm Secretaria da Saude de Capao da Canoa
auth_param basic credentialsttl 90 minute
auth_param basic casesensitive off
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern . 0 20% 4320
#REGRAS
acl rede_interna src 192.168.1.0/24
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 80 8017 # http pra sefip
acl SSL_ports port 443 # https
acl SSL_ports port 444 # sefip
acl SSL_ports port 563 # snews
acl SSL_ports port 873 # rsync
acl SSL_ports port 22 # ssh
acl SSL_ports port 10000 # webmin
acl SSL_ports port 65000 # cadsus
acl Safe_ports port 995 # webmail
acl Safe_ports port 587 # webmail
acl Safe_ports port 465 # webmail
acl Safe_ports port 193 # webmail
acl Safe_ports port 993 # webmail
acl Safe_ports port 80 # http
acl Safe_ports port 444 8017 # sefip
acl Safe_ports port 2678 # sefip
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 Safe_ports port 12975 # HAMACHI
acl Safe_ports port 32976 # HAMACHI
acl Safe_ports port 17771 # HAMACHI
acl Safe_ports port 1935 # Orbit
acl Safe_ports port 53 # Outlook
acl purge method PURGE
acl CONNECT method CONNECT
acl horario src "/etc/squid/horario"
acl hora_negada time 19:00-23:59
acl hora_negada2 time 00:00-07:00
acl ip_sem_auth dst 192.168.1.0/24
acl sites_sem_senha dstdom_regex -i "/etc/squid/sites_sem_senha"
acl vip proxy_auth "/etc/squid/vip"
acl ip_liberados src "/etc/squid/ip_liberados"
acl senha proxy_auth REQUIRED
acl usuarios proxy_auth "/etc/squid/usuarios"
acl sites_bloqueados url_regex -i "/etc/squid/sites_bloqueados_string"
acl sites_bloqueados_url dstdom_regex -i "/etc/squid/sites_bloqueados_url"
#acl msn proxy_auth "/etc/squid/msn"
acl msnb1 req_mime_type -i ^application/x-msn-messenger$
acl msnb2 url_regex "/etc/squid/msnb2"
acl msnb3 url_regex -i gateway.dll
acl msnb dstdomain src "/etc/squid/msnb"
#acl msnb5 url_regex ^http://(63|64|65|66|207|[a-zA-Z]).*
acl sites_permitidos dstdom_regex -i "/etc/squid/sites_permitidos"
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 rede_interna
http_access allow localhost
http_access deny horario hora_negada
http_access deny horario hora_negada2
http_access allow ip_sem_auth
http_access allow sites_sem_senha
http_access allow vip
http_access allow ip_liberados
http_access deny !senha !vip !ip_liberados
http_access allow usuarios
http_access deny sites_bloqueados !vip !ip_liberados
http_access deny sites_bloqueados_url !vip !ip_liberados
http_access allow msnb1
http_access allow msnb2
http_access allow msnb3
http_access allow msnb
#http_access allow msnb5
http_access allow sites_permitidos usuarios
http_access deny usuarios
http_access allow rede_interna
http_access deny all !vip !ip_liberados
icp_access allow all
tcp_outgoing_address 192.168.1.1 !ip_sem_auth
authenticate_ip_ttl 2 hour
###########################################################
OBS: se tiver qualquer coisa errado, por favor, peço que me ajudem, é minha primeira experiência com servidor e peço paciência de vocês :)
DETALHES: O outlook não está rodando com contas pop do gmail (POP 995 com SSL e SMTP 587 com TLS)
Outra coisa, é que por algum motivo alguns sites que estão na lista negra de sites não são bloqueados para usuários com senha, mas se tentar navegar sem senha, o site é bloqueado normalmente.