Enviado em 08/01/2015 - 15:45h
http_port 3128 intercept
visible_hostname FIREWALL
error_directory /usr/share/squid3/errors/Portuguese
hierarchy_stoplist CGI-bin ?
cache_mgr admin@seu_dominio.com.br
acl QUERY urlpath_regex cgi-bin \?
no_cache deny QUERY
cache_mem 64 MB
maximum_object_size_in_memory 64 KB
maximum_object_size 512 MB
minimum_object_size 0 KB
cache_swap_low 90
cache_swap_high 95
cache_dir ufs /var/spool/squid3 2048 16 256
cache_access_log /var/log/squid3/access.log
refresh_pattern ^ftp: 15 20% 2280
refresh_pattern ^gopher: 15 0% 2280
refresh_pattern . 15 20% 2280
acl manager proto cache_object
acl localhost src 127.0.0.1/32
acl SSL_ports port 443 563
acl Safe_ports port 21 80 443 563 70 210 280 488 59 777 901 1025-65535
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
acl rede_local src 192.168.190.0/24
acl sites_bloqueados url_regex -i "/etc/squid3/sites_bloqueados.txt"
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
acl rede_local src 192.168.190.0/24
acl sites_bloqueados url_regex -i "/etc/squid3/sites_bloqueados.txt"
http_access deny sites_bloqueados all
http_access allow rede_local
http_access allow localhost
http_access deny all
iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -t nat -F
iptables -t mangle -F
#adicionando modulos no kernel;
modprobe ip_tables
modprobe iptable_nat
#liberando encaminhamento de pacotes;
echo "1" > /proc/sys/net/ipv4/ip_forward
#compartilhando a internet;
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
#Proxy transparente, tratando dos protocolos UDP e TCP, e movendo o trafego das portas 80,443 para porta 3128;
iptables -t nat -A PREROUTING -p tcp -m tcp --dport 80 -s 192.168.190.0/24 -j REDIRECT --to-port 3128
iptables -t nat -A PREROUTING -s 192.168.190.0/24 -p udp --dport 80 -j REDIRECT --to-port 3128
iptables -t nat -A PREROUTING -s 192.168.190.0/24 -p tcp --dport 443 -j REDIRECT --to-port 3128
iptables -t nat -A PREROUTING -s 192.168.190.0/24 -p udp --dport 443 -j REDIRECT --to-port 3128
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 3128