Rikke
(usa Fedora)
Enviado em 23/10/2012 - 11:26h
Galera Bom dia, to com o seguinte problema: redireciono no iptables para o porta do squid "transparente" alguns sites abrem mas outros não, ficam só carregando... Abaixo meu squid e firewall:
SQUID
#Porta default do proxy
http_port 192.168.0.254:3128 transparent
#O nome do servidor
visible_hostname ofcarquivos.local
#Cache
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/squid 2000 16 256
cache_access_log /var/log/squid/access.log
refresh_pattern ^ftp: 15 20% 2280
refresh_pattern ^gopher: 15 0% 2280
refresh_pattern . 15 20% 2280
#definicao servidor dns manual
dns_nameservers localhost 8.8.8.8 8.8.4.4
#Regras de acesso para rede local
acl manager proto cache_object
acl localhost src 192.168.0.0/24
acl SSL_ports port 443 563
acl Safe_ports port 80 #http
acl Safe_ports port 21 #ftp
acl Safe_ports port 70 #gopher
acl Safe_ports port 210 #wais
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 901 #swat
acl Safe_ports port 443 563 #https e snews
acl Safe_ports port 1025-65535 #portas altas
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
#Bloqueando por dominios e palavras
acl ipliberado src "/etc/squid/ip_liberado"
http_access allow ipliberado
acl bloqueados url_regex -i "/etc/squid/bloqueados"
http_access deny bloqueados
acl palavras dstdom_regex -i "/etc/squid/palavras"
http_access deny palavras
acl redelocal src 192.168.0.0/24
http_access allow redelocal
http_access deny all
FIREWALL
MP=/sbin/modprobe
RM=/sbin/rmmod
IPT=/sbin/iptables
ECHO=/bin/echo
$MP ip_tables
$MP iptable_filter
$MP ip_conntrack
$MP ipt_state
$MP iptable_nat
$MP ipt_MASQUERADE
$MP ipt_REJECT
$MP ipt_REDIRECT
$MP ipt_multiport
$ECHO "1" > /proc/sys/net/ipv4/ip_forward
# Limpa Tudo
$IPT -F
$IPT -X
$IPT -t nat -F
$IPT -t nat -X
$IPT -A INPUT -s 192.168.0.0/24 -j ACCEPT
# Libera Portas do Servidor
$IPT -A INPUT -p tcp -m multiport --dport 20,21,22,25,53,80,110,113,3126,161,3401,8291,5900,3128 -j ACCEPT
$IPT -A INPUT -p udp --dport 80 -j ACCEPT
$IPT -A INPUT -p udp --dport 53 -j ACCEPT
$IPT -A INPUT -p udp --dport 161 -j ACCEPT
$IPT -A INPUT -s 192.168.0.0/24 -p tcp -m multiport --dport 80,137,138,139,161 -j ACCEPT
$IPT -A INPUT -s 192.168.0.0/24 -p udp -m multiport --dport 80,137,138,139,161 -j ACCEPT
$IPT -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
$IPT -A INPUT -p tcp --dport 3126 -j ACCEPT
$IPT -A INPUT -p tcp --dport 3128 -j ACCEPT
# Forward
$IPT -A FORWARD -j ACCEPT -i em1 -s 192.168.0.0/24
$IPT -A FORWARD -j ACCEPT -i eth1 -s 192.168.0.0/24
$IPT -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
#$IPT -A FORWARD -j ACCEPT -i em1 -s 192.168.2.0/24
# Nat/Masquerading
$IPT -t nat -A POSTROUTING -s 192.168.0.0/24 -o em1 -j MASQUERADE
$IPT -t nat -A POSTROUTING -s 192.168.0.0/24 -o eth1 -j MASQUERADE
#Habilitando o Proxy Transparente ( Squid )
#$IPT -t nat -A PREROUTING -s 192.168.0.0/24 -p tcp --dport 80 -j DNAT --to-dest 192.168.0.254:3128
#$IPT -t nat -A PREROUTING -s 192.168.0.0/24 -p tcp --dport 80 -j REDIRECT --to-port 3128
# Redirecionamento de portas para Acesso Remoto
$IPT -t nat -A PREROUTING -d 192.168.2.254 -p tcp --dport 2244 -j DNAT --to-dest 192.168.0.254
$IPT -t nat -A PREROUTING -d 192.168.2.254 -p tcp --dport 8291 -j DNAT --to-dest 192.168.2.254:8291
$IPT -t nat -A PREROUTING -d 192.168.2.254 -p tcp --dport 3389 -j DNAT --to-dest 192.168.0.1
# Redirecionamento porta SQL
#$IPT -t nat -A PREROUTING -d 187.49.253.130 -p tcp --dport 1433 -j DNAT --to-dest 192.168.0.100:1433
#Redirecionamento Portas Cameras
$IPT -t nat -A PREROUTING -d 189.111.140.210 -p tcp --dport 80 -j DNAT --to-dest 192.168.0.250
$IPT -t nat -A PREROUTING -d 189.111.140.210 -p tcp --dport 34567 -j DNAT --to-dest 192.168.0.250
# SISTEMA DE LOG DO MSN
#$IPT -t filter -A INPUT -i eth1 -p tcp .dport 1863 -j ACCEPT
#$IPT -t filter -A FORWARD -i eth1 -p tcp .dport 1863 -j ACCEPT
#$IPT -t nat -I PREROUTING -i eth1 -p tcp .dport 1863 -j REDIRECT .to-port 16667
#$ECHO -n "Ativando Proxy Transparente..................." ; sleep 1s ;
#$IPT -t nat -A PREROUTING -s 192.168.0.0/24 -p tcp --dport 80 -j REDIRECT --to-port 3128
#echo "[OK]"
$ECHO -n "Bloquear Ping da Morte..................." ; sleep 1s ;
echo "0" > /proc/sys/net/ipv4/icmp_echo_ignore_all
$IPT -N PING-MORTE
$IPT -A INPUT -p icmp --icmp-type echo-request -j PING-MORTE
$IPT -A PING-MORTE -m limit --limit 1/s --limit-burst 4 -j RETURN
$IPT -A PING-MORTE -j DROP
echo "[OK]"
$ECHO -n "Bloquear ataque do tipo SYN-FLOOD..................." ; sleep 1s ;
echo "0" > /proc/sys/net/ipv4/tcp_syncookies
$IPT -N syn-flood
$IPT -A INPUT -i em1 -p tcp --syn -j syn-flood
$IPT -A syn-flood -m limit --limit 1/s --limit-burst 4 -j RETURN
$IPT -A syn-flood -j DROP
echo "[OK]"
$ECHO -n "Bloqueio de Ataque SSH de Forca Bruta..................." ; sleep 1s ;
$IPT -N SSH-BRUT-FORCE
$IPT -A INPUT -i em1 -p tcp --dport 22 -j SSH-BRUT-FORCE
$IPT -A SSH-BRUT-FORCE -m limit --limit 1/s --limit-burst 4 -j RETURN
$IPT -A SSH-BRUT-FORCE -j DROP
echo "[OK]"
#/usr/bin/tail -f /var/log/secure | /usr/local/sbin/sshguard &
Alguém poderia ajudar, seria de grande favor, fico no aguardo.