NAT issue with asterisk

Hi please any one can help me???

I configured asterisk for SIP soft phone in my lan with IP
it’s working fine locally.Able to get calls and make calls.
But when I configured it for my public IP (assume that it’s it’s not working.
I belive that it’s due to NAT issue becuase my asterisk server is behind NAT.Not even the SIP soft phone is
getting registerd(x lite).i gave port forwading on my router such as forwaded all UDP ports in range of
5060-20000(including SIP & RTP ports) to my local meachine(asterisk server)

I installed packet sniffer on my server and found that not even a single request is not reaching at
the server from client(xlite client from outside NAT).just imagine that Xlite client is working from Ip
What I want to configure on xlite…I don’t knoe what to do please give me some suggestions .

Hi hansasterisk!

I got sort of the same problem before!

My solution was:

If I connect X-lite (or other SIP client) inside my own network, inside the NAT I uses the lan IP, in yor case 192.168.1.* (the IP of your PBX)

If I connect from outside the network, outside the NAT I uses my external IP (or the hostname if you uses DynDNS)

It did not work for me to connect from inside my LAN to my PBX with my external IP or hostname!

It might work if you uses a STUN server!
I have not myselfe used a STUN server so I have no experience with that!

STUN (Simple Traversal of UDP through NATs (Network Address Translation))
is a protocol for assisting devices behind a NAT firewall or router with their packet routing. RFC 5389 redefines the term STUN as ‘Session Traversal Utilities for NAT’.

I would start out by troubleshooting it at the network level. Make sure you can connect to port 5060 from the outside, if not start looking at your firewall and/or security software.

How can I check that I can connect to a UDP port 5060.
For TCP it’s possible using telnetting and all …but for UDP how can I check it.
I believe that telnet will not work for UDP.

take a look at … laylang=en . I believe you can choose.

Sorry actually I am using Centos 5.2.Sorry for not mentioning that on previous post.

okay… then use nmap.

I checked it with nmap.The port is listening.I checked by nmap -sU -p 5060 “public ip”
It’s showing that the port is opened.I also used wireshark(packet sniffer) on client s/m, it showing that all SIP requests are

going correctly to destination(public Ip used in my router).But it’s not reaching in server.

what would be the problem.?The SIP packets are dropping some where???

Please give me some advice…

At last I found a solution…

I used openvpn to make tunnel through network.(VPN)
The problem was that the UDP packets were dropping some where on network.
I don’t know what is the reason,as iam not so familiar in networking.

I configured openvpn on asterisk server and configured open vpn client on machine whis is also
used as x lite client.IT’S very simple to configure.same package is used for both client and server.

If any one finds any other solution please post me…

                                                                                             THANKs FOR ALL ......