Asterisk Behind NAT - HELP

Hi all,
I have a 512KB DSL connection. I can use my asterisk server with a direct connection to my router. but i want to have a firewall in between my router and asterisk server…I can have 1 to 1 nat in my firewall cuz i got 3 public IP addresses with my DSL connection. Can anyone tell me only thing i have to do is change sip.conf setting,

externip = 200.201.202.203 ;where 200.201.202.203 is my public ip address

is there any changes i have to made and what are the ports i should open in my firewall… I guess port 5060 is not enough cuz clients changes its port when ever they reconnect with the asterisk server.

Thanks in advance

~hacksics - [knowledge is power]

You should also open UDP 10000-20000 for RTP.

thanks right now im working on that :smiley:

still not workin…
i can dial but no voice come out
the thing is path is open for one side only
plz help me
:frowning:

be a little clearer about what you’re experiencing. did you read the sticky at the top of the forum and the link to the wiki pages about NAT. if you forward the appropriate ports to your Asterisk server (and make sure you consult rtp.conf before settig them) then you shouldn’t have a problem.

here what im experiancing,

when i put all the login information to my sip client(eyebeam) and register it, it got registered with the server…i can access my voice mail as well as music on hold. and even i can hear the music as well as automated voice.

but when i try to call from one phone to another phone is ringing once i pick the phone and try to talk from one to another voice is not travelling…

this cant be cuz i tried the same settings without a firewall everything worked fine…

Thanks n waiting a response from someone…plz help

Baconbuttie has the right info. This is addressed in detail in some posts from last spring. Just do a search for NATD, X-Lite, etc…it’s there. Someone did a real detailed listing of what ports you need to forward. My system didn’t work either until I followed this post.

You need UDP for ports 5060 thru 5082 and 7999-20001. I also forward 4569 and 2727, both UDP and TCP. Some will tell that you only need UDP and that’s all you should need but somewhere I read to forward TCP as well so I did. It work and I’m afraid to unforward TCP now…if it ain’t broken don’t fix it…

.

are you allowing a re-invite ? if Asterisk steps out the media path, and you have your firewall forwarding to a specified box, then you’re going to get one-way audio.

im gonna open all the ports maxfiles has stated…anyway im not doing a re-invite is it needed?

the pages (and pages) of info about NAT & Asterisk all tell you to port-forward UDP 5060 (- 5070) and UDP 10000-20000 … check/adjust /etc/asterisk/rtp.conf, for a small install you don’t need to forward so many ports, i use 10000-12000, and you should be good to go.

canreinvite should be set to ‘no’ for the SIP clients.

thanks…

in my rtp.conf i have port 10000-20000 open

so can you tell me when i try the command sip show peers why i see diferent port numbers other than numbers in between 10000 - 20000
i see some of my clients have 44000+ port numbers even

thanks

10000-20000 (or whatever) is for RTP. 5060 is for SIP. the port number shown in ‘sip show peers’ is the port that the client is listening on … Asterisk will listen on the port set in sip.conf

do a ‘nmap -sU localhost’ to see.

hi all,
Why dont u guys check this out for a while…these guys having the same problem like me

http://www.asteriskguru.com/tutorials/sip_nat_oneway_or_no_audio_asterisk.html

in this page one stated
"Wei (wei3hu2 at msn dot com)
07 July 2005 07:54:01
Hi, You examples are great. They covered most phone-to-asterisk NAT scenario. I have no problem of multiple phones behind the same NAT, registering with an asterisk server outside NAT (Pubic Address). Phones can call PSTN via Asterisk, or other phones behind other NATs with no problem. But these phones can’t speak to each other. They can ring each other (sip working). But when you pickup the phone, there are no audio (RTP not working). I can see the RTP packets are dropped on the NAT device with icmp port unreachable error. The source & destination RTP ports are correct. The NAT device can’t forward these packets to the phone on its inside interface. Any suggestion to fix this issue? Thanks, Wei "

check this out…

maybe we don’t need to check that site out because we worked through the links given here and on the wiki and fixed them !! and the owner of that site probably contributed towards the help pages here and the wiki anyway.

hi baconbuttie,

u may be right…in theory what u’ve explianed is right. but when it comes to practical situation it might not work…have u ever tried installing asterisk behind a firewall?

~hacksics

every Asterisk installation i’ve done is behind a firewall. have i ever had a one-way audio situation … no. but then i read the wiki and the assorted other sites that Google kicks up before i started.

ok got it baconbuttie,
my firewall is Firebox X500 not a cisco one…do you think problem is associated with that?

if it forward UDP ports as instructed then it shouldn’t be an issue.

hi baconbutti…
yes exactly thats my problem…
what we have to do is just forward the udp 10000-20000 and 5060 to 5100 right.

in my sip.conf file i have

extenip=xxx.xxx.xxx.xxx ;where xxx.xxx.xxx.xxx is my public ip

localnet=192.168.92.0/255.255.255.0

and rtp.conf file i have

rtpstart=10000
rtpend=20000

thats all right…

but i have GPX2000 IP phones which is not even registering with the server… xlite is getting registered but the audio is not travelling

thanks for being very supportive… :smiley:

dont know your firewall but if your concerned with ports just forward them all to your asterisk server (1-100,000 or whatever)
if you already have ports being forwarded to a web or mail server, just comment them out. (or leave them and forward around port 80 and smtp port)
This will at least tell u if thier is a port problem. Bottom line and you can move on to trouble shooting it if its a different problem.

[quote=“hacksics”]hi baconbutti…
yes exactly thats my problem…
what we have to do is just forward the udp 10000-20000 and 5060 to 5100 right.

in my sip.conf file i have

extenip=xxx.xxx.xxx.xxx ;where xxx.xxx.xxx.xxx is my public ip

localnet=192.168.92.0/255.255.255.0

and rtp.conf file i have

rtpstart=10000
rtpend=20000

thats all right…

but i have GPX2000 IP phones which is not even registering with the server… xlite is getting registered but the audio is not travelling

thanks for being very supportive… :smiley:[/quote]