ironlion
(usa CentOS)
Enviado em 24/08/2012 - 21:34h
SQUID.CONF:
#############################################################
http_port 3128
visible_hostname firewall
cache_mem 256 MB
maximum_object_size_in_memory 64 KB
maximum_object_size 100 MB
minimum_object_size 2 KB
cache_swap_low 90
cache_swap_high 95
cache_dir ufs /var/spool/squid 2048 16 256
cache_access_log /var/log/squid/access.log
refresh_pattern ^ftp: 15 20% 2280
refresh_pattern ^gopher: 15 0% 2280
refresh_pattern . 15 20% 2280
acl all src 0.0.0.0/0.0.0.0
acl manager proto cache_object
acl webserver src 192.168.1.247/255.255.255.255
http_access allow manager webserver
http_access deny manager
acl localhost src 127.0.0.1/255.255.255.255
acl SSL_ports port 443 563
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 563 # https, snews
acl Safe_ports port 70 # gopher
acl Safe_ports port 210 # wais
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 901 # swat
acl Safe_ports port 1025-65535 # portas altas
acl purge method PURGE
acl CONNECT method CONNECT
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
#------------------------- SITES BLOQUEADOS PARA TODA A REDE ------------------------#
#
acl sites_maliciosos url_regex -i "/etc/squid/regras/sites_maliciosos"
http_access deny sites_maliciosos
#
#
#
#------------------------- IPs SEM RESTRICOES ---------------------------------------#
#
acl ip_liberado_total src "/etc/squid/regras/ip_liberado_total"
http_access allow ip_liberado_total
#
#
#
#------------------------- PALAVRAS BLOQUEADAS --------------------------------------#
#
acl palavras_proibidas dstdom_regex "/etc/squid/regras/palavras_proibidas"
http_access deny palavras_proibidas
#
#
#
#------------------------- EXTENSOES PROIBIDAS --------------------------------------#
#
acl extensoes_proibidas url_regex -i "/etc/squid/regras/extensoes_proibidas"
http_access deny extensoes_proibidas
#
#
#
#------------------------- LIBERAR SITES HORARIO ALMOCO -----------------------------#
#
#acl liberar_almoco time 12:00-13:00
#http_access allow liberar_almoco
#
#
#
#------------------------- SITES BLOQUEADOS NIVEL 1 ---------------------------------#
#
acl sites_bloqueados_N1 url_regex -i "/etc/squid/regras/sites_bloqueados_N1"
http_access deny sites_bloqueados_N1
#
#
#
#------------------------- IPs LIBERADOS NIVEL 1 ------------------------------------#
#
acl ip_liberado_N1 src "/etc/squid/regras/ip_liberado_N1"
http_access allow ip_liberado_N1
#
#
#
#------------------------- BLOQUEAR MSN ---------------------------------------------#
#
acl blqmsn dstdomain passport.com
http_access deny blqmsn
#
acl msnmessenger url_regex -i gateway.dll
http_access deny msnmessenger
#
acl MSN req_mime_type -i ^application/x-msn-messenger$
http_access deny MSN
#
#
#
#------------------------- SITES BLOQUEADOS NIVEL 2 ---------------------------------#
#
acl sites_bloqueados_N2 url_regex -i "/etc/squid/regras/sites_bloqueados_N2"
http_access deny sites_bloqueados_N2
#
#
#
#------------------------- IPs LIBERADOS NIVEL 2 ------------------------------------#
#
acl ip_liberado_N2 src "/etc/squid/regras/ip_liberado_N2"
http_access allow ip_liberado_N2
#
#
#
#------------------------- SITES PERMITIDOS NIVEL 3 ---------------------------------#
#
acl sites_permitidos_N3 url_regex -i "/etc/squid/regras/sites_permitidos_N3"
http_access allow sites_permitidos_N3
#
#
#
http_access allow localhost
http_access deny all
error_directory /usr/share/squid/errors/pt-br
#######################################################################################
IPTABLES:
iptables --append FORWARD -s 192.168.1.0/24 --in-interface eth1 -j ACCEPT
iptables -A INPUT -s 192.168.1.0/24 -j ACCEPT
E, dentro do arquivo SYSCTL.CONF, a linha NET.IPV4.IP_FORWARD = 1