Doubt with nat parameter


I am just starting with Asterisk and I have a question regarding to the configuration required to traverse NAT. I have the following setup:

Local users — Asterisk(1) — NAT — Internet —Asterisk(2) with public IP— Users with public IP

I have done portforwarding and I have added the parameters externip and localnet to the general setion of sip.conf in Asterisk(1). However, I do not know if it is necessary to add nat=yes in the configuration of each local user (the ones that are behind nat in the same subnet as Asterisk(1)) or in the configuration of the users wit public IPs.
Could you explain me when when should I use this parameter and how it works?

Thank you very much in advance!

You are not crossing into a remote NAT environment, so nat= should not be relevant. It is widely misunderstood and much overused. nat= is for dealing with people beyond remote NAT who are not re-writing their SIP and SDP to correctly reflect their public address and the port numbers used with that address.

Also note that the “yes” value is deprecated in the latest version of Asterisk. I’m not sure in which version it actually changed.


Thank you very much.