DNAT iptables bug or connection tracking issue?

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

 



Dear friends

I have a question, and I need your help to solve.

1) I have two routers in two different networks: one is a FreeBSD 7.0 router, here called "Router A" and another is a Debian 4.0 router, here called "Router B" 2) The Router A uses pf to make the firewall rules, with standard installation. The Router B have the kernel 2.6.25.4 and iptables 1.4.0 3) In the first router, I have a rule to access my vnc server in a windows machine. To make these, I need to create this rule rdr on sk0 proto tcp from any to <my external addr> port 5900 -> <my internal addr> port 5900
nat on sk0 proto tcp from <my internal addr> port 5900 to any -> sk0

In resume: I need to create a rule to make the redirection and, after these, I need to insert a rule to make the nat

4) In the second router, only adding this rule
iptables -t nat -I PREROUTING -i eth0 -p tcp --dport 5900 -j DNAT --to-destination <my internal addr> port 5900

THE RULES WORK PERFECTLY!

It's a bug? Because, in my vision, I need to create the two rules, the DNAT rule and the MASQUERADE rule to these work. Another point of view: If I need to permit only the machines A, B and C to access the VNC, in BSD, I only need to create these rules

my_servers="{ server_a_addr, server_b_addr, server_c_addr }"
rdr on sk0 proto tcp from any to <my external addr> port 5900 -> <my internal addr> port 5900
nat on sk0 proto tcp from <my internal addr> port 5900 to $my_servers -> sk0

or

rdr on sk0 proto tcp from $my_servers to <my external addr> port 5900 -> <my internal addr> port 5900
nat on sk0 proto tcp from <my internal addr> port 5900 to any -> sk0

How I can make these in iptables?

Thanks for your answer

--
+------------------------------------------
| Att | Lucas Willian Bocchi
| Departamento de Tecnologia da Informação
| Setor de Redes, Suporte e Desenvolvimento
| Irmãos Bocchi & CIA Ltda
+-------------------------------------------



------------------------------------------------
Os e-mails enviados por este domínio são verificados
por sistemas antivírus e antispam, visando a proteção
dos usuários e dos equipamentos de nossa empresa, bem como
para proteger o conteúdo e o trabalho de outros que
por ventura venham receber e-mails deste domínio.

O Grupo Bocchi se reserva no direito de, a qualquer
momento, bloquear ou inutilizar conteúdo de e-mails
que venham a ser prejudiciais para o ambiente de trabalho.

Caso este e-mail não possua conteúdo que seja relevante
à sua atividade profissional, ou a do usuário que a enviou,
por favor, delete-o imediatamente.

O Grupo Bocchi não se responsabiliza por qualquer dano ou prejuízo que a utilização indevida deste e-mail
possa causar a você ou sua empresa.

Em caso de dúvidas, favor entrar em contato.
---------------------------------------------


Grupo Irmãos Bocchi & Cia Ltda

http://www.ibocchi.com.br

--
To unsubscribe from this list: send the line "unsubscribe netfilter" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Netfilter Development]     [Linux Kernel Networking Development]     [Netem]     [Berkeley Packet Filter]     [Linux Kernel Development]     [Advanced Routing & Traffice Control]     [Bugtraq]

  Powered by Linux