From: Eliezer Croitoru <eliezer@ngtech.co.il>
To: "Jörn Krebs" <jk@smartbyte.de>
Cc: netfilter <netfilter@vger.kernel.org>
Subject: Re: Fwd: VoIP conntrack issue
Date: Wed, 14 Nov 2012 03:43:19 +0200 [thread overview]
Message-ID: <50A2F737.6060403@ngtech.co.il> (raw)
In-Reply-To: <CABY2qi8tfLaP05Y2227nn8ZsaPF2DVeozJd1SjQpxePnFXzVHA@mail.gmail.com>
Hey Jörn,
You seem to not understand yet what MASQUERADE means.
I have tried to explain it to you but...
NAT is not suppose to do what you are saying but more to allow specific
function which your usage and UDP protocols in general have problem
since they based on L2 for each packet which cannot be a basis for
connection establishment and other part that exists in TCP.
Connection tracking should have capabilities to make things more simple
in some cases but in this specific case the only full solution will be
to DNAT the RTP stream.
The best thing I can recommend you that will make sense to you is "how
nat works"
cisco has a nice doc on it here:
http://www.cisco.com/en/US/tech/tk648/tk361/technologies_tech_note09186a0080094831.shtml
look at the category: Dynamic NAT and Overloading Examples.
if the device has static ip in the network from dhcp use iptables with dnat.
Regards,
Eliezer
On 11/14/2012 3:31 AM, Jörn Krebs wrote:
> Hi Eliezer,
>
> I think I missed to explain something here: RTP is not one packet
> send, RTP is more like a stream of data,
> and with this stream it can happen, that open packet arrives before another.
> (That's why the log shows the connection from GMX to my host first,
> before my phone sends data to that host, but this is more by luck.
> Usually my phone should try to establish a connection to GMX first (so
> to say "open" the NAT for that IP port combination), and then GMX
> should send data "back".)
>
> So when I say I have a connection from GMX to my Phone, at the same
> time the phone tries to establish a connection the other way around,
> but the SIP protocol is managing the ports.
> So over SIP both clients (GMX and my phone) agree to operate on
> specific ports. Lets say 2000 for GMX and 3000 for my phone.
>
> The firewall is expected to do a symmetric NAT, which means if my
> phone sends data to GMX port 2000 and it is using port 3000 as the
> source port, it is expected that the router uses the same port as his
> external port
> .... because, when GMX send it's RTP stream back it will use port 3000
> as the destination port (because they agreed on the port in the SIP
> session, GMX does not detect the port it gets data from!!!!)
> The NAT then should already have a rule, because my internal client of
> cause send data to GMX port 2000 using port 3000 as the source port,
> because both clients agreed up on in the initial SIP negotiation
> phase.
> And that's my complaint. Linux is changing the ports. It is using a
> different source port for the internal connection to GMX, changing it
> to 1030.
>
> This port change is not like a symmetrical NAT should behave, and I
> like to know why linux is changing the port and not using the source
> port of the client, and how can I avoid this kind of behaviour?
>
> I think you are just looking at the problem from a different angle.
>
> Thanks, Joern.
--
Eliezer Croitoru
https://www1.ngtech.co.il
IT consulting for Nonprofit organizations
eliezer <at> ngtech.co.il
next prev parent reply other threads:[~2012-11-14 1:43 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-13 2:49 VoIP conntrack issue Jörn Krebs
2012-11-13 3:02 ` Neal Murphy
2012-11-13 3:20 ` Jörn Krebs
2012-11-13 9:32 ` Eliezer Croitoru
2012-11-13 11:42 ` Jörn Krebs
2012-11-13 15:13 ` /dev/rob0
2012-11-13 20:09 ` Eliezer Croitoru
[not found] ` <CABY2qi8w6eDME-OUYM_5Y8Pk63TxBudoHkC54EdzHtuEwQGjZQ@mail.gmail.com>
2012-11-13 22:51 ` Fwd: " Jörn Krebs
2012-11-14 1:09 ` Eliezer Croitoru
[not found] ` <CABY2qi_SsfZWzD5=ycNoSVGCCP5YqWro23rJe9THTrLpeEXmww@mail.gmail.com>
[not found] ` <50A2EF09.5030002@ngtech.co.il>
2012-11-14 1:31 ` Jörn Krebs
2012-11-14 1:43 ` Eliezer Croitoru [this message]
2012-11-14 1:47 ` Jan Engelhardt
2012-11-14 2:35 ` Jörn Krebs
2012-11-14 11:23 ` Jan Engelhardt
2012-11-14 15:38 ` Eliezer Croitoru
2012-11-14 15:54 ` Jan Engelhardt
2012-11-14 16:01 ` Eliezer Croitoru
2012-11-14 21:33 ` Jörn Krebs
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=50A2F737.6060403@ngtech.co.il \
--to=eliezer@ngtech.co.il \
--cc=jk@smartbyte.de \
--cc=netfilter@vger.kernel.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.