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

Re: [.Iptables+DMZ] Ayuda! gran Dolor de cabeza !



On Wed, 26 Jan 2005 10:36:34 -0300, Nelson Lopez <nlopez@cchen.cl> wrote:
> Hola amigos;
> 
> Sistema : Debian Sarge 3.1
> Kernel : 2.4.27-1-386
> 
> les escribo este email pidiendo ayuda a ustedes ya que me he quebrado la
> cabeza ya mas de 3 dias enteros sin descanso ni siquiera colacion =/..
> 
> les cuento tengo la necesidad de montar en mi trabajo un firewall que
> proteja mis servidores y mi red interna por ejemplo
> 
>                    inet
>                      |
>                      |
>                    eth0 ( ip publica fija )
>                      |
>                      |
>                -------------
>                | linux box |-------- eth2 ( LAN )------ XXXXX
>                -------------
>               /
>              /
>             eth1 ( dmz )
>            192.168.10.99/255.255.255.0
>             |
>             |
>             |
>           eth0 ( WWW )
> 192.168.10.100/255.255.255.0
> 
> para esto he estado probando muchos scripts y otros que he ido haciendo
> yo y que no funcionan. *raro* ya que las reglas se ven si hago un
> *iptables -nvL ó iptables -t nat -nvL*, sinceramente no se que pasa !.
> 
> pueden echarme una mano amigos ? ó quisas darme alguna guia o algo por
> el estilo ?.-.
> 
> aqui pego el ultimo script que estube probando,
> 
> rei:~# cat dmz_fwl_lan
> #!/bin/bash
> ################## Habilitando eht1  ####################
> puerto_dmz="eth1"
> ip_dmz="192.168.10.99"
> ifconfig $puerto_dmz down
> ifconfig $puerto_dmz $ip_dmz netmask 255.255.255.0 up
> #ifconfig $puerto_dmz up
> #########################################################
> ################## Reglas de Basicas ####################
> iptables -F
> #iptables -X
> iptables -F -t nat
> #iptables -X -t nat
> iptables -t nat -A POSTROUTING -o eth0 -j  MASQUERADE -s 192.168.10.0/24
> iptables -P FORWARD DROP
> iptables -A FORWARD -j ACCEPT -p UDP
> iptables -A FORWARD -j ACCEPT -p ICMP
> iptables -A FORWARD -mstate --state NEW,ESTABLISH,RELATED -j ACCEPT
> 
> modprobe ip_nat_irc
> modprobe ip_nat_ftp
> modprobe ip_conntrack_ftp
> modprobe ip_conntrack_irc
> 
> echo "1" > /proc/sys/net/ipv4/ip_forward
> #########################################################
> ################ Servicios ###############################
> PORT_USR="21 22 25 53 80 110 443 8080"
>    for PORT in $PORT_USR; do
>    iptables -A FORWARD -p tcp --dport $PORT -j ACCEPT
>    done
> ##########################################################
> ################ DMZ #####################################
> IP_EXT="200.72.xxx.yyy"
> IP_DMZ="192.168.10.100"
> PORT_DMZ="80 20 21 22 25 110 443 8080"
>    for PORT_DEMEZETA in $PORT_DMZ; do
>      iptables -t nat -A PREROUTING -i eth0 -d $IP_EXT -p TCP --dport
> $PORT_DEMEZ ETA -j DNAT --to-destination $IP_DMZ
>    done
> 
Esta regla se crean bien ??? 
tenes un espacio entre la Z y la E  en $PORT_DEMEZ ETA !!!!

> ##########################################################
> rei :~#
> 
> Disculpen lo largo de este Email. pero ya me he vuelto loco :(..
> 
> Nelson Lopez V.
> 
> --
> To UNSUBSCRIBE, email to debian-user-spanish-REQUEST@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
> 
> 

Yo probaria lo siguiente.
en la parte en donde haces el prerouting, pasale el port, osea 
iptables -t nat -A PREROUTING ........  --to-destination $IP_DMZ:$PORT_DEMEZETA

Y fijate con iptables -t nat -nvL aparte si las reglas estan, los pkts
y  bytes de las reglas.... para ver que es lo que esta filtrando y
dejando pasar, y en la tabla de filter tambien.


Saludos.



Reply to: