Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: Joerg Dorchain <joerg@dorchain.net>
Cc: netfilter@vger.kernel.org
Subject: Re: nf_conntrack_sip problem
Date: Wed, 01 Jul 2009 18:16:21 +0200	[thread overview]
Message-ID: <4A4B8BD5.6060907@trash.net> (raw)
In-Reply-To: <20090701161029.GC9285@Redstar.dorchain.net>

Joerg Dorchain wrote:
> On Wed, Jul 01, 2009 at 05:05:49PM +0200, Patrick McHardy wrote:
>>> I tried this. Actually, it makes things worse. Now Asterisk
>>> complains: [Jul  1 16:17:46] WARNING[20516]: chan_sip.c:1787 
>>> __sip_xmit:
>>> sip_xmit of 0x86f8de0 (len 384) to 217.10.79.9:5060 returned -1:
>>> Operation not permitted
>>>
>>> (Trying to register with sipgate.de; registration in parallel
>>> with tel.lu seems to work)
>> sipgate needs sip_direct_media=0 since the RTP streams originate from
>> a seperate cluster.
> 
> I loaded the module with sip_direct_signalling=0 and
> sip_direct_media=0 to get these messages.

That should be fine. Possibly related to NAT without the helper,
see below.

>> Did you load the NAT module before the conntrack module?
> 
> I did not load the nat modules at all. As said, I am only
> interested in dynamically accepting the rtp streams.
>>> nf_conntrack_sip without options on a trial incoming call however gives:
>>>
>>> # conntrack -E expect
>>> 180 proto=17 src=85.93.219.114 dst=212.88.133.153 sport=0 dport=7070
>>> 180 proto=17 src=85.93.219.114 dst=212.88.133.153 sport=0 dport=7071
> 
> Also for tel.lu the expected IP should be 85.93.219.122.

It takes the addresses from the SDP payload. The gateway seems to be
handling RTP stream with a different server as well.

> BTW, it seems that combining an SER for the handling the sip part
> with an asterisk for the dial-in part seems to be common. Here it
> means the RTP stream is coming typically from a different IP than
> the register endpoint.

Thats what the sip_direct_media=0 option is meant for.

>> Besides the direct_media option, I assume you're accepting EXPECTED
>> and RELATED packets?
> 
> No, only RELATED. I repeat the line: -A checkblock -m state
> --state RELATED,ESTABLISHED -j RETURN

Sorry, my mistake :) That should be fine.

> For reference, again the complete iptables:
> # Generated by iptables-save v1.4.3.2 on Wed Jul  1 13:26:32 2009
> *nat
> :PREROUTING ACCEPT [1385:93589]
> :POSTROUTING ACCEPT [319:26979]
> :OUTPUT ACCEPT [5114:401834]
> -A PREROUTING ! -i ppp0 -p udp -m udp --dport 5060 -j REDIRECT=20
> -A POSTROUTING -o ppp0 -j MASQUERADE=20
> COMMIT

So you are using NAT? You *need* the NAT helper in that case for
remapping clashing ports.

  reply	other threads:[~2009-07-01 16:16 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-01 11:37 nf_conntrack_sip problem Joerg Dorchain
2009-07-01 12:03 ` Patrick McHardy
2009-07-01 14:43   ` Joerg Dorchain
2009-07-01 15:05     ` Patrick McHardy
2009-07-01 16:10       ` Joerg Dorchain
2009-07-01 16:16         ` Patrick McHardy [this message]
2009-07-01 20:56           ` Joerg Dorchain
2009-07-02  8:17             ` Joerg Dorchain
2009-07-02  9:04               ` Joerg Dorchain
2009-07-03  9:45                 ` Patrick McHardy
2009-07-03 11:20                   ` Joerg Dorchain
2009-07-03  9:44               ` Patrick McHardy

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=4A4B8BD5.6060907@trash.net \
    --to=kaber@trash.net \
    --cc=joerg@dorchain.net \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox