Hello everyone!
Perhaps someone on here would be able to help me, because I have been struggling with this problem for a while and have no idea why it keeps happening.
Whenever I try to force my client to do a one time sync with my ntp server, I use the command ntpd -gq. I first run it on my server, then run it on my clients to sync to the ntp server that I have. But I always get this error, even when timedatectl reports the same time for server and clients:
For information:
192.168.50.4 → ntp server (node1)
192.168.50.5 → ntp client (node2)
Here is the error when I try to run it manually:
$ sudo ntpd -gqd
ntpd 4.2.6p5@1.2349-o Wed Apr 12 21:24:06 UTC 2017 (1)
20 Mar 02:43:29 ntpd[18010]: proto: precision = 0.063 usec
20 Mar 02:43:29 ntpd[18010]: 0.0.0.0 c01d 0d kern kernel time sync enabled
event at 0 0.0.0.0 c01d 0d kern kernel time sync enabled
Finished Parsing!!
restrict: op 1 addr 0.0.0.0 mask 0.0.0.0 mflags 00000000 flags 000001d0
restrict: op 1 addr :: mask 0.0.0.0 mflags 00000000 flags 000001d0
restrict: op 1 addr 127.0.0.1 mask 255.255.255.255 mflags 00000000 flags 00000000
restrict: op 1 addr ::1 mask ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff mflags 00000000 flags 00000000
20 Mar 02:43:29 ntpd[18010]: ntp_io: estimated max descriptors: 64000, initial socket boundary: 16
20 Mar 02:43:29 ntpd[18010]: Listen and drop on 0 v4wildcard 0.0.0.0 UDP 123
20 Mar 02:43:29 ntpd[18010]: Listen and drop on 1 v6wildcard :: UDP 123
20 Mar 02:43:29 ntpd[18010]: Listen normally on 2 lo 127.0.0.1 UDP 123
restrict: op 1 addr 127.0.0.1 mask 255.255.255.255 mflags 00003000 flags 00000001
20 Mar 02:43:29 ntpd[18010]: Listen normally on 3 eth0 10.0.2.15 UDP 123
restrict: op 1 addr 10.0.2.15 mask 255.255.255.255 mflags 00003000 flags 00000001
20 Mar 02:43:29 ntpd[18010]: Listen normally on 4 eth1 192.168.50.5 UDP 123
restrict: op 1 addr 192.168.50.5 mask 255.255.255.255 mflags 00003000 flags 00000001
20 Mar 02:43:29 ntpd[18010]: Listen normally on 5 lo ::1 UDP 123
restrict: op 1 addr ::1 mask ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff mflags 00003000 flags 00000001
20 Mar 02:43:29 ntpd[18010]: Listen normally on 6 eth0 fe80::a00:27ff:fe2d:3fba UDP 123
restrict: op 1 addr fe80::a00:27ff:fe2d:3fba mask ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff mflags 00003000 flags 00000001
20 Mar 02:43:29 ntpd[18010]: Listen normally on 7 eth1 fe80::a00:27ff:fed1:69a2 UDP 123
restrict: op 1 addr fe80::a00:27ff:fed1:69a2 mask ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff mflags 00003000 flags 00000001
20 Mar 02:43:29 ntpd[18010]: Listening on routing socket on fd #24 for interface updates
key_expire: at 0 associd 15167
peer_clear: at 0 next 1 associd 15167 refid INIT
event at 0 192.168.50.4 8011 81 mobilize assoc 15167
newpeer: 192.168.50.5->192.168.50.4 mode 3 vers 4 poll 6 10 flags 0x101 0x1 ttl 0 key 00000000
20 Mar 02:43:29 ntpd[18010]: 0.0.0.0 c016 06 restart
event at 0 0.0.0.0 c016 06 restart
20 Mar 02:43:29 ntpd[18010]: 0.0.0.0 c012 02 freq_set kernel 0.000 PPM
event at 0 0.0.0.0 c012 02 freq_set kernel 0.000 PPM
20 Mar 02:43:29 ntpd[18010]: 0.0.0.0 c011 01 freq_not_set
event at 0 0.0.0.0 c011 01 freq_not_set
transmit: at 1 192.168.50.5->192.168.50.4 mode 3 len 48
auth_agekeys: at 1 keys 1 expired 0
receive: at 1 192.168.50.5<-192.168.50.4 mode 4 len 48
packet: flash header 1620
transmit: at 3 192.168.50.5->192.168.50.4 mode 3 len 48
receive: at 3 192.168.50.5<-192.168.50.4 mode 4 len 48
packet: flash header 1620
transmit: at 5 192.168.50.5->192.168.50.4 mode 3 len 48
receive: at 5 192.168.50.5<-192.168.50.4 mode 4 len 48
packet: flash header 1620
transmit: at 7 192.168.50.5->192.168.50.4 mode 3 len 48
receive: at 7 192.168.50.5<-192.168.50.4 mode 4 len 48
packet: flash header 1620
transmit: at 9 192.168.50.5->192.168.50.4 mode 3 len 48
receive: at 9 192.168.50.5<-192.168.50.4 mode 4 len 48
packet: flash header 1620
20 Mar 02:43:40 ntpd[18010]: ntpd: no servers found
ntpd: no servers found
Ntpq reports what seems to be like everything is running fine and is in sync:
vagrant ssh node1 -c "timedatectl"; vagrant ssh node2 -c "timedatectl"
Local time: Tue 2018-03-20 21:41:16 UTC
Universal time: Tue 2018-03-20 21:41:16 UTC
RTC time: Tue 2018-03-20 21:41:16
Time zone: UTC (UTC, +0000)
NTP enabled: yes
NTP synchronized: yes
RTC in local TZ: no
DST active: n/a
Connection to 127.0.0.1 closed.
Local time: Tue 2018-03-20 21:41:18 UTC
Universal time: Tue 2018-03-20 21:41:18 UTC
RTC time: Tue 2018-03-20 21:41:18
Time zone: UTC (UTC, +0000)
NTP enabled: yes
NTP synchronized: yes
RTC in local TZ: no
DST active: n/a
Connection to 127.0.0.1 closed.
Output of timedatectl:
vagrant ssh node1 -c "sudo ntpq -p"; vagrant ssh node2 -c "sudo ntpq -p"
remote refid st t when poll reach delay offset jitter
==============================================================================
+ntp3.inx.net.za 238.72.153.243 2 u 15 64 375 313.143 1777.74 5.961
+a88-157-128-22. 212.113.174.246 3 u 62 64 377 170.548 1771.66 5.686
-gw3.rbx.ip4.ser 95.81.173.155 3 u 99 64 372 151.612 1772.92 8.263
*209-133-217-165 128.227.205.3 2 u 65 64 377 75.908 1773.46 5.640
LOCAL(0) .LOCL. 10 l 1077 64 0 0.000 0.000 0.000
Connection to 127.0.0.1 closed.
remote refid st t when poll reach delay offset jitter
==============================================================================
192.168.50.4 209.133.217.165 3 u 52 64 1 0.796 305.004 0.025
Connection to 127.0.0.1 closed.
But when I run ntpdate:
vagrant ssh node2 -c "sudo ntpdate -q 192.168.50.4"
server 192.168.50.4, stratum 3, offset 2.350316, delay 0.02652
20 Mar 21:52:20 ntpdate[24991]: no server suitable for synchronization found
Connection to 127.0.0.1 closed.
More output from ntpdate says something about the leap not in sync?
sudo ntpdate -d 192.168.50.4
20 Mar 21:53:52 ntpdate[25048]: ntpdate 4.2.6p5@1.2349-o Wed Apr 12 21:24:06 UTC 2017 (1)
Looking for host 192.168.50.4 and service ntp
host found : 192.168.50.4
transmit(192.168.50.4)
receive(192.168.50.4)
transmit(192.168.50.4)
receive(192.168.50.4)
transmit(192.168.50.4)
receive(192.168.50.4)
transmit(192.168.50.4)
receive(192.168.50.4)
192.168.50.4: Server dropped: Leap not in sync
server 192.168.50.4, port 123
stratum 3, precision -24, leap 11, trust 000
refid [192.168.50.4], delay 0.02635, dispersion 0.00209
transmitted 4, in filter 4
reference time: de5c0147.2a2fd231 Tue, Mar 20 2018 21:53:11.164
originate timestamp: de5c0179.23da7cbe Tue, Mar 20 2018 21:54:01.140
transmit timestamp: de5c0176.bd281638 Tue, Mar 20 2018 21:53:58.738
filter delay: 0.02635 0.02649 0.02649 0.02647
0.00000 0.00000 0.00000 0.00000
filter offset: 2.397629 2.398641 2.399625 2.400611
0.000000 0.000000 0.000000 0.000000
delay 0.02635, dispersion 0.00209
offset 2.397629
After 5 minutes ntpdate showed leap 00, and ran fine… im very confused what is going on.