2

I'm running Ubuntu MATE 16.04 (Xenial Xerus) - 64-bit "Desktop" version - in a HP laptop computer.

I have a question regarding NTP (Network Time Protocol): if i run the command "ntpq -p", I then get the following results:

$ ntpq -p
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
 0.ubuntu.pool.n .POOL.          16 p    -   64    0    0.000    0.000   0.000
 1.ubuntu.pool.n .POOL.          16 p    -   64    0    0.000    0.000   0.000
 2.ubuntu.pool.n .POOL.          16 p    -   64    0    0.000    0.000   0.000
 3.ubuntu.pool.n .POOL.          16 p    -   64    0    0.000    0.000   0.000
 ntp.ubuntu.com  .POOL.          16 p    -   64    0    0.000    0.000   0.000
-mirrors.dominio 195.220.94.163   3 u   43  256  377   15.209    0.548   0.786
+ntp02.oal.ul.pt 194.117.9.138    2 u  194  256  377   10.934   -0.398   0.783
+a88-157-128-22. 212.113.174.246  3 u    7  256  377    7.905   -0.105   0.156
-smtp-in1.aqea.n 194.117.9.136    3 u  120  256  377   10.117    0.000   0.269
*ns.rnl.tecnico. 131.188.3.222    2 u   56  256  377   11.111    0.135   9.384

However, if I run the "peers" command in an "ntpdc" shell, I get an error message:

$ ntpdc
ntpdc> peers
localhost: timed out, nothing received
***Request timed out
ntpdc> quit

I haven't changed the NTP configuration file (/etc/ntp.conf) from its default configuration. The drift file / driftfile "/var/lib/ntp/ntp.drift" did not exist, so I created it using "touch /var/lib/ntp/ntp.drift", changed its ownership to the "ntp" user and group (using "chown ntp:ntp /var/lib/ntp/ntp.drift") and even rebooted the computer. This did not make any difference.

The "localhost: timed out, nothing received" error happens regardless if I run it as "ntpdc" or "sudo ntpdc", and it happens regardless if I'm running the "ufw" firewall or not.

The log file /var/log/syslog has the following seemingly related entries:

Jul 17 14:48:08 myhostname ntpd[1467]: kernel reports TIME_ERROR: 0x41: Clock Unsynchronized
Jul 17 14:52:16 myhostname ntpd[1467]: 91.189.89.199 local addr 192.168.1.2 -> <null>
Jul 17 14:52:20 myhostname ntpd[1467]: 91.189.94.4 local addr 192.168.1.2 -> <null>
Jul 17 14:52:34 myhostname ntpd[1467]: 5.135.59.152 local addr 192.168.1.2 -> <null>
Jul 17 14:52:40 myhostname ntpd[1467]: 62.48.148.210 local addr 192.168.1.2 -> <null>

I'm guessing that the error "kernel reports TIME_ERROR: 0x41: Clock Unsynchronized" is relevant.

The "ntp" service is running:

$ systemctl status ntp
● ntp.service - LSB: Start NTP daemon
   Loaded: loaded (/etc/init.d/ntp; bad; vendor preset: enabled)
   Active: active (running) since Dom 2016-07-17 14:42:23 WEST; 1h 20min ago
     Docs: man:systemd-sysv-generator(8)
  Process: 1442 ExecStart=/etc/init.d/ntp start (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/ntp.service
           └─1467 /usr/sbin/ntpd -p /var/run/ntpd.pid -g -u 109:116

Jul 17 14:42:27 myhostname ntpd[1467]: Soliciting pool server 62.48.148.210
Jul 17 14:42:27 myhostname ntpd[1467]: receive: Unexpected origin timestamp from 5.135.59.152
Jul 17 14:42:28 myhostname ntpd[1467]: Soliciting pool server 2001:690:2100:80::1
Jul 17 14:42:28 myhostname ntpd[1467]: Soliciting pool server 91.189.89.199
Jul 17 14:42:29 myhostname ntpd[1467]: Soliciting pool server 91.189.94.4
Jul 17 14:48:08 myhostname ntpd[1467]: kernel reports TIME_ERROR: 0x41: Clock Unsynchronized
Jul 17 14:52:16 myhostname ntpd[1467]: 91.189.89.199 local addr 192.168.1.2 -> <null>
Jul 17 14:52:20 myhostname ntpd[1467]: 91.189.94.4 local addr 192.168.1.2 -> <null>
Jul 17 14:52:34 myhostname ntpd[1467]: 5.135.59.152 local addr 192.168.1.2 -> <null>
Jul 17 14:52:40 myhostname ntpd[1467]: 62.48.148.210 local addr 192.168.1.2 -> <null>

Could you help me to troubleshoot this, please?

3

ntpdc uses mode 7 requests and ntpq uses mode 6 requests. Mode 7 requests are often used as a DDoS and therefore newer default configurations have mode 7 requests blocked. You can get all of the information you need from ntpq -p. There is no need to use ntpdc, but do not take my word for it:

ntpdc is deprecated - please use ntpq now, as it uses a more sane interface and can provide all of the information that ntpdc used to provide.

https://www.eecis.udel.edu/~mills/ntp/html/ntpdc.html

2
  • It doesn't provide me all the information if I can't issue monlist to it. – Avamander Dec 27 '19 at 23:58
  • 1
    Use mrulist instead – dfc Feb 9 '20 at 13:09
3

To enable mode 7 use the following option in the ntp config file

# enable mode 7 to support ntpdc
enable mode7

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.