FreePBX-12 behind NAT

FreePBX: Version 12.0.1 (beta18)
Asterisk: Version 12.3.2
Linux: ArchLinux ARM

In the past I have used IAX because for me it was simpler to configure when sitting behind NAT, but with the new PJSIP, I now have to deal with configuring FreePBX-12/Asterisk-12 to work behind NAT. I know there are hundreds if not thousands of posts on this subject covering router (port forwarding) settings and FreePBX settings (using chan_sip).

From the Settings menu, I selected Asterisk SIP Settings. Since I am running PJSIP, the settings are a bit different from chan_sip. For example there is no NAT selection, no IP Configuration setting, and no External IP settings.

I was looking for some guidance on what I need to configure in FreePBX-12/Asterisk-12 to run with NAT. Here is a screenshot of what I have set to far in PJSIP.

Your RTP port range is tiny, you should be concerned about that. Most of the nat settings are dealt with on the extension page, but without knowing what the underlying problems you are having are I am shooting in the dark.

I will tell you that I am double natted here (first range is 192.168.1.x second is 10.10.254.x, then wan) using PJSIP and three hard phones to a cloud server and it works fine, you can set some additional settings in the PJSIP SIP Settings window like external ip address which I think you are missing that you can select that (look at the right nav) but I honestly have nothing set in those and just use the defaults of blank and it works fine.

I port forward ZERO ports (for my three phones internally). If you are port forwarding you are doing something wrong internally. I’ve NEVER had to port forward, and I don’t have SIP ALG turned on though either way it’s never affected call quality.

Basically the PJSIP settings you are looking for in the extensions page are RTP Symmetric and Rewrite Contact, they should both be set to YES, but I advise you read more about them from the tooltips.

The “External IP Address (used for NAT)” option is present in Asterisk SIP Settings -> Chan PJSIP.

By the way, @tm1000 what is mean field “Domain the transport comes from”? Is this a name resolves by DNS? Thx!

Thank you for the replies. I am going to table my NAT testing project for a few weeks while I work on some other tests, but I will report back. Regarding the tiny RTP port range, since I only have three extensions on my test system and plan no more, I thought 100 RTP ports would be enough for testing, but yes, I would normally not have a tiny range like that.

Also thank you for pointing out the “right side nav” buttons, I didn’t notice those because in the traditional SIP settings screen (chan_sip) that admin screen actually has areas to enter external WAN IP etc., on the SIP settings screen for pjsip, its a bit different, pictured above. I kept thinking to myself, where do I set the external WAN IP, etc. and didn’t notice the right hand nav buttons.

You say you’re running in a cloud, I’m trying to do the same thing. Do you have any install script for any OS? Don’t care at all about which underlying OS it’s on, all I want is FreePBX running.

Any suggestions, I don’t have the experience to do it from scratch.