hudsonebert
(usa Debian)
Enviado em 08/03/2010 - 14:38h
Olá caros amigos, estou passando por um problema que estou batendo muito minha cabeça ultimamente não consigo liberar no meu firewall as portas 25 e 110 para que meus usuarios tenha acesso aos servidores de e-mail atraves do Outlook. Utilizo squid para dar acesso aos meus usuários.
Segue minhas configurações para que possam me ajudar.
Meu Firewall
#!/bin/bash
############################
#By: Hudson Ebert #
##########################
#Variaves da rede
IFLOCAL=lo
wan=eth0
lan=eth1
rede_local=192.168.0.0/24
#----------Limpa e inicializa os modulos
iptables -F
iptables -t nat -F
iptables -t mangle -F
modprobe iptable_nat
#----------Prox Trasnparente (Redireciona para o squid)- LAN -> Placa de rede Interna
iptables -t nat -A PREROUTING -i $lan -p tcp --dport 80 -j REDIRECT --to-port 3128
#----------Compartilhamento Internet - WAN -> Placa da Internet
iptables -t nat -A POSTROUTING -o $wan -j MASQUERADE
echo 1 > /proc/sys/net/ipv4/ip_forward
#----------Dns Resolucao de nomes
iptables -A FORWARD -p tcp -s $rede_local --dport 53 -j ACCEPT
iptables -A FORWARD -p udp -d $rede_local --dport 53 -j ACCEPT
#----------Libera acesso SSH
iptables -A INPUT -p tcp --sport 1024:65535 --dport 2222 -j ACCEPT
#----------Libera Acao Informatica
iptables -t nat -A PREROUTING -i $wan -p tcp --dport 1433 -j DNAT --to-destination 192.168.0.1:1433
iptables -t nat -A PREROUTING -i $wan -p tcp --dport 1435 -j DNAT --to-destination 192.168.0.1:1435
#----------E-MAIL
#iptables -A FORWARD -p tcp -s $rede_local --dport 110 -j ACCEPT
#iptables -A FORWARD -p tcp -d $rede_local --sport 110 -j ACCEPT
#iptables -A FORWARD -p tcp -s $rede_local --dport 25 -j ACCEPT
#iptables -A FORWARD -p tcp -d $rede_local --sport 25 -j ACCEPT
iptables -t nat -A POSTROUTING -p tcp --dport 25 -j MASQUERADE
iptables -t nat -A POSTROUTING -p tcp --dport 110 -j MASQUERADE
#----------Finalização Firewall
echo "FIREWALL CARREGADO COM SUCESSO"
Meu .Conf SQUID
http_port 192.168.0.254:3128 transparent
cache_mem 64 MB
cache_swap_low 90
cache_swap_high 95
maximum_object_size 500 MB
minimum_object_size 0 KB
cache_dir ufs /squid_cache 8000 16 256
cache_access_log /log/access.log
cache_log /log/cache.log
cache_store_log /log/store.log
pid_filename /var/run/squid.pid
error_directory /usr/share/squid/errors/Portuguese
emulate_httpd_log on
visible_hostname proxy.piemonte
cache_mgr
mime_table /usr/share/squid/mime.conf
ftp_user Squid@
ftp_list_width 32
ftp_passive on
ftp_sanitycheck on
ftp_telnet_protocol on
allow_underscore on
dns_nameservers 127.0.0.1 201.10.1.2 201.10.128.2
hosts_file /etc/squid/hosts
diskd_program /usr/lib/squid/diskd-daemon
unlinkd_program /usr/lib/squid/unlinkd
auth_param basic program /usr/lib/squid/ncsa_auth /etc/squid/passwd
auth_param basic children 5
auth_param basic realm Squid proxy-caching web server
auth_param basic credentialsttl 2 hours
auth_param basic casesensitive off
authenticate_cache_garbage_interval 1 hour
authenticate_ttl 1 hour
authenticate_ip_ttl 0 seconds
refresh_pattern ^ftp: 15 20% 2280
refresh_pattern ^gopher: 15 0% 2280
refresh_pattern . 15 20% 2280
hierarchy_stoplist cgi-bin ?
acl QUERY urlpath_regex cgi-bin \?
cache deny QUERY
acl apache rep_header Server ^Apache
broken_vary_encoding allow apache
# acl - Recomendadas
#*******************
#
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 # https, snews
acl SSL_ports port 873 # rsync
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 631 # cups
acl Safe_ports port 873 # rsync
acl Safe_ports port 901 # SWAT
acl purge method PURGE
acl CONNECT method CONNECT
#
# acl - Personalizadas
#*********************
# *** Define a rede interna (Intranet)
acl rede_local src 192.168.0.0/255.255.0.0
# Define autenticao dos usuario
acl usuarios_comuns proxy_auth REQUIRED
acl usuarios_vip proxy_auth -i "/etc/squid/list/admin"
#Define ip liberado fora do proxy
acl ip_liberado src "/etc/squid/list/ip_liberado"
#Define palavras Bloqueadas
acl palavras url_regex -i "/etc/squid/list/palavras"
#Define sites liberados
acl liberados url_regex -i "/etc/squid/list/liberados"
# *** Define os formatos de vídeo, áudio e outros de risco
acl video urlpath_regex .wma$ .asf$ .mov$ mpg$ .mpeg$ .avi$
acl audio urlpath_regex .mp3$ .wav$ .mid$
acl risco urlpath_regex .exe$ .pps$ .com$ .bat$ .scr$
# http_access - Recomendadas
#***************************
#
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 - Personalizadas
#*****************************
#Perminte acesso de usuarios vip
http_access allow usuarios_vip
#Bloqueia todo o acesso menos para sites liberados
http_access deny rede_local !liberados
#Bloqueia as palavras
http_access deny palavras
#Libera acesso usuarios comum
http_access allow usuarios_comuns
#Bloqueia todo o acesso
http_access deny all
#Outras permissoes
http_reply_access allow all
icp_access allow all
logfile_rotate 10
icon_directory /usr/share/squid/icons
coredump_dir /var/spool/squid
ie_refresh on
Gostaria que alguem me podesse me dizer onde estou errando ou o que está faltando, pois não consigo ver.
Grato
Hudson