Asterisk behind NAT and voip clients behind other NAT

Hi folks,

I’m having difficulties with this setup, and am not even sure it is possible.

My asterisk server lives behind a NAT modem/router and is registering successfully to my SIP provider. I’ve done it using dyndns combined with the extenhost directive in sip.conf.

However, I want my asterisk server to be reached by clients who happen to be in another part of the world and are themselves behind another nat modem/router. So I figured, if I could let these clients all register to my asterisk server, then I would be able to route calls coming on the central sip number, which my asterisk server can pick up just fine, to their sip client no matter where they are in the world.

Then if that works I would purchase hard phones for all my clients.

The problem I have is that everyone says how sip was not designed with nat in mind and that iax2 is better, but then again even softphones speaking iax2 are hard to find as are hardphones.

Then some people say I would need a sipproxy between my asterisk server and the voip clients scattered all around the world.

Does anyone here had success with this kind of setup, asterisk server bind nat and phones behind other nat? How was this accomplished? What special kind of hardware should I purchase?

I’m rather free in my choices because I can influence all three locations (New York, The Netherlands and South-America) so even putting three asterisk servers there would be an option.

Thanks in advanced

PS I’m using a standard i386 machine running openbsd 4.2 with asterisk 1.2.22

Hope this helps…

I have a similar setup. I have an asterisk server sitting behind a nat and two hardphones at remote locations behind nat’s. I have sip ports (5060) and my rtp prts(10000-20000) forwarded to my asterisk box. Also, what I have found out about the remote clients is: I need to forward the sip port to the phone so Asterisk can send requests to see if the phone is still reachable. If you dont forward packets on the remote end to the phone, asterisk will declare the phone unreachable and phone calls will not be forwarded to that phone.

Good Luck

Hi Guys,

I understand that Asterisk server behind a NAT and SIP pone behind another NAT will only work with use of STUN server.

Another option is site to site VPN, I use draytek routers which also have hood QOS capability.

A further option is to locate asterisk servers at each location and use IAX2 trunk between them.

Using SIP in double NAT scenario without STUN is not possible. (AIUI).

Good luck,

Sean Browne
Cardiff IT Support Ltd
0800 011 2931
www.cardiffitsupport.com

Using Asterisk behind NAT is very messy. I’d not recommend it at all.