NAT problems - changed sip_nat.conf and still no audio.

icntdrv
Posts: 8
Member Since:
2009-05-12

Hello all,

I am new, so please bear with. With the help of these forums and Google I was able to get my Trixbox 2.6.2.2 setup installed and configured. I can now make outbound calls from my home network with ease.

Trouble is, I cannot get or send audio from outside my home network. I am able to connect and initiate and receive calls, but there is no audio in any direction. While on the home network my audio is fine both ways.

I forwarded udp 5060-5082 and 10000-20000 and tcp 5060 in the firewall to the server.

Inserted the following into sip_nat.conf

Quote:
nat=yes
externhost = blablabla.dyndns.org
externrefresh = 5
localnet = 192.168.2.225/255.255.255.0

Interestingly, I set up a separate extension for my friend and called him from my home network. He saw the call as coming from 2000@127.0.0.1 instead of 2001@blablabla.dyndns.org

I've searched these forums and googled this problem and tried the above solutions to no avail. Can anyone offer any advice?

Thanks,

~Will



SkykingOH
Posts: 9537
Member Since:
2007-12-17
Your localnet line is wrong,

Your localnet line is wrong, it needs to be the network address not the host.

--

Scott

aka "Skyking"



icntdrv
Posts: 8
Member Since:
2009-05-12
Hrm... I changed

Hrm...

I changed sip_nat.conf to:
nat=yes
externip = my.temporary.ip.address
localnet = 192.168.2.225/255.255.255.0

and now audio works. Trouble with that is, I have dynamic ip at home. I thought externhost = something.dyndns.org was supposed to work. What do you do if you have dynamic IP address assigned to the router?



SkykingOH
Posts: 9537
Member Since:
2007-12-17
Your localnet is still

Your localnet is still wrong.

Can the trixbox resolve your dynamic DNS name? Do an nslookup on the URL and make sure it resolves to the same IP you entered in externip.

Change your localnet line to read 192.168.2.0/255.255.255.0

--

Scott

aka "Skyking"



icntdrv
Posts: 8
Member Since:
2009-05-12
Thanks Scott, I didn't see

Thanks Scott, I didn't see your reply until after I posted. As my solution is not satisfactory I gave yours a go.

put in:
nat=yes
externhost = blablabla.dyndns.org
externrefresh = 5
localnet = 192.168.2.0/255.255.255.0

and the audio broke again. Any ideas why? I'm stumped. Could it be 2.6.2.2 does not support externhost?



icntdrv
Posts: 8
Member Since:
2009-05-12
Daggum Scott I just can't

Daggum Scott I just can't reply fast enough.

Yes it appears that Trixbox is resolving the IP correctly



nttranbao
Posts: 189
Member Since:
2008-02-16
I'm not sure, but I have

I'm not sure, but I have some cases that puting those lines in sip_nat.conf does not work, but moving them to sip_general_custom.conf works right away.

So you can try with sip_general_custom.conf, and see.

--

----------------------
IT/VOIP consultancy, VOIP eStore, Support Forum
Bao Nguyen IT Co., Ltd.
http://www.baonguyen.vn
WE MAKE IT



icntdrv
Posts: 8
Member Since:
2009-05-12
Well, I just tried that

Well, I just tried that too.

with sip_general_custom.conf set to:
nat=yes
externhost = blablabla.dyndns.org
externrefresh = 5
localnet = 192.168.2.0/255.255.255.0

I get no audio still.

--------------------

with sip_general_custom.conf set to:
nat=yes
externip = my.temporary.ip.address
localnet = 192.168.2.0/255.255.255.0

Audio works fine.

What could be causing the problem when using a dyndns url?



SkykingOH
Posts: 9537
Member Since:
2007-12-17
This is a strange one.

This is a strange one.

With a non working call in progress you could do an rtp debug to see what address it is resolving to, not sure how that will help but it would be interesting.

I am not sure if the Asterisk debug will display this value. You can try cranking up the debug to 128

I would also put an entry in /etc/host like testhost with your IP and then set the externhost to testhost just to make sure the process is working locally.

--

Scott

aka "Skyking"



NDBUK
Posts: 11
Member Since:
2009-03-12
Hi there, I had the same

Hi there,

I had the same problem, took me a while to find the issue. try making you hosts file look like this:

127.0.0.1 localhost
127.0.0.1 trixbox.domain.local trixbox.localhost trixbox

trixbox - Is your server name
domain.local - Is you domain name

Don`t know if it`ll solve your problem but worth a go. Also what router/Firewall are you using? I found on one of our sites the Speedtouch 5x6 Router was incapable of forwarding any port above 10,000.

Cheers
Si



icntdrv
Posts: 8
Member Since:
2009-05-12
AHA! My /etc/hosts file was

