[Asterisk-Users] Sip behind the NAT

Tom Rymes trymes at cascadelinksystems.com
Tue Dec 13 21:32:15 MST 2005


On Dec 13, 2005, at 8:25 AM, Michael George wrote:

> On Fri, Dec 09, 2005 at 03:23:31PM -0500, Tom Rymes wrote:
>> On 12/8/05, chawki hammoud <cyhammoud at yahoo.com > wrote:
>>
>>> Hi:
>>>
>>> i added these two lines to my general context ,but
>>> nothing happened the same result the sound came in one
>>> way for 3 seconds and stopped but it didnt hangup.
>>>
>>> --- Jeffery Chen <jeffery9 at gmail.com> wrote:
>>>
>>>> If your Astersik server behind NAT too, your need
>>>> modify SIP.conf like
>>>> this....
>>>>
>>>> externalIP= x.x.x.x
>>>> localnet= x.x.x.
>>>>
>>>> hope this can help you....
>>
>> Make sure that you have ports 5060 and ports 10000-20000 UDP
>> forwarded to your Asterisk server. (Asterisk uses UDP for SIP, not
>> TCP!!!)
>>
>> Also, in addition to the externip and localnet entries in sip.conf,
>> You need to add a "nat=yes" entry
>
> I have a similar problem with a client's system.  They have * 1.0.x
> behind a NAT with all the SIP phones on the local network.  Their VoIP
> provider is outside the NAT (a Metaswitch at their ISP, connected  
> to the
> phone lines from there).
>
> Their network guy has the firewall passing traffic on ports 5060 and
> 10000-20000 to the * system.
>
> I have externalIP and localnet set, but "nat=no" (default) is the case
> for this one.
>
> Occasionally they will place outgoing calls and the other party  
> does not
> hear anything.  Usually another attempt at the call will pass audio
> normally.
>
> One person who makes about 100 calls a day remembers having this  
> happen
> on about 7 calls one day.
>
> No one recalls this ever happening on incoming calls (though this  
> client
> primarily makes outgoing calls, I believe).
>
> Apparently this has been happening for a while and they just now
> mentioned it to me.
>
> Would "nat=yes" in the general section of sip.conf make a  
> difference in
> this case?
>
> Is there anything else I could look at that might alleviate this
> problem?

Without being a smartass, the only way to find out is to see if it  
works. More obviously, if the Asterisk server has a NAT between it  
and the ITSP, then use nat=yes, if it doesn't, then use nat=no. Of  
course, if you set nat=no, then don't bother setting localnet or  
externip, either.

Also keep in mind that some routers' "DMZ" settings still leave your  
box behind NAT. They just forward all of the ports to the specified  
address. (Linksys routers do this.)

Tom

--------------------
Tom Rymes
Cascade Link Systems
www.cascadelinksystems.com
(603) 375-1414

"Intelligent technology solutions for small businesses."





More information about the asterisk-users mailing list