kakashi963
(usa Debian)
Enviado em 24/02/2011 - 19:36h
Boa noite.
Tenho configurado aqui o squid + iptables. Não consigo acessar o endereço 186.195.37.91:9001 de forma alguma. Quando faço o scanner no site
http://www.gwebtools.com.br/scanner-porta as portas que eu liberei não funcionam...
A configuração dos dois é bem básica, abaixo tenho o squid.conf
http_port 3128 transparent
visible_hostname servidorTemp
cache_mem 350 MB
maximum_object_size_in_memory 200 KB
maximum_object_size 100 MB
minimum_object_size 0 KB
cache_swap_low 90
cache_swap_high 95
cache_dir ufs /var/spool/squid 2048 16 256
cache_access_log /var/log/squid/access.log
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 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 280 # http-mgmt
acl Safe_ports port 488 # gss-http
acl Safe_ports port 591 # filemaker
acl Safe_ports port 901 # swat
acl Safe_ports port 25 # email
acl Safe_ports port 1025-65535 # portas altas
acl purge method PURGE
acl CONNECT method CONNECT
acl palavrasBloqueadas dstdom_regex "/etc/squid/palavrasBloqueadas"
acl sitesLiberados url_regex -i "/etc/squid/sitesLiberados"
acl ipsLiberados src "/etc/squid/ipsLiberados"
acl ipsLiberadosRestritos src "/etc/squid/ipsLiberadosRestritos"
acl extban url_regex -i \.avi\.exe\.mp3\.torrent
http_access deny extban
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 redelocal src 192.168.0.0/24
http_access allow ipsLiberados
http_access deny palavrasBloqueadas
http_access allow ipsLiberadosRestritos
http_access allow sitesLiberados
http_access allow localhost
http_access deny all
e agora a configuração do Iptables
modprobe iptable_nat
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -o eth2 -j MASQUERADE
iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 80 -j REDIRECT --to-port 3128
echo 1 > /proc/sys/net/ipv4/conf/default/rp_filter
iptables -A INPUT -m state --state INVALID -j DROP
iptables -A INPUT -i lo -j ACCEPT
iptables -A INPUT -i $iflocal -j ACCEPT
iptables -A INPUT -p tcp --dport 22 -j ACCEPT
iptables -A INPUT -p tcp --dport 21 -j ACCEPT
iptables -A INPUT -i eth1 -p tcp --dport 3128 -j ACCEPT
iptables -A INPUT -p tcp --dport 9000 -j ACCEPT
iptables -A INPUT -p tcp --dport 9001 -j ACCEPT
iptables -A INPUT -p tcp --dport 9000 -j ACCEPT
iptables -A INPUT -p tcp --dport 443 -j ACCEPT