[Asterisk-Users] Asterisk behind NAT

Oswaldo Arratia oarratia at workersequity.net
Fri Apr 15 10:45:34 MST 2005


I am not registering, only sending calls, here is the config for the general
section and for that provider (gw2).

[general]
context=default                 ; Default context for incoming calls
recordhistory=yes               ; Record SIP history by default
                                ; (see sip history / sip no history)
realm=asterisk                  ; Realm for digest authentication
                                ; defaults to "asterisk"
                                ; Realms MUST be globally unique according
to RFC 3261
                                ; Set this to your host name or domain name
port=5060                       ; UDP Port to bind to (SIP standard port is
5060)
bindaddr=0.0.0.0                ; IP address to bind to (0.0.0.0 binds to
all)
srvlookup=no                    ; Enable DNS SRV lookups on outbound calls
                                ; Note: Asterisk only uses the first host
                                ; in SRV records
                                ; Disabling DNS SRV lookups disables the
                                ; ability to place SIP calls based on domain
                                ; names to some other SIP users on the
Internet

maxexpirey=3600                 ; Max length of incoming registration we
allow
defaultexpirey=3600             ; Default length of incoming/outoing
registration

disallow=all
;allow=ulaw
allow=g729

language=en                     ; Default language setting for all
users/peers
                                ; This may also be set for individual
users/peers
rtptimeout=300                   ; Terminate call if 60 seconds of no RTP
activity
                                ; when we're not on hold
rtpholdtimeout=300              ; Terminate call if 300 seconds of no RTP
activity
                                ; when we're on hold (must be > rtptimeout)
;progressinband=no              ; If we should generate in-band ringing
always

useragent=Asterisk  			; Allows you to change the user
agent string

nat=yes

externip = 1.3.5.7
localnet=192.168.1.0/255.255.255.0


[gw2]
type=peer
port=5060
host=2.4.6.8
disallow=all
defaultip=2.4.6.8
allow=g729

-----Original Message-----
From: asterisk-users-bounces at lists.digium.com
[mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Alex Vishnev
Sent: Friday, April 15, 2005 1:15 PM
To: 'Asterisk Users Mailing List - Non-Commercial Discussion'
Subject: RE: [Asterisk-Users] Asterisk behind NAT

Can you show your outbound peer configuration? If you are registering,
please include that as well.

Thanks

Alex

-----Original Message-----
From: asterisk-users-bounces at lists.digium.com
[mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Oswaldo
Arratia
Sent: Friday, April 15, 2005 9:44 AM
To: 'Asterisk Users Mailing List - Non-Commercial Discussion'
Subject: RE: [Asterisk-Users] Asterisk behind NAT

I have...   Externip=x.x.x.x    and nothing... Does not seem to help in
anything. Still my provider sees the private IP. 


-----Original Message-----
From: asterisk-users-bounces at lists.digium.com
[mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Alex Vishnev
Sent: Friday, April 15, 2005 9:05 AM
To: 'Asterisk Users Mailing List - Non-Commercial Discussion'
Subject: RE: [Asterisk-Users] Asterisk behind NAT

Try setting externip=(asterisk public ip address)

Hth
Alex

-----Original Message-----
From: asterisk-users-bounces at lists.digium.com
[mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Oswaldo
Arratia
Sent: Friday, April 15, 2005 12:56 AM
To: 'Asterisk Users Mailing List - Non-Commercial Discussion'
Subject: [Asterisk-Users] Asterisk behind NAT

Hi List,
I've spent hours researching on this topic, found tons of info, so far it
doesn't work yet.

Here's the scenario

Asterisk box connected to a router (DMZ enabled to Asterisk) and trying to
send calls to an outside provider.

My SIP phones (outside * NAT) are able to register with no problem.


The problem comes when I send a call out to my provider I get no audio in
either way. My provider sees only my private IP.  How can I send my provider
the public IP??


I have in my sip.conf:

[general]
port=5060                       ; UDP Port to bind to (SIP standard port is
5060)
bindaddr=0.0.0.0                ; IP address to bind to (0.0.0.0 binds to
all)
nat=yes
externip = x.x.x.x
localnet=192.168.1.0/24

(remember I enabled DMZ on the router so all ports are being forwarded to *)
Despite of what I do, the externip and the localnet my provider only gets my
* private IP.

Any tip how to solve this??

Thanks!!!!


_______________________________________________
Asterisk-Users mailing list
Asterisk-Users at lists.digium.com
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


_______________________________________________
Asterisk-Users mailing list
Asterisk-Users at lists.digium.com
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users



_______________________________________________
Asterisk-Users mailing list
Asterisk-Users at lists.digium.com
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


_______________________________________________
Asterisk-Users mailing list
Asterisk-Users at lists.digium.com
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users






More information about the asterisk-users mailing list