[asterisk-users] NAT

Stefan van der Eijk stefan at eijk.nu
Sun Jul 8 15:07:39 CDT 2007


On 6/5/07, Tom Rymes <trymes at cascadelinksystems.com> wrote:
>
> On Jun 5, 2007, at 9:46 AM, Cosmin Prund wrote:
>
> >> -----Original Message-----
> >> From: asterisk-users-bounces at lists.digium.com [mailto: asterisk-users-
> >> bounces at lists.digium.com] On Behalf Of Henry Cobb
> >> Sent: Tuesday, June 05, 2007 4:30 PM
> >> To: Asterisk Users Mailing List - Non-Commercial Discussion
> >> Subject: Re: [asterisk-users] NAT
> >>
> >> On 6/5/07, Iban Lopetegi Zinkunegi <lopetaz at hotmail.com> wrote:
> >>> Hi All!!
> >>>
> >>> I have my asterisk working in my house (working with mandriva 2007
> >> and
> >>> asterisk 1.4 svn). I´ve looking on the net but i couldn´t find the
> >> way of
> >>> making work my asterisk in a real enviroment. Seems that the problem
> >> of NAT
> >>> is a big problem. How can I sort out this, a mean crossing the NAT
> >> and
> >>> having asterisk connected?
> >>
> >> If you want to receive calls and not just place them and you have a
> >> broadband connection with a dynamic IP then your server must register
> >> with the VoIP provider and I suggest using IAX with the proper UDP
> >> port assigned to your Atrisk server.
> >>
> >> -HJC
>
> > NAT is not that big of a problem, not anymore.
> > Do a "NAT" search on http://www.voip-info.org - it'll get you
> > started (got me started at least)
> >
> > --
> > Cosmin Prund
>
> Specifically, you need to set the following in sip.conf (if applicable)
>
> nat=
> localnet=
> externip=
> externhost=
>
> You also need to configure your router to forward port 5060 and ports
> 10000-20000 to your asterisk server.


You make it sound very easy :-)

I've got a host connected to the internet with eth1 and to an internal LAN
with eth0. The host runs asterisk. The internal LAN contains a number of SIP
phones.

eth0 = 192.168.254.254 (network 192.168.254.0/24)
eth1 = internet IP-address

I've set "externhost" to the dyndns name I've registered. When I do a
lookup, this name returns the same IP-address as the one on eth1.

I've got a DID, and when I dial that number from my cell, the phones ring in
my home. When I pick up the phone, audio only goes one way (from my home
phone (behind the NAT) to the DID) audio the other way (from the DID to my
home phone behind the NAT) is missing, due to NAT.

It figured because my asterisk server tells the DID to send the audio to the
IP-address of my SIP phone on the internal network (192.168.254.105). I
fired up wireshark and captured the packets.

What I want to accomplish:
- calls within the LAN are re-invited (RTP goes from endpoint to endpoint)
- asterisk detects when a call is going beyond the local LAN (over the NAT),
and then stays in the middle.

I'm wondering if this is hard to do and how I'm supposed to configure this.

regards,

Stefan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20070708/f53f465a/attachment.htm 


More information about the asterisk-users mailing list