FreePBX behind NAT, local clients vs. STUN

I’m running FreePBX behind a NAT, but I have a static external IP. The external IP is listed as such in the SIP configuration, and the local private network is listed as a local network. Currently all of the SIP clients are local (on the same private network), and everything works perfectly.

Now, I want to add an outside client, one that is also behind a NAT. I’ve added the necessary port forwards to the server’s NAT router (TCP/UDP 5060-5082, 10000-20000). Because both the server and the client are behind their own NATs, though, my understanding is that I need to use STUN. But when I add the STUN server to the FreePBX SIP config, save, and “Apply Config,” the local SIP clients stop working. Remove the STUN server, save, and “Apply Config,” and the local SIP clients start working immediately.

NAT mode is set to “No” on all of the internal SIP extensions, as well as the master chan_sip settings. Only the external extension has NAT mode set to “Yes.” So why is the STUN server setting affecting local clients? What am I missing?

Your FreePBX installation is already doing everything a STUN server would do for you.

The only place you should need a STUN reference would be on a network where the internal and external network addresses are not already know.

So, leave the FreePBX server alone and set up the remote clients either as NAT enabled clients (if you know their external address) or as STUN enabled clients (if they work at Starbucks, for example.)