Double nat does it work

hi can someone give me a quick answer , i have asterisk sitting behind a nat router, an incoming sip call is received by asterisk and transfered to an extension , which is configured to send the call to another sip account outside and that account also sits behind a nat router , will this set up combination work , if so what configuration do i need . with this setup i get the call transfered to distant sip account but there is no voice transmission, as the far end account is on an ata there is no configuration that end am i missing something on my side

many thanks

Do you have nat=yes set ar each point (i.e. SIP trunk and SIP extension)? Also you need externip= set to your external firewall IP and localnet settings correct for your LAN in sip.conf.

hi
please see my config below and advice if i have missed anything , on debug i can the call being answeredand astrisk bridgging call

Attempting native bridge of SIP/89.28.232.117-08831e00 and SIP/proxy.coms.com-08837340

[general]
nat=yes
externip=87.194.34.246
localnet=10.4.50.0/255.255.255.0
fromdomain=pediru.com
port = 5060
bindaddr = 0.0.0.0
context=sip
register => xxxxx:rf2fbfsr@sip.voipuser.org:5060/2000
register => 02071480112:xxxxx@proxy.coms.com:5060/2000
musiconhold=default
qualify=yes

[2000]
type=friend
username=michael
secret=test
defaultip=10.4.50.26
host=dynamic
dtmfmode=rfc2833
context=sip
mailbox=100
disallow=all
allow=gsm
nat=yes

thanks

Do you have RTP ports open on your firewall where the Asterisk server is? Have a look at rtp.conf for port range (UDP).

asterisk with NAT on both sides will work great you just need a few things

  1. set externip= / localnet= in sip.conf (looks like you did this)
  2. set RTP.conf to be a more reasonable range, give it ~200 ports not 10k. I use 10000-10250 usually.
  3. forward UDP ports 5060 and the RTP range you set in step 2 to your Asterisk box through your NAT
  4. make sure your Asterisk box does not have a firewall blocking these ports
  5. Set up your phone with NAT=yes in sip.conf. also lower the expiery time or set qualify=yes
  6. On the other side, make sure the phone is enabled with STUN or knows its own external IP. STUN helps use stun.xten.net or stun.softjoys.com

hope that helps…

hi

thanks for all the help

its getting more confusing, i have taken externip and fromdomain and local net off, and now i can get conversation both ways but one way is very distorted and the other way its very clear, is this to do with the sj phone setting or something has anyone had a similar problem

thanks