For educational purposes I wanted to trace a chain of NTP servers, e.g. 0.de.pool.ntp.org back to a stratum 1 NTP server. How can I do this?
I found ntptrace, but it doesn't work:
/home/xyzdragon# ntptrace
localhost: stratum 2, offset -0.009285, synch distance 0.010221
192.53.103.104: timed out, nothing received
***Request timed out
I tried to debug /usr/bin/ntptrace
by reproducing the steps of that Perl-script manually:
home/xyzdragon# ntpq -n
ntpq> pe
remote refid st t when poll reach delay offset jitter
==============================================================================
+78.47.249.19 56.1.129.236 3 - 129 128 376 27.339 14.405 12.857
ntpq> host 78.47.249.19
current host set to 78.47.249.19
ntpq> pe
78.47.249.19: timed out, nothing received
***Request timed out
Actually ntptrace
uses a combination of rv
and pstat
instead of the pe
ntpq command.
After several tries getting it to work with ntpq, I just used a workaround:
- Read peer and refid from `ntpq -p
- Insert
server 56.1.129.236
(skipping 78.47.249.19) into/etc/ntp.conf
- Apply settings with
sudo service ntp restart
- Go to 1.
This works to trace an NTP chain, but it is very tedious. My questions therefore are:
- How can I use maybe
ntpq
only to trace the NTP server chain? - Why isn't ntptrace working in the first place?