SRX Services Gateway
Reply
Trusted Contributor
stine
Posts: 437
Registered: ‎05-05-2008
0
Accepted Solution

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

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)
Distinguished Expert
aarseniev
Posts: 1,704
Registered: ‎08-21-2009
0

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

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

___________________________________
Accept as Solution = cool !
Accept as Solution+Kudo = You are a Star !
Trusted Contributor
stine
Posts: 437
Registered: ‎05-05-2008
0

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

[ Edited ]

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)
Distinguished Expert
aarseniev
Posts: 1,704
Registered: ‎08-21-2009

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

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

___________________________________
Accept as Solution = cool !
Accept as Solution+Kudo = You are a Star !
Trusted Contributor
stine
Posts: 437
Registered: ‎05-05-2008
0

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

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)
Distinguished Expert
aarseniev
Posts: 1,704
Registered: ‎08-21-2009
0

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

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

___________________________________
Accept as Solution = cool !
Accept as Solution+Kudo = You are a Star !
Trusted Contributor
stine
Posts: 437
Registered: ‎05-05-2008
0

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

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)
Distinguished Expert
aarseniev
Posts: 1,704
Registered: ‎08-21-2009
0

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

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

___________________________________
Accept as Solution = cool !
Accept as Solution+Kudo = You are a Star !
Copyright© 1999-2013 Juniper Networks, Inc. All rights reserved.