Clients sometimes behind NAT, sometimes on LAN

Hello all

I have an Asterisk box with internal and external NIC. I have users with softphones. How can I allow their softphones to log in regardless of whether they are inside the LAN or at an external location?



Sounds like a phone configuration problem, as Asterisk should NAT or not based on whether or not the address of the local party is local… What is your current relevant Asterisk configuration.

Oh, I haven’t tried it yet. So are you saying that:


will still work if the client is on the same subnet as Asterisk, and no NAT is taking place?



nat is the only option that might cause a problem, but it looks to me, from the description, that it won’t.

nat=yes canreinvite=no ; sort of implied above qualify=yes

in my experience, most phones, exccept Cisco 79xx will run OK on nat=yes even if on the same lan.
As for the NATed clients, qualify=yes seems to help keep them able to recieve calls as well as make calls. You’ll need to watch UDP time outs on the router that the NATed phones are behind and make sure that they dont mangle the SIP too much. Common issue for multiple Aastra phones behind NAT.

Good luck

Couple things I like to do is to yes set qualify=yes but also set the registration period on the phone to like 120 or something like that.

This make sure that the ports on the router stay open. otherwise you can have situations where communication will only be one way. Essentially once the ports are open it is fine. Once some time passes they’ll be closed and you’ll have one way traffic again.

Whenever I have these issues I take the nat and router out of the equation then work backward (e.g. set the asterisk box up on external IP address).