ricardoferrari
(usa Outra)
Enviado em 21/12/2015 - 11:18h
Meu Squid ano esta funcionado, ainda não coloquei as regras de bloqueios, mas como não tem nenhuma regra ele tinha que bloquear o site, mas não esta bloqueando. a internet entra pela placa ETH0 com ip 192.168.0.36 e a rede pela placa eht1 com ip 10.1.1.1.
arquivo /etc/squid3/squid.conf
http_port 3128 intercept
visible_hostname debian
acl manager proto cache_object
acl localhost src 127.0.0.1/32
acl SSL_ports port 443 563
acl Safe_ports port 80
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-mgm
acl Safe_ports port 488 # gss-http
acl Safe_ports port 591 # filemaker
acl Safe_ports port 777 # multiling http
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 redelocal src 10.1.1.0/24
http_access allow localhost
http_access allow redelocal
http_access deny all
hierarchy_stoplist CGI-bin ?
error_directory /usr/share/squid3/errors/Portuguese
cache_mgr assistecia@officemineiros.com.br
acl QUERY urlpath_regex cgi-bin \?
no_cache deny QUERY
# CONFIGURAÇAO DA CACHE
#Tamanho da cache na memoria
cache_mem 1024 MB
#Tamanho do arquivo na memoria
maximum_object_size_in_memory 256 KB
#Tamanho do arquivo no HD
maximum_object_size 512 MB
minimum_object_size 0 KB
#Limite de utilizaçao do cache
cache_swap_low 85
cache_swap_high 95
#limites da cache no HD
cache_dir ufs /var/spool/squid3 5120 16 256
# registros de log do cache
cache_access_log /var/log/squid/access.log
#tempo de atualizaçao do cache
refresh_pattern ^ftp: 15 20% 2280
refresh_pattern ^gopher: 15 0% 2280
refresh_pattern . 15 20% 2280
arquivo /firewall.sh
#!/bin/bash
mod
probe iptables_nat
echo 1 > /proc/sys/net/ipv4/ip_forward
#
iptables -F
iptables -X
iptables -t nat -F
iptables -t nat -X
iptables -t mangle -F
iptables -t mangle -X
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT ACCEPT
iptables -A INPUT -i lo -j ACCEPT
iptables -A INPUT -m state --state ESTABILISHED,RELATED -j ACCEPT
iptables -A FORWARD -m state --state ESTABILISHED,RELATED -j ACCEPT
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
iptables -t nat -A PREROUTING -s 10.1.1.1/255.255.255.0 -p tcp --dport 80 -j REDIRECT --to-port 3128