[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Duvida iptables



Pessoal,

Depois de pesquisar muito na internet gostaria de um help de voces. o meu problema e o seguinte: Esou configurando um firewall ( versao 1.3.6 ) e squid ( 2.6.5 ) transparent e o que esta acontecendo e que as estacoes internas da rede nao entram no msn. O meu firewall possui duas interfaces de rede onde eth0 esta ligada ao link adsl ( velox ) e a eth1 ligada a rede interna. Pesquisei muito e nao consegui encontrar o erro. Os meus arquivos estao da seguinte forma. squid e iptables respectivamente: Desde já agradeço.

http_port 3128 transparent
hierarchy_stoplist cgi-bin ?
acl QUERY urlpath_regex cgi-bin \?
cache deny QUERY
acl apache rep_header Server ^Apache
broken_vary_encoding allow apache
access_log /var/log/squid/access.log squid
hosts_file /etc/hosts
refresh_pattern ^ftp:        1440  20%   10080
refresh_pattern ^gopher:     1440  0%    1440
refresh_pattern .       0     20%   4320
acl all src 0.0.0.0/0.0.0.0
acl LOCAL src 10.23.118.0/24
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       # https
acl SSL_ports port 563       # snews
acl SSL_ports port 873       # rsync
acl Safe_ports port 80       # http
acl Safe_ports port 21       # ftp
acl Safe_ports port 443      # https
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
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 allow LOCAL
http_access deny all
http_reply_access allow all
icp_access allow all
cache_effective_group proxy
coredump_dir /var/spool/squid
 

-----------------------------------------------------------------------------------------

#!/bin/bash

IPTABLES=/sbin/iptables

MODPROBE=/sbin/modprobe

echo "1" > /proc/sys/net/ipv4/ip_forward

$IPTABLES -F

$IPTABLES -t nat -F

$IPTABLES -t mangle -F

 

#######################################################

##                     MODULOS                       ##

#######################################################

$MODPROBE iptable_nat

$MODPROBE iptable_filter

$MODPROBE iptable_mangle

$MODPROBE ip_nat_ftp

$MODPROBE ip_conntrack_ftp

$MODPROBE ipt_MASQUERADE

$MODPROBE ipt_REDIRECT

 

#######################################################

##                     POLITICAS                     ##

#######################################################

$IPTABLES -P INPUT DROP

$IPTABLES -P OUTPUT DROP

$IPTABLES -P FORWARD DROP

 

#######################################################

##                  REGRAS INPUT                     ##

#######################################################

# PERMITE INTERFACE LOOPBACK

$IPTABLES -A INPUT -i lo -j ACCEPT

 

# PERMITE ACESSO A INTERNET DO FIREWALL

$IPTABLES -A INPUT -p tcp -m multiport --sport 1863,80,443,20,21 -j ACCEPT

 

# PERMITE ACESSO A INTERNET DO FIREWALL

$IPTABLES -A INPUT -p udp --sport 53 -j ACCEPT

 

# PERMITE ATUALIZACAO DINAMICA NO-IP

$IPTABLES -A INPUT -p tcp --sport 8245 -j ACCEPT

 

# PERMITE RESOLUCAO NOMES DNS

$IPTABLES -A INPUT -p udp -s 10.23.118.0/24 --dport 53 -j ACCEPT

 

# PERMITE ACESSO AO PROXY

$IPTABLES -A INPUT -p tcp -s 10.23.118.0/24 --dport 3128 -j ACCEPT

 

# PERMITE ACESSO AO MSN

$IPTABLES -A INPUT -p tcp -s 10.23.118.0/24 --dport 1863 -j ACCEPT

 

# TRAFEGO REDE EXTERNA

$IPTABLES -A INPUT -p tcp -i ppp+ -j ACCEPT

 

# PERMITE SSH

$IPTABLES -A INPUT -p tcp --dport 22 -j ACCEPT

 

# PERMITE ICMP

$IPTABLES -A INPUT -p icmp -j ACCEPT

 

# LOG

$IPTABLES -A INPUT -j LOG --log-prefix "BLOQUEIO INPUT "

 

#######################################################

##                  REGRAS OUTPUT                    ##

#######################################################

# PERMITE TODO TRAFEGO LOCAL PARA QUALQUER DESTINO

$IPTABLES -A OUTPUT -j ACCEPT

 

# PERMITE ATUALIZACAO DINAMICA NO-IP

$IPTABLES -A OUTPUT -p tcp --dport 8245 -j ACCEPT

 

# LOG

$IPTABLES -A OUTPUT -j LOG --log-prefix "BLOQUEIO OUTPUT "

 

#######################################################

##                       NAT                         ##

#######################################################

 

# REGRA DIRECIONAMENTO DEMAIS CONEXOES

$IPTABLES -t nat -A POSTROUTING -o ppp+ -j MASQUERADE

 

# PROXY TRANSPARENTE

$IPTABLES -t nat -A PREROUTING -i eth1 -p tcp --dport 80 -j REDIRECT --to-port 3128

 

 

#######################################################

##                 REGRAS FORWARD                    ##

#######################################################

# REGRAS ACESSO REDE INTERNA

$IPTABLES -A FORWARD -p tcp -s 10.23.118.0/24 -j ACCEPT

$IPTABLES -A FORWARD -p tcp -d 10.23.118.0/24 -j ACCEPT

 

# LOG

$IPTABLES -A FORWARD -j LOG --log-prefix "BLOQUEIO FORWARD "



Paulo Ferreira


Novos endereços, o Yahoo! que você conhece. Crie um email novo com a sua cara @ymail.com ou @rocketmail.com.
Reply to: