NAT / no NAT issue

Get help with installing, upgrading and running Asterisk.

Moderators: muppetmaster, Moderator, Support

NAT / no NAT issue

Postby tobin » Wed Dec 09, 2015 11:52 am

Hi,

I've got a working asterisk configuration for a Grandstream HT503. At least, it works at home. At work it fails with, "Got SIP response 503 "Service Unavailable" back from <server>"

Looking at the SIP debugs, the thing that stands out is:

Home:
Sending to <server> (no NAT)
Transmitting (no NAT) to <server>

Work:
Sending to <server> (NAT)
Reliably Transmitting (NAT) to <server>

But there shouldn't be any NAT at work either.

What's making this decision to use NAT?

Hope someone can help,
Tobin
tobin
Newsterisk
 
Posts: 8
Joined: Wed Dec 09, 2015 11:30 am

Re: NAT / no NAT issue

Postby _alx_ » Thu Dec 10, 2015 2:20 am

What is your local network at your home, what ip the 503 and the asterisk have?
What is your local network at your office, what ip the 503 and the asterisk have?

Also the network in your office is setup by you or a sysadmin?
_alx_
Oldsterisk
 
Posts: 57
Joined: Fri Oct 16, 2015 1:48 am

Re: NAT / no NAT issue

Postby tobin » Thu Dec 10, 2015 3:34 am

>What is your local network at your home, what ip the 503 and the asterisk have?
255.255.255.0, 192.168.0.106, 92.168.0.105

>What is your local network at your office, what ip the 503 and the asterisk have?
255.255.252.0, 192.168.1.189, 192.168.1.120

>Also the network in your office is setup by you or a sysadmin?
Mainly by me.

What is it that is displaying NAT / no NAT? Is it how the asterisk server sees the network or how the HT503 sees the network?

Thanks,
Tobin
tobin
Newsterisk
 
Posts: 8
Joined: Wed Dec 09, 2015 11:30 am

Re: NAT / no NAT issue

Postby david55 » Thu Dec 10, 2015 7:31 am

The office isn't listed as a localnet.
david55
Moves Like Spencer
 
Posts: 12570
Joined: Fri Sep 26, 2008 5:03 am

Re: NAT / no NAT issue

Postby tobin » Thu Dec 10, 2015 9:21 am

So if I add the below to sip.conf, it'll stop trying to NAT?

[general]
localnet=192.168.0.0/255.255.252.0

Thank-you,
Tobin
tobin
Newsterisk
 
Posts: 8
Joined: Wed Dec 09, 2015 11:30 am

Re: NAT / no NAT issue

Postby tobin » Thu Dec 17, 2015 3:13 am

Finally got back into the office to test this and I still can't get an outgoing call from the office.

Here's the sip debug log:
http://pastebin.com/tymBw61z

Thoughts, anyone?

Thanks,
Tobin
tobin
Newsterisk
 
Posts: 8
Joined: Wed Dec 09, 2015 11:30 am

Re: NAT / no NAT issue

Postby ambiorixg12 » Thu Dec 17, 2015 10:01 am

The private IP is still the only advertised on your SDP.

Beside the localnet option, there are still a few parameters you need to tweak.

For example :


nat = force_rport,comedia
externaddr = 12.34.56.7 ;replace it with your public IP

externhost=foo.dyndns.net ; refreshed periodically
externrefresh=180 ; change the refresh

Check the section called NAT Support on the sip.conf sample configuration.

http://svn.digium.com/svn/asterisk/trun ... onf.sample
ambiorixg12
Astmaster
 
Posts: 967
Joined: Sun Mar 04, 2007 9:32 pm
Location: Dominican Republic

Re: NAT / no NAT issue

Postby tobin » Thu Dec 17, 2015 11:45 am

Thanks for that but I'm not doing anything externally. The soft-phone, SIP device and asterisk server are all on the same network.

Does asterisk need to know the external network?
tobin
Newsterisk
 
Posts: 8
Joined: Wed Dec 09, 2015 11:30 am

Re: NAT / no NAT issue

Postby ambiorixg12 » Thu Dec 17, 2015 1:02 pm

If is internally you don't need to specify the external address, rtp set debug on command would help to see the rtp media stream
ambiorixg12
Astmaster
 
Posts: 967
Joined: Sun Mar 04, 2007 9:32 pm
Location: Dominican Republic

Re: NAT / no NAT issue

Postby tobin » Fri Dec 18, 2015 11:12 am

Please find sip and rtp debug log at: http://pastebin.com/K7hJ6U6A
tobin
Newsterisk
 
Posts: 8
Joined: Wed Dec 09, 2015 11:30 am

Re: NAT / no NAT issue

Postby ambiorixg12 » Fri Dec 18, 2015 12:24 pm

Your original problem's description make reference to a 503 sip response, There is no such response on your sip trace. Beside that I see successfully established and media between

Got RTP packet from 192.168.1.120:5012 (type 00, seq 012433, ts 1663777460, len 000160)
Sent RTP packet to 192.168.1.47:7078 (type 00, seq 017204, ts 1663777456, len 000160)
ambiorixg12
Astmaster
 
Posts: 967
Joined: Sun Mar 04, 2007 9:32 pm
Location: Dominican Republic

Re: NAT / no NAT issue

Postby tobin » Fri Dec 18, 2015 1:42 pm

Hmmm, the localnet option seems to have sorted the error out but there's still no call being placed.

So that looks like a normal successful call to you? Any suggestions on how to debug further?

So irritating that it works from home. There must be another network difference somewhere.
tobin
Newsterisk
 
Posts: 8
Joined: Wed Dec 09, 2015 11:30 am

Re: NAT / no NAT issue

Postby rootmedia » Mon Dec 21, 2015 8:51 am

Question For your!

Are you physically relocating the Asterisk System from Home to the Office and assigning a IP address to the asterisk system that is in the OFFICE Subnet 192.168.0.0/24? Or is it set to a static IP based on your Home Network Subnet 192.168.1.0/24?

As well if your IP address are correct for the network they are on make sure you are not binding asterisk to the wrong IP

ex: bindaddr=192.168.0.10
as well check your
localnet=
too make sure that it is on the correct network

I hope this helps
Brent HIggs
CEO & Founder at
Image
https://root.media
rootmedia
Newsterisk
 
Posts: 9
Joined: Thu Dec 17, 2015 12:57 am
Location: Vancouver, BC

Re: NAT / no NAT issue

Postby tobin » Wed Dec 23, 2015 5:14 am

Apologies for the slow reply - I completely missed it.

I am physically relocating my asterisk system - it's just a VM atm.

In both environments, the VM gets a reserved address from a DHCP server.

I don't think it can be binding to the wrong address as we can see communication between the asterisk server and the HT503 in the sip log.

As was pointed out earlier, the original problem was effectively solved, so I'm trying to put together a new question - please don't let that stop you posting any further thoughts here though.
tobin
Newsterisk
 
Posts: 8
Joined: Wed Dec 09, 2015 11:30 am


Return to Asterisk Support

Who is online

Users browsing this forum: Google [Bot] and 1 guest