Enviado em 06/06/2017 - 17:59h
Pessoal boa tarde.
root@proxy:/etc/squid3# cat squid.conf
# Squid normally listens to port 3128
http_port 3128 intercept
visible_hostname proxy.controler
dns_nameservers 201.6.2.124 #208.67.222.222 #DNS do OPENDNS
dns_nameservers 208.67.220.220 #DNS do OPENDNS
maximum_object_size 16 MB
cache_dir ufs /var/spool/squid3 2048 16 256
# Leave coredumps in the first cache dir
coredump_dir /var/spool/squid3
always_direct allow all
#never_direct allow none
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern -i (/cgi-bin/|\?) 0 0% 0
refresh_pattern . 0 20% 4320
##ACLS
acl all src 0.0.0.0/0.0.0.0
acl localnet src 192.168.0.0/24
acl proibidos url_regex -i "/etc/squid3/sites_proibidos"
acl permitidos url_regex -i "/etc/squid3/sites_permitidos"
acl FullAccess src 192.168.0.49
acl redelocal src 192.168.0.0/24
#http_access allow localhost manager localnet
#http_access deny manager
#http_access deny !Safe_ports
#http_access deny CONNECT !SSL_ports
acl SSL_ports port 443 563
acl Safe_ports port 2095 # webmail
acl Safe_ports port 25 # smtp
acl Safe_ports port 587 # smtp
acl Safe_ports port 110 # pop
acl Safe_ports port 80 # http
acl Port_8080 port 8080 # prefeitura
acl Port_809 port 809 # SPtrans
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 563 # 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 37777 # intelbras portatil
acl Safe_ports port 7070 # intepbras http
acl Safe_ports port 8081 #grv
acl Safe_ports port 2021 # intepbras http
acl purge method PURGE
acl CONNECT method CONNECT
http_access allow Port_8080
http_access allow Port_809
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 !Safe_ports
http_access allow localhost
##Controle de acesso
http_access allow redelocal FullAccess
http_access allow permitidos
http_access deny proibidos
http_access allow localhost
http_access allow all
iptables -A INPUT -i eth1 -p tcp -m tcp --dport 3128 -j ACCEPT
iptables -A PREROUTING -t nat -s 192.168.0.0/24 -p tcp --dport 80 -j REDIRECT --to-port 3128