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 220.127.116.11: 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 ============================================================================== +18.104.22.168 22.214.171.124 3 - 129 128 376 27.339 14.405 12.857 ntpq> host 126.96.36.199 current host set to 188.8.131.52 ntpq> pe 184.108.40.206: timed out, nothing received ***Request timed out
ntptrace uses a combination of
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
server 220.127.116.11(skipping 18.104.22.168) into
- 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
ntpqonly to trace the NTP server chain?
- Why isn't ntptrace working in the first place?