medydal
(usa KUbuntu)
Enviado em 10/11/2009 - 18:17h
meus amigos estou fazendo aos poucos, e o proxi já esta rodando e agora esta dando erro tipo como se tivesse travado, mas vejo nos logos e esta tudo bem
olha ai meu arquivo do iptables que salvei no rc.local
#!/bin/bash
## limpa as tabelas das regras, nada a ser mudado aqui
iptables -F
iptables -X
iptables -t nat -F
iptables -t nat -X
iptables -t filter -F
iptables -t filter -X
iptables -t mangle -F
iptables -t mangle -X
# Habilita roteamento
modprobe iptable_nat
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
# Habilita PROXY TRANSPARENTE
iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 80 -j REDIRECT --to-port 3128
# Portas abertas
iptables -A INPUT -p tcp --destination-port 22 -j ACCEPT
iptables -A INPUT -p tcp --destination-port 491 -j ACCEPT
iptables -A INPUT -p tcp --destination-port 53 -j ACCEPT
iptables -A INPUT -p tcp --destination-port 3128 -j ACCEPT
iptables -A INPUT -p tcp --destination-port 80 -j ACCEPT
iptables -A INPUT -p tcp --destination-port 443 -j ACCEPT
iptables -A FORWARD -p tcp --dport 491 -j ACCEPT
# Libera portas pop3 e smtp
iptables -A FORWARD -p udp -s 192.168.7.0/24 -d 172.17.1.5 --dport 53 -j ACCEPT
iptables -A FORWARD -p udp -s 172.17.1.5 --sport 53 -d 192.168.7.0/24 -j ACCEPT
iptables -A FORWARD -p TCP -s 192.168.7.0/24 --dport 25 -j ACCEPT
iptables -A FORWARD -p TCP -s 192.168.7.0/24 --dport 110 -j ACCEPT
iptables -A FORWARD -p tcp --sport 25 -j ACCEPT
iptables -A FORWARD -p tcp --sport 110 -j ACCEPT
# Proteçs diversas contra portscanners, ping of death, ataques DoS, etc.
iptables -A FORWARD -p icmp --icmp-type echo-request -m limit --limit 1/s -j DROP
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
# Abre para a interface de loopback.
iptables -A INPUT -i lo -j ACCEPT
# BLOQUEA O QUE NAO SE ENCAIXA NAS REGRAS ACIMA
iptables -A INPUT -p tcp --syn -j DROP
iptables -P FORWARD DROP
## FIM DO ARQUIVO ##
exit 0
e este aqui é meu squid.conf
#porta padrão
http_port 3128 transparent
visible_hostname zucavelBloqueadoPORCleyson
hierarchy_stoplist cgi-bin ?
cache_mem 256 MB
maximum_object_size_in_memory 1024 KB
maximum_object_size 1024 KB
minimum_object_size 0 KB
cache_swap_low 90
cache_swap_high 95
cache_dir ufs /var/spool/squid 600 16 256
cache_access_log /var/log/squid/access.log
ftp_user Squid@
#ACLS
acl all src 192.168.7.0/255.255.255.0
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 # 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 25 # smtp
acl Safe_ports port 110 # pop3
########################## DECLARANDO AS ACLs #############################
# PCs com acesso total
acl acesso_total src "/etc/squid/acesso_total"
http_access allow acesso_total
#bloqueio do MSN
acl msn dst 207.46.110.0/24 207.46.104.0/24 64.4.13.0/24 192.168.7.0/24
http_access deny msn
acl bloqmessenger url_regex
www.e-messenger.net webmessenger.msn.com
http_access deny bloqmessenger
#lista de bloqueios
acl bloqueado url_regex -i "/etc/squid/bloqueado"
http_access deny bloqueado
#lista de liberados
acl liberado url_regex -i "/etc/squid/liberado"
http_access allow liberado
############################# ATIVANDO AS ACLs ################################
acl redelocal src 192.168.7.0/24
http_access allow liberado
http_access deny bloqueado
http_access allow redelocal !msn
http_access deny all
error_directory /usr/share/squid/errors/Portuguese
me ajudem por favor.
no aguardo