SRX Services Gateway
SRX Services Gateway

/usr/bin/ntpq: write to localhost failed: No route to host

11.26.09   |  
‎11-26-2009 09:29 PM

I get this error when I use the 'show NTP status' command.   I'm not sure what's causing it.  I have two srxs, 1 650 and 1 240, with each being an NTP server on the other.   I get the error on the 650, but on the 240, the same command shows that the 650 is responding every 65 seconds and that the 650 is syncing to one of my other NTP servers....

 

I have the same configuration on both the 650 and the 240, and I'm not having Any problems on the 240.

 

Any ideas?

Theodore E Van Iderstine
Stream Networks
+1 678 373 4200 x125
JNCIA-ER (expired), JNCIA-SSL (ditto)
7 REPLIES
SRX Services Gateway

Re: /usr/bin/ntpq: write to localhost failed: No route to host

11.27.09   |  
‎11-27-2009 01:18 PM

Hi there,

Do you have name-server(s) configured on your SRXes?

If yes can DNS server(s) resolve A localhost and PTR 127.0.0.1?

Also, do you have any IP address on lo0.0 interface?

Rgds

Alex

_____________________________________________________________________

Please ask Your Juniper account team about Juniper Professional Services offerings.
Juniper PS can design, test & build the network/part of the network as per Your requirements

+++++++++++++++++++++++++++++++++++++++++++++

Accept as Solution = cool !
Accept as Solution+Kudo = You are a Star !
SRX Services Gateway

Re: /usr/bin/ntpq: write to localhost failed: No route to host

[ Edited ]
11.27.09   |  
‎11-27-2009 02:02 PM

No, I do not have any DNS servers defined.  isn't localhost/1.0.0.127.INADDR.ARPA resolved in /etc/hosts in the BSD subsystem?

 

and no, i don't have an address assigned to lo0

Theodore E Van Iderstine
Stream Networks
+1 678 373 4200 x125
JNCIA-ER (expired), JNCIA-SSL (ditto)
SRX Services Gateway
Solution
Accepted by topic author stine
‎08-26-2015 01:27 AM

Re: /usr/bin/ntpq: write to localhost failed: No route to host

11.27.09   |  
‎11-27-2009 11:39 PM

Hi Theodore,

I suggest you do this:

1/ assign 127.0.0.1 to lo0.0

2/ create static-host-mapping:

set system static-host-mapping localhost inet 127.0.0.1

Please let me know if if cures your problem.

Rgds

Alex

_____________________________________________________________________

Please ask Your Juniper account team about Juniper Professional Services offerings.
Juniper PS can design, test & build the network/part of the network as per Your requirements

+++++++++++++++++++++++++++++++++++++++++++++

Accept as Solution = cool !
Accept as Solution+Kudo = You are a Star !
SRX Services Gateway

Re: /usr/bin/ntpq: write to localhost failed: No route to host

12.11.09   |  
‎12-11-2009 07:15 PM

Thanks Alex, that solved the problem (i can now run:  show ntp associations)

 

I would really like to undstand the problem better because according to 'show ntp status', the NTP clients were able to sync to my three ntp servers, even while I could not view the associations.

 

thanks

 

Theodore E Van Iderstine
Stream Networks
+1 678 373 4200 x125
JNCIA-ER (expired), JNCIA-SSL (ditto)
SRX Services Gateway

Re: /usr/bin/ntpq: write to localhost failed: No route to host

12.12.09   |  
‎12-12-2009 12:33 PM

Hi Theodore,

"show ntp associations" is the same as FreeBSD  command:

 

ntpq -c lpeers localhost

 

More information on FreeBSD website http://www.freebsd.org/cgi/man.cgi?query=ntpq&apropos=0&sektion=0&manpath=FreeBSD+6.1-RELEASE&format...

 

As JUNOS box cannot resolve localhost and send a NTP mode 6 control message to self (I know it sounds weird but that's how ntpq works) that's why you got these errors.

 

Rgds

Alex

_____________________________________________________________________

Please ask Your Juniper account team about Juniper Professional Services offerings.
Juniper PS can design, test & build the network/part of the network as per Your requirements

+++++++++++++++++++++++++++++++++++++++++++++

Accept as Solution = cool !
Accept as Solution+Kudo = You are a Star !
SRX Services Gateway

Re: /usr/bin/ntpq: write to localhost failed: No route to host

12.12.09   |  
‎12-12-2009 11:02 PM

OK, while that explains how it works, does it also mean that ntp has to be associated with the default routing table inet.0 ???

Theodore E Van Iderstine
Stream Networks
+1 678 373 4200 x125
JNCIA-ER (expired), JNCIA-SSL (ditto)
SRX Services Gateway

Re: /usr/bin/ntpq: write to localhost failed: No route to host

12.13.09   |  
‎12-13-2009 12:36 AM

Correct. NTP is not virtualized meaning NTP server and client IP addresses must be in inet.0/master routing-instance.

_____________________________________________________________________

Please ask Your Juniper account team about Juniper Professional Services offerings.
Juniper PS can design, test & build the network/part of the network as per Your requirements

+++++++++++++++++++++++++++++++++++++++++++++

Accept as Solution = cool !
Accept as Solution+Kudo = You are a Star !