Solved

Questions about Asterisk behind NAT

Posted on 2013-11-26
7
427 Views
Last Modified: 2014-02-26
The Asterisk/FreePBX server is in our data center behind our firewall. It's on a 10.10.40.0/24 network. Our telephones are at a remote site that has an IPSEC tunnel to the data center. These devices are on a 10.1.40.0/24 network.

Calls between the phones at the remote sites work. Calls from our remote site to an extension on our Asterisk server (Directory for example) do not work; calls via our SIP trunk provider configured on the Asterisk server also do not work - there is no audio.

I'm sure this is a beginner NAT issue; I'm looking for guidance on how to resolve.
0
Comment
Question by:hypervisor
  • 3
  • 3
7 Comments
 
LVL 31

Expert Comment

by:Frosty555
ID: 39679718
Note that a site-to-site VPN is NOT a NAT. If your site-to-site has been done right you have equipment on both ends which is routing packets for the two local subnets meaning the endpoint and the PBX can communicate with each other directly using their IP addresses. A NAT is involved when you have a router connecting an external network (e.g. the Internet) to a local network, and there's port forwarding etc. configured.

More likely this is a firewall issue...

The Asterisk server uses port UDP 5060-5061 for regular SIP traffic, but the audio for each session is sent via a randomly selected RTP port, which by default is in the range of UDP 10000-20000. These ports must be opened in your firewall, forwarded through your NAT etc. accordingly. If you need to use a different range you can configure the RTP port range in /etc/asterisk/rtp.conf.  

Also, if you're Asterisk server is behind a NAT you should make sure your external IP address or hostname is specified in Asterisk using the "externhost", "externip" and "localnet", directives in your sip.conf. It's easier to configure this if you're using FreePBX as your GUI, you can simply go into Settings->Asterisk SIP Settings section and configure the NAT settings in there.

Finally, your endpoints themselves (In freepbx under Applications->Extensions), you need to configure if they are behind a NAT. If your endpoints/phones are on the other side of a router you should set NAT to "yes". Otherwise, leave it as "no".
0
 

Author Comment

by:hypervisor
ID: 39679735
Thanks for the response.

The phones are configured to connect to the Asterisk server on its LAN IP address (10.10.40.250) -- not on a WAN address.  The phones are behind a router on the private network VLAN (10.1.40.0/24) at our satellite office.

Do they need to be configured for NAT?  Based on what you wrote, I would assume not.
0
 
LVL 31

Expert Comment

by:Frosty555
ID: 39679741
I'm assuming that even though your phones are behind a router, the site-to-site VPN is providing the routing between the PBX subnet and the phones subnet (e.g. Asterisk never actually has to use the external WAN IP address of the remote site where the phones are).

So I'd say if your PBX can communicate with the phones via their local 10.1.40.0/24 ip address, then NAT should be set to "no". Otherwise set it to "yes".

More information is here:
http://www.voip-info.org/wiki/view/Asterisk+sip+nat
0
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 

Author Comment

by:hypervisor
ID: 39679746
NAT is set to no.

Any other ideas as to why things aren't working?
0
 
LVL 31

Expert Comment

by:Frosty555
ID: 39679751
I'm still leaning in the direction of a firewall issue related to your RTP port range. You're sure that the endpoints can communicate with your PBX on the RTP port range 10000-20000?
0
 

Author Comment

by:hypervisor
ID: 39679757
I'm told the VLAN's at the two locations are "wide open".
0
 
LVL 15

Accepted Solution

by:
Phonebuff earned 500 total points
ID: 39681527
The phones are configured to connect to the Asterisk server on its LAN IP address (10.10.40.250) -- not on a WAN address.  The phones are behind a router on the private network VLAN (10.1.40.0/24) at our satellite office.

You need to ensure that the Localnet = has the appropriate settings both subnets, and that the asterisk server has a entry in the route table for this remote subnet, if the router / firewall supporting it is not the default..  

Externip = <Public Ip Address>
Localnet = 10.10.40.0/255.255.255.0
Localnet = 10.1.40.0/255.255.255.0


You can use MTR on the Asterisk box to check the route -- http://linux.die.net/man/8/mtr

==============================
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Zaptel people (www.zaptel.com) got kind of annoyed with the fact that they were getting bombarded with searches for the zaptel driver system for Asterisk (not to mention they own the trademark on zaptel). So, they kindly requested that Digium ch…
Article by: user_n
How Sip Phone (User Agent) works and communicates with sip servers 1.  There is a sip server and a sip registrar.  The sip server and sip registrar can be one server or two different servers. The sip registrar is the server on which it is record…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now