How can I deny in my /etc/ntp/ntp.conf to sync with the NTP server with specific stratum level (e.g. more than 5 )?
I have a bad NTP server in my local network and sometimes is going really wrong after starting offline. I don't have internet and I cannot use public NTP servers for adjust time in my server.
This NTP server is not my server and I cannot rights to change config on it. In this case, NTP server cannot connect to other NTP servers online, so it is have not the exact time, and stratum level is changing from level 2 (then it is good) to level 9 (then it is bad).
Syncing time with bad NTP server with stratum 9:
root@ubuntuserver1604lts:~# ntpq -p
remote refid st t when poll reach delay offset jitter
==============================================================================
*172.112.2.14 11.22.33.44 9 u 60 64 397 0.565 -53.519 2.984
LOCAL(0) .LOCL. 10 l 9h 64 0 0.000 0.000 0.000
I want to filter out temporarily NTP servers then stratum is "9" (or 4 or more) and syncronize time only then stratum is "4" or lower.