[ntp:questions] simple nt.conf cases for ntp-client
brontolinux at gmail.com
Thu Jan 23 08:36:35 UTC 2014
In your questions, you are showing configuration snippets as they were
taken from some "authoritative" source. Would you mind sharing that source?
As for me, I consider the following to be *the* authoritative sources
for anything NTP:
That said, let's see.
On 01/23/2014 08:29 AM, ardi wrote:
> Below are described some basic cases for ntp.conf on ntp-client:
> In the simplest case of ntp-client the following ntp.conf is defined:
> restrict default noquery nomodify notrap
> restrict 127.0.0.1
> driftfile /var/lib/ntp/ntp.drift
> server xx.xx.xx.xx minpoll 4 maxpoll 4
> restrict xx.xx.xx.xx
> Why should i need the restrict line xx.xx.xx.xx?
> What does the first restrict line means?
First things first: why minpoll and maxpoll? The defaults are generally
OK -- I had to change that manually only in special cases, and I can
count them on one hand.
Regarding restrict, everything you need to know about noquery, nomodify,
notrap is here, along with all the information about that directive:
If you need some guidance to select the right restrictions that work for
you, please see
> b1)In case using 2 ntp-servers from which my ntp-client can get time,
> is my ntp-client taking time from xx.xx.xx.xx
> and if this server is not reachable then from xx.xx.xx.yy?
First: don't use two servers, it's the worst possible configuration.
The server selection algorithm and why you should use four servers
whenever possible is sketched here:
> What does prefer do in this case b2)?
See this page, section "The prefer Peer", after reading the reference
above. In short: if the server marked with "prefer" is selected as a
survivor, it will be preferred among all other survivors -- it will be
used when the algorithm would otherwise have selected another server.
> Is there any difference between b1) and b2) case?
This is left as an exercise to the reader :)
> what about this case b3) below?
> Is time taken for the ntp-client according to order of lines - i mean the xx.xx.xx.xx is taken as time source?
> or the 2nd server xx.xx.xx.yy is preferred?
This should be fairly clear now, if you took the time to check the
references I've mentioned.
I'd be really curious to check the source of your snippets. Is it a web
page we can take a peep at?
More information about the questions