AHA!

My /etc/hosts file was wrong.

changed it to:

Quote:
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost
127.0.0.1 blablabla.dyndns.org blablabla.localhost blablabla

and its all peachy now.

Thanks

~Will



SkykingOH
Posts: 9537
Member Since:
2007-12-17
If you have your dynns.org

If you have your dynns.org addres pointed to the loopback address on the localhost how could that work?

--

Scott

aka "Skyking"



NDBUK
Posts: 11
Member Since:
2009-03-12
Sorry didn`t read the post

Sorry didn`t read the post right!

Doh! didnt see the DYNDNS bit!



icntdrv
Posts: 8
Member Since:
2009-05-12
I dunno. I just does. how

I dunno. I just works.

how should it look?



SkykingOH
Posts: 9537
Member Since:
2007-12-17
The way you have ti

The way you have ti configured that host should return the loopback address. I can't see how that would work.

--

Scott

aka "Skyking"



icntdrv
Posts: 8
Member Since:
2009-05-12
Sorry, I am really not sure

Sorry, I am really not sure how this works.

I commented out that line a la:

Quote:
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost
##127.0.0.1 blablabla.dyndns.org blablabla.localhost blablabla

and the audio still works.

Is there anything I should have in the /etc/hosts file to make my trixbox setup work properly?

I am noticing that in the "System Status" page "Public IP:" is "unknown"



jsherk
Posts: 41
Member Since:
2009-07-06
same problem

We are experiencing the same problem...

If I set the sip_nat.conf to externip=12.34.56.78 which is our temporary dynamic ip, then everything works fine, but if I set it to externhost=mydyndns.address.org (and remove the externip= line) it no longer works.

Running nslookup on mydyndns.address.org does show that it is correctly resolving the ip address.

I have tried multiple variations of the /etc/hosts file but that does not seem to make a difference.

Anybody else have any thoughts or suggestions?



sorvani
Posts: 163
Member Since:
2009-06-25
I am having the same

I am having the same problems with trixbox version 2.8.0 everything works fine as long as I am using the external IP and not the external host name.

From the CLI of the box, nxlookup resolves the external host correctly.
Posts on the same subject in this thread

here are some logs with rtp set debug on and asterisk at verbosity 3.
With externip
With externhost

--

Jared Busch
Office: Have 2.8.0.1 talking to 3 IPOffice403's.
Home: Have 2.8.0 with trunks from Vitelity, & CallWithUs.



sorvani
Posts: 163
Member Since:
2009-06-25
I do not see anything wrong

I do not see anything wrong with either one, but I do NOT have audio when externhost is used.

Those logs are from the trixbox I have running at the house. I made those logs while in the office behind a Cisco PIX 515 with everything locked down except normal NAT. X-Lite registers, and calls can be placed and calls can be received.

Is there another log file that would be beneficial for troubleshooting this issue?

--

Jared Busch
Office: Have 2.8.0.1 talking to 3 IPOffice403's.
Home: Have 2.8.0 with trunks from Vitelity, & CallWithUs.



clive306
Posts: 58
Member Since:
2007-02-26
I have used the following in

I have used the following in the sip_nat.conf file in the past and all has worked well..

#for DYNDNS setup
externhost=jobloggs.dyndns.org
externrefresh=28800
localnet=192.168.1.0/255.255.255.0

change externhost and local net to match your setup.

the audio issue you are getting, is it a one way thing?
i am currently having a problem (although i think its to do with my wireless setup) where i can hear the caller to the wireless handset but they don't hear me. but when i call them they hear me, so i guess its a nat registration issue on the network..



sorvani
Posts: 163
Member Since:
2009-06-25
you removed the nat=yes from

you removed the nat=yes from your sip_nat.conf?

As I have posted in the other thread, my install works perfectly as long as I use externip and not externhost.

DNS works perfectly from the command line. and above I posted a couple rtp debug's hoping someone can see something wrong them that I can not.

I really like the trixbox product so far, but having remote connections is a requirement for my office.

--

Jared Busch
Office: Have 2.8.0.1 talking to 3 IPOffice403's.
Home: Have 2.8.0 with trunks from Vitelity, & CallWithUs.



jstraten
Posts: 165
Member Since:
2006-08-16
Jared, Your issue seems to

Jared,

Your issue seems to be similar to my issue here http://www.trixbox.org/forums/trixbox-forums/help/tb-28-problem-n...

I have a question: Did you change the host name on trixbox?

I did and I am starting to wonder if we have a problem because we changed the host name. By reading through other related threads on the forum it seems that most people seem to have issues once they change the host name...

Thanks,
Jens

P.S.: UPDATE: I managed to resolve my issue. It is caused by a change in the behavior of CentOS/Trixbox. See my thread above and maybe it will help you as well.



