robson_lem
(usa Debian)
Enviado em 25/06/2010 - 09:33h
Bom dia Pessoal
Desde ja Agradeço.
Asssunto:
Não estou conseguindo liberar o msn. Para ele funcionar tive que comentar a acl msn, alguem tem uma dica.
#####Segue Squid.conf
http_port 3128 transparent
visible_hostname ServerNet
cache_mem 1300 MB
maximum_object_size_in_memory 84 KB
maximum_object_size 104 MB
minimum_object_size 0 KB
cache_swap_low 90
cache_swap_high 95
cache_dir ufs /var/spool/squid3 120048 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
error_directory /usr/share/squid3/errors/Portuguese
coredump_dir /var/spool/squid3
acl alll src 192.10.10.0/24
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl SSL_ports port 443 563
acl Safe_ports port 80
acl Safe_ports port 21
acl Safe_ports port 443 563
acl Safe_ports port 70
acl Safe_ports port 210
acl Safe_ports port 1025-65535
acl Safe_ports port 280
acl Safe_ports port 488
acl Safe_ports port 591
acl Safe_ports port 777
acl Safe_ports port 901
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 msn url_regex -i gateway.dll
acl msnd dstdomain "/etc/squid3/msn_bloqueado"
acl msn1 req_mime_type application/x-msn-messenger
http_access deny msnd
http_access deny msn
http_access deny msn1
acl bloqueiadownloads url_regex -i .exe$ .zip$ .rar$ .rmvb$ .mp3$ .iso$ .msi$ .mjpg$ .mp4$ .ram$ .avi$ .wav$
acl acesso_total src "/etc/squid3/acesso_total"
acl download_liberado src "/etc/squid3/download_liberado"
acl sites_liberados dstdom_regex "/etc/squid3/sites_liberados"
acl sites_bloqueados dstdom_regex "/etc/squid3/sites_bloqueados"
http_access deny bloqueiadownloads !download_liberado !sites_liberados
http_access deny sites_bloqueados !acesso_total
http_access allow acesso_total sites_bloqueados
http_access deny msnd
http_access deny msn
http_access deny msn1
_________________________________________________________________
#Firewall
#!/bin/sh
#Rede Interna=eth0
#Internet=eth1
iniciar(){
# Carrega Modulos
modprobe ip_tables
modprobe iptable_nat
modprobe ip_conntrack
modprobe ip_nat_ftp
modprobe ipt_REJECT
modprobe ipt_MASQUERADE
# Aceita Pacotes Não Bloqueados
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
# Define Pasta da Lista de MACS
MACLIST='/etc/squid3/tabela'
# Define Variaveis
for i in `cat $MACLIST`; do
IPSOURCE=`echo $i | cut -d ';' -f 1`
MACSOURCE=`echo $i | cut -d ';' -f 2`
# Diretivas de Bloqueio IP/MAC
iptables -t filter -A FORWARD -d 0/0 -s $IPSOURCE -m mac --mac-source $MACSOURCE -j ACCEPT
iptables -t filter -A FORWARD -d $IPSOURCE -s 0/0 -j ACCEPT
iptables -t filter -A INPUT -s $IPSOURCE -d 0/0 -m mac --mac-source $MACSOURCE -j ACCEPT
iptables -t nat -A POSTROUTING -s $IPSOURCE -o eth2 -j MASQUERADE
done
# Compartilha a Conexão
echo 1 > /proc/sys/net/ipv4/ip_forward
echo "Compartilhamento e Firewall..................[ OK ] ATIVADO"
# Bloqueia Acesso
iptables -P INPUT DROP
iptables -P FORWARD DROP
# Ativa Proxy Transparente:
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 3128
echo "Proxy Transparente...........................[ OK ] ATIVADO"
MSNLIST='/etc/squid3/msn_bloqueado'
for IP in `cat $MSNLIST`;do
IPS=`echo $IP`
iptables -I FORWARD -s $IPS -p tcp --dport 1863 -j REJECT
#iptables -I FORWARD -s $IPS -p tcp --dport 443 -j REJECT
done
# Bloqueia as Portas UDP de 0 a 1023:
#libera tudo para um ip
#iptables -A INPUT -s 192.168.10.13 -d 192.168.10.1 -j ACCEPT
#iptables -A INPUT -s 192.168.10.1 -d 192.168.10.13 -j ACCEPT
#iptables -A OUTPUT -s 192.168.10.13 -d 192.168.10.1 -j ACCEPT
#iptables -A OUTPUT -s 192.168.10.1 -d 192.168.10.13 -j ACCEPT
#iptables -A FORWARD -s 192.168.10.13 -d 192.168.10.1 -j ACCEPT
#iptables -A FORWARD -s 192.168.10.1 -d 192.168.10.13 -j ACCEPT
iptables -A INPUT -p udp --dport 0:1023 -j DROP
iptables -A INPUT -i lo -j ACCEPT
}
parar(){
# Zera Regras e Desativa Compartilhamento e Firewall
iptables -F
iptables -X
iptables -F -t nat
iptables -X -t nat
iptables -F -t filter
iptables -X -t filter
iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
echo 0 > /proc/sys/net/ipv4/ip_forward
echo "Compartilhamento e Firewall..................[ OK ] DESATIVADO"
echo "Proxy Transparente...........................[ OK ] DESATIVADO"
}
case "$1" in
"start") iniciar ;;
"stop") parar ;;
"restart") parar; iniciar ;;
*) echo "Use os parâmetros start,stop ou restart"
esacs