Solved

Questions about Asterisk behind NAT

Posted on 2013-11-26
7
425 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 

Author Comment

by:hypervisor
Comment Utility
NAT is set to no.

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

Expert Comment

by:Frosty555
Comment Utility
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
Comment Utility
I'm told the VLAN's at the two locations are "wide open".
0
 
LVL 15

Accepted Solution

by:
Phonebuff earned 500 total points
Comment Utility
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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

How To Create Custom / Distinctive Ring Tones on Polycom Phones Purpose and Overview When creating a custom ring tone, you have simple aspirations: to make your phone cooler than everyone else's. Perhaps you need a louder ringer. Perhaps you w…
There are no good configuration guides for HP-H3C router to LYNC on the web. :( Big statement, but we havent been able to find one yet. We did find the following document useful, but the information was not enough to use H3C router for use as a L…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

743 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

17 Experts available now in Live!

Get 1:1 Help Now