sam
Posts: 56
Member Since:
2006-06-05
Hi All, See this

Hi All,

See this http://pny.hsh-grt.com/sip_nat.pdf it is my simple script to solved the problem I have. I am not a programmer. Just small script to make my thing work.

I hope this will help some one out there.

Sam



jstraten
Posts: 165
Member Since:
2006-08-16
Thanks Sam. The web page

Thanks Sam.

The web page used in that script currently gives me a timeout, but I will try it again tomorrow morning.

Will let you know if it works.

Jens



sorvani
Posts: 163
Member Since:
2009-06-25
That is a good solution Sam.

Jens,
I have read your other post, and I did change my host name when I set up the box originally. I can blow out the install and try it again leaving everything default, but it will be a week before I can try that most likely.

Sam,
That is a good solution, maybe someone who knows Linux shell scripting can add something to handle an invalid return from everdot. I know enough to read it, but don't want to try and change it.

Sam's solution is only a work around for the correct functionality though.

Using externhost gives no/one way audio
Using externip give full audio

Using nslookup from the command line will resolve externhost correctly.

I don't remember if there was anything in the bug tracker on this, I will check and post if there is not. Everyone here has been really helpful trying to solve this issue!

--

Jared Busch
Office: Have 2.8.0.1 talking to 3 IPOffice403's.
Home: Have 2.8.0 with trunks from Vitelity, & CallWithUs.



ryanww
Posts: 4
Member Since:
2009-01-14
Hey Sam, I was able to get

Hey Sam,

I was able to get the link PDF 3 days ago and now it says it can't be found! I am trying to re-do a box and I really need it! It helped me out! If you could check it or email it to me, that would be awesome. ryanwilkinson at mac d0t com.

Thanks soo much!!!



mancy
Posts: 7
Member Since:
2010-04-13
same but [SOLVED]

hello all
i wanted to share my simple solution which i used to update my externip
i've made /root/dd.sh shell script to update the externip

x=`curl -s -S --user-agent "Mozilla/4.0" http://myip.pbxinaflash.com | awk 'NR==2'`
echo "externip = $x" > /etc/asterisk/sip_nat.conf
echo "localnet = 192.168.1.0/255.255.255.0" >> /etc/asterisk/sip_nat.conf
asterisk -rx "sip reload"
echo $x

put the above code into /root/dd.sh for example

chmod 755 dd.sh

then add the shell file to the cronjob to update every certain time

59 * * * * /root/dd.sh &> /dev/null

hope it helps someone
Best Regards
Mancy



SkykingOH
Posts: 9537
Member Since:
2007-12-17
Mancy - Why would you have

Mancy -

Why would you have to do this? The externhost and externresfresh variables do the same thing.

--

Scott

aka "Skyking"



mancy
Posts: 7
Member Since:
2010-04-13
in my case i were not able

in my case i were not able to get externresfresh and externhost works correctly
every-time i check "sip show settings"
i found wrong External IP set.

one more reason for sharing the sh, because some are using "hostname" same as the dynamic domain, which is wrong
because when

127.0.0.1 name.dyndns.org

if he set externhost= name.dyndns.org
then it will goes to 127.0.0.1



zigg.z
Posts: 56
Member Since:
2009-08-20
1 way audio, but because it grabs HIGH port numbers

I have a box that has worked well for a year until I moved out of state to a new service provider/IP address, and also behind a new firewall.
I have gone through all the mentioned issues in the SIP_NAT.CONF, SIP_GENERAL_CUSTOM, etc etc...
I have a static address, and all is changed to the new address properly. The system works well as a local office with all features going through, and I put a remote extension on a few weeks ago, it worked for a while, and now remote or new local extensions are not working because when they register, the Asterisk info/Sip info shows that extension registered on ports 27929, or 43207, or 45254, or 27800, etc. ...????
Can someone help me to understand why they are grabbing such incredibly high numbers?

If it helps, the firewall is a CearOS system on a standalone computer acting as our gateway. I am (mostly) certain that all rules are correct, just simple SIP port forwarding...(?)

Thanks in advance.



Atcom Alberta
Posts: 219
Member Since:
2008-07-14
Those port numbers are on

Those port numbers are on the remote side and are assigned by the remote router - the high numbers are not an issue. Look elsewhere for your problem...



zigg.z
Posts: 56
Member Since:
2009-08-20
Thanks for the reply. Only

Thanks for the reply.
Only those phones with high port numbers do not work. I set up a new phone locally on the inside network just now to test further, and it was assigned port 61012, and it does not have audio. Typical of the issues already stated.
For the last year its been pretty much plug and play, and I dont know of any changes made, and would like to know how to control the far reaching port numbers, to keep them within reasonable range.



Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.