viniciuscomics
(usa Debian)
Enviado em 02/06/2013 - 10:21h
http_port 3128 transparent
visible_hostname Firewall
error_directory /usr/share/squid/errors/Portuguese/
Página 14cache_mem 64 MB
maximum_object_size_in_memory 64 KB
maximum_object_size 512 MB
minimum_object_size 0 KB
cache_swap_low 50
cache_swap_high 70
cache_dir ufs /var/spool/squid 2048 16 256
cache_access_log /var/log/squid/access.log
#cache_store_log /var/log/squid/store.log
#cache_swap_log /var/log/squid/cache_swap.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 localhost src 127.0.0.1/255.255.255.255
acl SSL_ports port 22 995 993 465
acl Safe_ports port 21 80 138 139 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
# Validação da rede local
acl redelocal src 10.78.2.0/24
# Bloqueio de sites por dominio
#acl sites url_regex -i "/etc/squid/bloqueados/sites"
#http_access deny sites
#acl
[*****] url_regex -i "/etc/squid/bloqueados/
[*****]"
#http_access deny
[*****]
# Bloqueio de arquivos por extensão
#acl extensao urlpath_regex -i "/etc/squid/bloqueados/extensao"
#http_access deny extensao
iptables .
#!/bin/bash
echo Inicializando regras do firewall
sleep 0
IF_WAN=eth1 # INTERFACE DE SAIDA PARA INTERNET
LAN=192.168.0.0/24 # ENDEREÇO PARA REDE LOCAL LAN
# LIMPA REGRAS DO FIREWALL
iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -F
iptables -t nat -F
echo "nameserver 10.78.2.253" > /etc/resolv.conf
echo "nameserver 8.8.8.8" >> /etc/resolv.conf
echo "nameserver 8.8.4.4" >> /etc/resolv.conf
Página 16# ATIVA O SISTEMA DE ROTEAMENTO DE PACOTES
echo 1 > /proc/sys/net/ipv4/ip_forward
# ATIVA O MODO DE MASQUERADE
iptables -t nat -A POSTROUTING -o $IF_WAN -j MASQUERADE #
Mascaramento de rede
# FORÇA A NAVEGACAO PELA PORTA 3128
iptables -t nat -A PREROUTING -p tcp -m tcp --dport 80 -s $LAN -j REDIRECT
--to 3128 # Forca navegacao na 3128
#iptables -t nat -A PREROUTING -p tcp -s $LAN --dport 1863 -j DROP