# NAT Problem

**URL:** <https://community.asterisk.org/t/nat-problem/6495>\
**Category:** Asterisk Support\
**Created:** [May 18, 2006, 11:56pm UTC](https://community.asterisk.org/t/nat-problem/6495 "2006-05-18T23:56:53Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![haroon\_anwar](https://avatars.discourse-cdn.com/v4/letter/h/e9bcb4/32.png) [@haroon\_anwar](https://community.asterisk.org/u/haroon_anwar)\
**Post date:** [May 18, 2006, 11:56pm UTC](https://community.asterisk.org/t/nat-problem/6495/1 "2006-05-18T23:56:53Z")

</div>

Hi,

I am trying to configure SIP on asterisk server. My SIP server is behing the Router. The IP address of SIP server is 172.31.255.5. I have forwardered UDP port 5060 from the router onto 172.31.255.5. I can call and listen to the other people using xten soft phone when I am in the internal LAN i.e. 172.31.255.0.

My Problem in this case is if someone else calls me from the outside/internet, then the xten phone rings. I can call outside and anyone can call me inside. But, I cannot hear the voice. There is no voice at all.

I have forwarded RTP ports to the asterisk server as well. I belive RTP port that asterisk by default uses are 10000-20000 and its mentinoed in rtp.conf.

In sip.conf I have put the following NAT related entries.

externip = mypublicip  
localnet = 172.31.255.0/255.255.255.0  
nat = yes

Can anyone please guide me in this record what I am doing wrong here.

Thanks in Advance.

Regards

Haroon

---

<div class="post-metadata">

**Author:** ![mirceahuh](https://avatars.discourse-cdn.com/v4/letter/m/e56c9b/32.png) [@mirceahuh](https://community.asterisk.org/u/mirceahuh)\
**Post date:** [May 19, 2006, 5:56am UTC](https://community.asterisk.org/t/nat-problem/6495/2 "2006-05-19T05:56:00Z")

</div>

Maybe this link can be useful for you:

[http://www.voip-info.org/wiki/view/Asterisk%40Home+Handbook+Wiki+Chapter+2#2532Settingupyourrouterfirewallsoyourrem](http://www.voip-info.org/wiki/view/Asterisk%40Home+Handbook+Wiki+Chapter+2#2532Settingupyourrouterfirewallsoyourrem)

---

<div class="post-metadata">

**Author:** ![rrashid](https://avatars.discourse-cdn.com/v4/letter/r/45deac/32.png) [@rrashid](https://community.asterisk.org/u/rrashid)\
**Post date:** [May 19, 2006, 7:55am UTC](https://community.asterisk.org/t/nat-problem/6495/3 "2006-05-19T07:55:38Z")

</div>

Please post your entire sip.conf. Something is missing.

---

<div class="post-metadata">

**Author:** ![RichardHH](https://avatars.discourse-cdn.com/v4/letter/r/a4c791/32.png) [@RichardHH](https://community.asterisk.org/u/RichardHH)\
**Post date:** [May 19, 2006, 8:55am UTC](https://community.asterisk.org/t/nat-problem/6495/4 "2006-05-19T08:55:30Z")

</div>

Open ports (all UDP !!):

5060-5063  
10000-50000

No harm in the latter but some phones are using RTP ports outside the 10000-20000 range.

You might want to check this line in your sip.conf  
autodomain=yes

depending on your network setup it might be needed.

Make sure the correspondending SIP blocks for the phones are correct, esp. the “NAT=YES” and canreinvite lines.

---

<div class="post-metadata">

**Author:** ![haroon\_anwar](https://avatars.discourse-cdn.com/v4/letter/h/e9bcb4/32.png) [@haroon\_anwar](https://community.asterisk.org/u/haroon_anwar)\
**Post date:** [May 23, 2006, 1:03pm UTC](https://community.asterisk.org/t/nat-problem/6495/5 "2006-05-23T13:03:34Z")

</div>

RichardHH, mirceahuh and David,

Thank you all of you replying to my post. I have already resolved the problem. The problem was with the port forwarding on the router. I was doing that wrongly. Fixed that and every thing is crystal clear now.

Thanks again

Regards

Haroon
