'ntpq> peers' gives error "Request timed out" after upgrading to ntp-4.2.6p5 package.

Solution Verified - Updated -

Environment

  • Red Hat Enterprise Linux 6.5
  • ntp-4.2.6p5-1.el6

Issue

  • 'ntpq> peers' gives error "Request timed out" after upgrading to ntp-4.2.6p5 package.
[root@ntp-4.2.6 ~]# ntpq
ntpq> peer
localhost: timed out, nothing received
***Request timed out

Resolution

  • Make changes as below in /etc/ntp.conf file and restart ntpd service:
either change "restrict default ignore" to "restrict -4 default ignore"
or change "restrict 127.0.0.1 mask 255.255.255.255" to "restrict localhost"

Root Cause

  • With earlier package of ntp, "restrict default ignore" restricted only IPv4.

Diagnostic Steps

  • From test setup with earlier ntp package:
[root@ntp-4.2.4 ~]# rpm -qa | grep ntp
ntpdate-4.2.4p8-2.el6.x86_64
ntp-4.2.4p8-2.el6.x86_64

[root@ntp-4.2.4 ~]# cat /etc/ntp.conf 

restrict default ignore
restrict 127.0.0.1 mask 255.255.255.255


[root@ntp-4.2.4 ~]# ntpq
ntpq> peers
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
+clock.util.phx2 .CDMA.           1 u   82  128  377  311.936    0.384  69.294
*clock02.util.ph .CDMA.           1 u   79  128  377  312.247    0.162  58.144
  • Now with latest upgraded version ntp package:
[root@ntp-4.2.6 ~]# rpm -qa | grep ntp
ntp-4.2.6p5-1.el6.x86_64
ntpdate-4.2.6p5-1.el6.x86_64


[root@ntp-4.2.6 ~]# grep -v "^#" /etc/ntp.conf 

restrict default ignore
restrict 127.0.0.1 mask 255.255.255.255


[root@ntp-4.2.6 ~]# ntpq
ntpq> peer
localhost: timed out, nothing received
***Request timed out
ntpq> 
  • With old package of ntp, "restrict default ignore" restricted only IPv4 and that the reason we had statement restrict -6 default,
    i.e it's the default line, before it was applied only to IPv4, now it's applied to both IPv4 and IPv6.

  • With the previous package and that configuration the IPv6 access wasn't restricted at all.

  • Component
  • ntp

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

1 Comments

The 2nd resolution (change "restrict 127.0.0.1 mask 255.255.255.255" to "restrict localhost"), when applied to the example, has a deficiency. It does not allow the ntpstat command to work.

[root@localhost ~]# cat /etc/ntp.conf
restrict default ignore
restrict 127.0.0.1 mask 255.255.255.255

[root@localhost ~]# vi /etc/ntp.conf

[root@localhost ~]# cat /etc/ntp.conf
restrict default ignore
restrict localhost

[root@localhost ~]# /etc/init.d/ntpd restart
Shutting down ntpd: [ OK ]
Starting ntpd: [ OK ]

[root@localhost ~]# ntpstat
timeout

One has to use the 1st resolution (change "restrict default ignore" to "restrict -4 default ignore") for both ntpstat and ntpq to work.

[root@localhost ~]# cat /etc/ntp.conf
restrict -4 default ignore
restrict 127.0.0.1 mask 255.255.255.255

[root@localhost ~]# /etc/init.d/ntpd restart
Shutting down ntpd: [ OK ]
Starting ntpd: [ OK ]

[root@localhost ~]# ntpstat
unsynchronised
time server re-starting
polling server every 8 s

[root@localhost ~]# ntpq -p
No association ID's returned