[Asterisk-Users] Suggestion re: SIP/NAT/*

Ryan Courtnage ryan-lists at voxbox.ca
Thu Oct 28 13:45:46 MST 2004


On Thu, 2004-28-10 at 14:00 -0400, Richard Branham wrote:
> I'm attempting to set up an Asterisk server with clients as follows:
> 
> 
> SIP Client 1 (HT 286) === NAT === Internet === NAT === * Server === SIP 
> Client (HT 286) 2

Yep, you can do this, just requires some port forwarding and special
considerations in sip.conf.  Here are the details on my setup:

- Asterisk has a private IP behind my OFFICE router (ie: NATted). 
- The SIP client has a private IP behind my HOME router (ie: NATted).

I'm doing this _without_ the use of STUN or proxy servers.

Here's how it works:

- Asterisk's firewall forwards 5060 udp and 10000-20000 udp to *
- The SIP client's firewall forwards 5060 udp and 10000-20000 udp to the SIP 
client
- The SIP client has no special settings, just the external IP of Asterisk's 
firewall for the SIP Server.
- sip.conf contains NAT=YES for this particular client
- ensure sip.conf's [general] section contains:

bindaddr = 0.0.0.0 
externip = <external ip>
localnet = 255.255.255.0  <-- localnet setting is very important!

Works great - I've never had an issue.

Cheers,
Ryan

> 
> The crux of the matter is this:  I have a client behind a NAT trying to 
> connect to an * behind a NAT.  I'm looking for suggestions on how best 
> to tackle the problem. 
> 
> Although I'd prefer to have Client 1 connect directly to my * server, 
> it's acceptable for Client 1 to connect to another service (FWD, etc.) 
> and have my * server register with the service as well if necessary.
> 
> I have the option of disabling NAT or putting some equipment into a DMZ.
> 
> Can you offer some suggestions for what my network topology should look 
> like to get Client 1 connected to my * server?
> 
> Thanks,
> Richard




More information about the asterisk-users mailing list