Solved

Questions about Asterisk behind NAT

Posted on 2013-11-26
7
429 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
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
One way audio - wireshark capture 5 123
google voice, ring two phones 2 47
Skype Call - Toll Free Phillipines 2 77
Outgoing Call restriction in Cisco UC560 2 93
The point of this post is to give you a copy/paste installation solution to setting up Asterisk 1.6 on Ubuntu 9.04 (or similar) server. # Setup the system apt-get install subversion apt-get install make apt-get install linux-source kernel-p…
Almost all Internet protocol telephones have built-in switches at the back that allow you to connect your personal computer to one port and use the other port to connect your phone to to a Cisco switch.   Why we need to connect the PC to the pho…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

803 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