All of lore.kernel.org
 help / color / mirror / Atom feed
From: Olivier GRALL <olivier.grall@neotip.com>
To: iptables <netfilter@lists.netfilter.org>
Subject: SNAT/Masquerade binding ports generate conflicts
Date: Wed, 07 Dec 2005 16:28:32 +0100	[thread overview]
Message-ID: <4396FFA0.6020204@neotip.com> (raw)


Hi,

I have a problem using iptables as a NAT box. I'm testing a p2p VoIP 
system trying to establish UDP channels using something like STUN.

                      
------------         snat                        ------------    
                      ------------
|      A        |-----| X |-----<-->------ |   Server S  
|---<----->-----|        B      |
------------(p1)         \(P1)                ------------               
/  (P2) ------------
                                   \------<----->-------<---->-------/

X is iptables with a MASQUERADE (or SNAT) rule

1- A sends a packet to S from port p1
2- X opens port P1 (should be equal to p1)
3- S answers to A with a message containing UDP port of B
4- B knows port P1 of X thanks to S too
=> Sometimes A sends the first packets of the communication to B through 
X, then B can send packets to A too. Otherwise B sends the first packets 
and X seems to drop them (we can see icmp). Then A sends UDP packets to 
B and at this time iptables opens a new port 1024 for instance different 
from P1.
      It is like the uplet 
[(src=(@A,p1),dst=(@B,P2)),(src=(@X,P1),dst=(@B,P2))] wasn't  available 
anymore and so iptables changes P1 to P1'. Doing this, only one part of 
the uplet changes. I thought that conntrack forces the fact that for 
(@A,p1),(@B,P2) there is only a unique couple on the other side (= at 
the end of iptables treatments).

I used iptables 1.2.7a for that test. Anyone can tell me if  a recent 
version can solve this problem ?

Thanks.

Olivier GRALL.




             reply	other threads:[~2005-12-07 15:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-07 15:28 Olivier GRALL [this message]
  -- strict thread matches above, loose matches on Subject: below --
2005-12-08 14:50 SNAT/Masquerade binding ports generate conflicts Olivier GRALL

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4396FFA0.6020204@neotip.com \
    --to=olivier.grall@neotip.com \
    --cc=netfilter@lists.netfilter.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.