renancasini
(usa Outra)
Enviado em 09/11/2012 - 10:46h
Olá bom dia!
Sou novo no forum gostaria de compartilhar a seguinte duvida:
Tenho um debian6 com firewall e squid em um cliente...
O problema é com o site:
http://www.biocenterlabor.com.br/ quando preencho os campos usuario e senha ele demora uns 2 minutos pra dar resposta e quando responde o squid bloqueia o site com a seguinte mensagem:
ERROR
The requested URL could not be retrieved
The following error was encountered while trying to retrieve the URL:
http://www.biocenterlabor.com.br/Default.aspx
Erro de leitura
O sistema retornou: (104) Connection reset by peer
An error condition occurred while reading data from the network. Please retry your request.
Your cache administrator is
Generated Fri, 09 Nov 20
Segue arquivo do firewall:
/etc/init.d/firewall [----] 0 L:[ 1+ 0 1/ 98] *(0 /4033b) 0035 0x023
#!/bin/sh
modprobe iptable_nat
iptables -F
iptables -t nat -F
iptables -X
echo "1" > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A PREROUTING -p tcp -i eth1 --dport 80 -j REDIRECT --to 3128
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
# Abre para uma faixa de endere.s da rede local
iptables -A INPUT -p tcp --syn -s 192.168.254.0/255.255.255.0 -j ACCEPT
# Abre uma porta (inclusive para a Internet)
iptables -A INPUT -p tcp --destination-port 22 -j ACCEPT
iptables -A INPUT -i lo -j ACCEPT
iptables -A INPUT -p tcp --destination-port 3389 -j ACCEPT
# Regra para bloquear o acesso ao MSN para a rede local
#iptables -A FORWARD -s 192.168.254.0/24 -p tcp --dport 1863 -j REJECT
# Ignora pings
#echo "1" > /proc/sys/net/ipv4/icmp_echo_ignore_all
# Protege contra synflood
echo "1" > /proc/sys/net/ipv4/tcp_syncookies
# Desabilita o suporte a source routed packets
# Esta recurso funciona como um NAT ao contr.io, que em certas circunstancias pode permitir que alguem de fora envie pacotes para micros dentro da rede local.
echo "0" > /proc/sys/net/ipv4/conf/eth0/accept_source_route
echo "0" > /proc/sys/net/ipv4/conf/eth1/accept_source_route
# echo "0" > /proc/sys/net/ipv4/conf/ppp0/accept_source_route
# Prote.o contra ICMP Broadcasting
echo "1" > /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts
# Bloqueia traceroute
iptables -A INPUT -p udp --dport 33435:33525 -j DROP
# Prote.es diversas contra portscanners, ping of death, ataques DoS, etc.
iptables -A FORWARD -p icmp --icmp-type echo-request -m limit --limit 1/s -j ACCEPT
iptables -A FORWARD -p tcp -m limit --limit 1/s -j ACCEPT
iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A FORWARD -p tcp --tcp-flags SYN,ACK,FIN,RST RST -m limit --limit 1/s -j ACCEPT
iptables -A FORWARD --protocol tcp --tcp-flags ALL SYN,ACK -j DROP
#iptables -A FORWARD -m unclean -j DROP
iptables -A INPUT -m state --state INVALID -j DROP
iptables -N VALID_CHECK
iptables -A VALID_CHECK -p tcp --tcp-flags ALL FIN,URG,PSH -j DROP
iptables -A VALID_CHECK -p tcp --tcp-flags ALL SYN,RST,ACK,FIN,URG -j DROP
iptables -A VALID_CHECK -p tcp --tcp-flags ALL ALL -j DROP
iptables -A VALID_CHECK -p tcp --tcp-flags ALL FIN -j DROP
iptables -A VALID_CHECK -p tcp --tcp-flags SYN,RST SYN,RST -j DROP
iptables -A VALID_CHECK -p tcp --tcp-flags SYN,FIN SYN,FIN -j DROP
iptables -A VALID_CHECK -p tcp --tcp-flags ALL NONE -j DROP
# Abre para a interface de loopback.
# Esta regra .essencial para o KDE e outros programas gr.icos funcionarem adequadamente.
iptables -A INPUT -p tcp --syn -s 127.0.0.1/255.0.0.0 -j ACCEPT
# Fecha as portas udp de 1 a 1024, abre para o localhost
iptables -A INPUT -p udp -s 127.0.0.1/255.0.0.0 -j ACCEPT
iptables -A INPUT -p udp -s 192.168.254.0/255.255.255.0 -j ACCEPT
iptables -A INPUT -p udp --dport 1:1024 -j DROP
# Redireciona uma faixa de portas para um micro da rede local
iptables -A FORWARD -p tcp -i eth0 --dport 3389:3389 -d 192.168.254.1 -j ACCEPT
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 3550:3550 -j DNAT --to-dest 192.168.254.251
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 3389:3389 -j DNAT --to-dest 192.168.254.1
iptables -A FORWARD -p tcp -i ppp0 --dport 3550:3550 -d 192.168.254.251 -j ACCEPT
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 4550:4550 -j DNAT --to-dest 192.168.254.251
iptables -A FORWARD -p tcp -i ppp0 --dport 4550:4550 -d 192.168.254.251 -j ACCEPT
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 5550:5550 -j DNAT --to-dest 192.168.254.251
iptables -A FORWARD -p tcp -i ppp0 --dport 5550:5550 -d 192.168.254.251 -j ACCEPT
# Esta regra .o cora.o do firewall do Kurumin,in,
# ela bloqueia qualquer conex. que n. tenha sido permitida acima, justamente por isso ela .a .tima da cadeia.
iptables -A INPUT -p tcp --syn -j DROP
# /etc/skel-fix/firewall-msg
firewall_stop(){
iptables -F
iptables -X
iptables -F -t nat
iptables -X -t nat
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
}
Arquivo do SQUID:
/etc/squid/squid.conf [----] 31 L:[ 1+20 21/ 86] *(600 /2745b) 0047 0x02F
# Configuracoes gerais
http_port 3128 transparent
visible_hostname LINUX
hierarchy_stoplist cgi-bin?
acl QUERY urlpath_regex cgi-bin \?
no_cache deny QUERY
cache_mem 350 MB
maximum_object_size_in_memory 100 KB
maximum_object_size 15360 KB
minimum_object_size 0 KB
ipcache_size 1024
ipcache_low 90
ipcache_high 95
cache_replacement_policy lru
memory_replacement_policy lru
logformat squid %ts.%03tu %6tr %>a %Ss/%03Hs %<st %rm %ru %un %Sh/%<A %mt
access_log /var/log/squid/access.log squid
cache_swap_low 90
cache_swap_high 95
cache_dir ufs /var/spool/squid 3000 16 256
cache_access_log /var/log/squid/access.log
cache_log /var/log/squid/cache.log
cache_swap_log /var/spool/squid/swap.log
cache_mgr Redes_e_Dados_TI
error_directory /usr/share/squid/errors/Portuguese
coredump_dir /var/spool/squid
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern . 0 20% 4320
# Definicao das ACLs
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 to_localhost dst 127.0.0.0/8
acl SSL_ports port 443 563 # snews
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 1025-65535 # unregistered ports
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 407 # msn
acl Safe_ports port 25 # smtp
acl Safe_ports port 110 # pop
acl purge method PURGE
acl CONNECT method CONNECT
# Downloads Bloqueados/Liberados e Palavras Bloqueadas
acl DownloadsLiberados url_regex -i "/etc/squid/downloads.allow"
acl DownloadsBloqueados url_regex -i "/etc/squid/downloads.deny"
acl PalavrasBloqueadas url_regex -i "/etc/squid/palavras.deny"
# Sites Bloqueados/Liberados
acl SitesLiberados url_regex -i "/etc/squid/sites.allow"
acl SitesBloqueados url_regex -i "/etc/squid/sites.deny"
# Grupos de Acesso
acl Diretoria src "/etc/squid/ip.diretoria"
acl Gerencia src "/etc/squid/ip.gerencia"
acl Funcionarios src "/etc/squid/ip.funcionarios"
# Ativando as ACLs Padrao
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
http_access allow localhost
http_access deny to_localhost
# Ativando as ACLs Personalizadas
http_access allow Diretoria
http_access allow SitesLiberados
http_access allow DownloadsLiberados
http_access deny DownloadsBloqueados
http_access allow Gerencia !SitesBloqueados
http_access deny PalavrasBloqueadas
http_access deny SitesBloqueados
http_access allow Funcionarios
http_access deny
Sites.Allow
/etc/squid/sites.allow [----] 0 L:[ 1+ 5 6/ 6] *(156 / 156b) <EOF>
loopbr.com.br
biocenterlabor.com.br
biocenterlabor.com.br/Default.aspx
www.biocenterlabor.com.br/Default.aspx
http://www.biocenterlabor.com.br/Default.aspx
O que me entriga é que mesmo navegando com ip de diretoria (que teoricamente seria acesso total) ele da esta mensagem...
Alguem ai pode me ajudar????