ntp.conf.mdoc.in revision 301301
1301301Sdelphij.Dd June 2 2016
2275970Scy.Dt NTP_CONF 5 File Formats
3275970Scy.Os
4275970Scy.\"  EDIT THIS FILE WITH CAUTION  (ntp.mdoc)
5275970Scy.\"
6301301Sdelphij.\"  It has been AutoGen-ed  June  2, 2016 at 07:36:16 AM by AutoGen 5.18.5
7275970Scy.\"  From the definitions    ntp.conf.def
8275970Scy.\"  and the template file   agmdoc-cmd.tpl
9275970Scy.Sh NAME
10275970Scy.Nm ntp.conf
11275970Scy.Nd Network Time Protocol (NTP) daemon configuration file format
12275970Scy.Sh SYNOPSIS
13275970Scy.Nm
14275970Scy.Op Fl \-option\-name
15275970Scy.Op Fl \-option\-name Ar value
16275970Scy.Pp
17275970ScyAll arguments must be options.
18275970Scy.Pp
19275970Scy.Sh DESCRIPTION
20275970ScyThe
21275970Scy.Nm
22275970Scyconfiguration file is read at initial startup by the
23275970Scy.Xr ntpd @NTPD_MS@
24275970Scydaemon in order to specify the synchronization sources,
25275970Scymodes and other related information.
26275970ScyUsually, it is installed in the
27275970Scy.Pa /etc
28275970Scydirectory,
29275970Scybut could be installed elsewhere
30275970Scy(see the daemon's
31275970Scy.Fl c
32275970Scycommand line option).
33275970Scy.Pp
34275970ScyThe file format is similar to other
35275970Scy.Ux
36275970Scyconfiguration files.
37275970ScyComments begin with a
38275970Scy.Ql #
39275970Scycharacter and extend to the end of the line;
40275970Scyblank lines are ignored.
41275970ScyConfiguration commands consist of an initial keyword
42275970Scyfollowed by a list of arguments,
43275970Scysome of which may be optional, separated by whitespace.
44275970ScyCommands may not be continued over multiple lines.
45275970ScyArguments may be host names,
46275970Scyhost addresses written in numeric, dotted\-quad form,
47275970Scyintegers, floating point numbers (when specifying times in seconds)
48275970Scyand text strings.
49275970Scy.Pp
50275970ScyThe rest of this page describes the configuration and control options.
51275970ScyThe
52275970Scy.Qq Notes on Configuring NTP and Setting up an NTP Subnet
53275970Scypage
54275970Scy(available as part of the HTML documentation
55275970Scyprovided in
56275970Scy.Pa /usr/share/doc/ntp )
57275970Scycontains an extended discussion of these options.
58275970ScyIn addition to the discussion of general
59275970Scy.Sx Configuration Options ,
60275970Scythere are sections describing the following supported functionality
61275970Scyand the options used to control it:
62275970Scy.Bl -bullet -offset indent
63275970Scy.It
64275970Scy.Sx Authentication Support
65275970Scy.It
66275970Scy.Sx Monitoring Support
67275970Scy.It
68275970Scy.Sx Access Control Support
69275970Scy.It
70275970Scy.Sx Automatic NTP Configuration Options
71275970Scy.It
72275970Scy.Sx Reference Clock Support
73275970Scy.It
74275970Scy.Sx Miscellaneous Options
75275970Scy.El
76275970Scy.Pp
77275970ScyFollowing these is a section describing
78275970Scy.Sx Miscellaneous Options .
79275970ScyWhile there is a rich set of options available,
80275970Scythe only required option is one or more
81275970Scy.Ic pool ,
82275970Scy.Ic server ,
83275970Scy.Ic peer ,
84275970Scy.Ic broadcast
85275970Scyor
86275970Scy.Ic manycastclient
87275970Scycommands.
88275970Scy.Sh Configuration Support
89275970ScyFollowing is a description of the configuration commands in
90275970ScyNTPv4.
91275970ScyThese commands have the same basic functions as in NTPv3 and
92275970Scyin some cases new functions and new arguments.
93275970ScyThere are two
94275970Scyclasses of commands, configuration commands that configure a
95275970Scypersistent association with a remote server or peer or reference
96275970Scyclock, and auxiliary commands that specify environmental variables
97275970Scythat control various related operations.
98275970Scy.Ss Configuration Commands
99275970ScyThe various modes are determined by the command keyword and the
100275970Scytype of the required IP address.
101275970ScyAddresses are classed by type as
102275970Scy(s) a remote server or peer (IPv4 class A, B and C), (b) the
103275970Scybroadcast address of a local interface, (m) a multicast address (IPv4
104275970Scyclass D), or (r) a reference clock address (127.127.x.x).
105275970ScyNote that
106275970Scyonly those options applicable to each command are listed below.
107275970ScyUse
108275970Scyof options not listed may not be caught as an error, but may result
109275970Scyin some weird and even destructive behavior.
110275970Scy.Pp
111275970ScyIf the Basic Socket Interface Extensions for IPv6 (RFC\-2553)
112275970Scyis detected, support for the IPv6 address family is generated
113275970Scyin addition to the default support of the IPv4 address family.
114298770SdelphijIn a few cases, including the
115298770Sdelphij.Cm reslist
116298770Sdelphijbillboard generated
117298770Sdelphijby
118298770Sdelphij.Xr ntpq @NTPQ_MS@
119298770Sdelphijor
120298770Sdelphij.Xr ntpdc @NTPDC_MS@ ,
121298770SdelphijIPv6 addresses are automatically generated.
122275970ScyIPv6 addresses can be identified by the presence of colons
123275970Scy.Dq \&:
124275970Scyin the address field.
125275970ScyIPv6 addresses can be used almost everywhere where
126275970ScyIPv4 addresses can be used,
127275970Scywith the exception of reference clock addresses,
128275970Scywhich are always IPv4.
129275970Scy.Pp
130275970ScyNote that in contexts where a host name is expected, a
131275970Scy.Fl 4
132275970Scyqualifier preceding
133275970Scythe host name forces DNS resolution to the IPv4 namespace,
134275970Scywhile a
135275970Scy.Fl 6
136275970Scyqualifier forces DNS resolution to the IPv6 namespace.
137275970ScySee IPv6 references for the
138275970Scyequivalent classes for that address family.
139275970Scy.Bl -tag -width indent
140275970Scy.It Xo Ic pool Ar address
141275970Scy.Op Cm burst
142275970Scy.Op Cm iburst
143275970Scy.Op Cm version Ar version
144275970Scy.Op Cm prefer
145275970Scy.Op Cm minpoll Ar minpoll
146275970Scy.Op Cm maxpoll Ar maxpoll
147275970Scy.Xc
148275970Scy.It Xo Ic server Ar address
149275970Scy.Op Cm key Ar key \&| Cm autokey
150275970Scy.Op Cm burst
151275970Scy.Op Cm iburst
152275970Scy.Op Cm version Ar version
153275970Scy.Op Cm prefer
154275970Scy.Op Cm minpoll Ar minpoll
155275970Scy.Op Cm maxpoll Ar maxpoll
156298770Sdelphij.Op Cm true
157275970Scy.Xc
158275970Scy.It Xo Ic peer Ar address
159275970Scy.Op Cm key Ar key \&| Cm autokey
160275970Scy.Op Cm version Ar version
161275970Scy.Op Cm prefer
162275970Scy.Op Cm minpoll Ar minpoll
163275970Scy.Op Cm maxpoll Ar maxpoll
164298770Sdelphij.Op Cm true
165298770Sdelphij.Op Cm xleave
166275970Scy.Xc
167275970Scy.It Xo Ic broadcast Ar address
168275970Scy.Op Cm key Ar key \&| Cm autokey
169275970Scy.Op Cm version Ar version
170275970Scy.Op Cm prefer
171275970Scy.Op Cm minpoll Ar minpoll
172275970Scy.Op Cm ttl Ar ttl
173298770Sdelphij.Op Cm xleave
174275970Scy.Xc
175275970Scy.It Xo Ic manycastclient Ar address
176275970Scy.Op Cm key Ar key \&| Cm autokey
177275970Scy.Op Cm version Ar version
178275970Scy.Op Cm prefer
179275970Scy.Op Cm minpoll Ar minpoll
180275970Scy.Op Cm maxpoll Ar maxpoll
181275970Scy.Op Cm ttl Ar ttl
182275970Scy.Xc
183275970Scy.El
184275970Scy.Pp
185275970ScyThese five commands specify the time server name or address to
186275970Scybe used and the mode in which to operate.
187275970ScyThe
188275970Scy.Ar address
189275970Scycan be
190275970Scyeither a DNS name or an IP address in dotted\-quad notation.
191275970ScyAdditional information on association behavior can be found in the
192275970Scy.Qq Association Management
193275970Scypage
194275970Scy(available as part of the HTML documentation
195275970Scyprovided in
196275970Scy.Pa /usr/share/doc/ntp ) .
197275970Scy.Bl -tag -width indent
198275970Scy.It Ic pool
199275970ScyFor type s addresses, this command mobilizes a persistent
200275970Scyclient mode association with a number of remote servers.
201275970ScyIn this mode the local clock can synchronized to the
202275970Scyremote server, but the remote server can never be synchronized to
203275970Scythe local clock.
204275970Scy.It Ic server
205275970ScyFor type s and r addresses, this command mobilizes a persistent
206275970Scyclient mode association with the specified remote server or local
207275970Scyradio clock.
208275970ScyIn this mode the local clock can synchronized to the
209275970Scyremote server, but the remote server can never be synchronized to
210275970Scythe local clock.
211275970ScyThis command should
212275970Scy.Em not
213275970Scybe used for type
214275970Scyb or m addresses.
215275970Scy.It Ic peer
216275970ScyFor type s addresses (only), this command mobilizes a
217275970Scypersistent symmetric\-active mode association with the specified
218275970Scyremote peer.
219275970ScyIn this mode the local clock can be synchronized to
220275970Scythe remote peer or the remote peer can be synchronized to the local
221275970Scyclock.
222275970ScyThis is useful in a network of servers where, depending on
223275970Scyvarious failure scenarios, either the local or remote peer may be
224275970Scythe better source of time.
225275970ScyThis command should NOT be used for type
226275970Scyb, m or r addresses.
227275970Scy.It Ic broadcast
228275970ScyFor type b and m addresses (only), this
229275970Scycommand mobilizes a persistent broadcast mode association.
230275970ScyMultiple
231275970Scycommands can be used to specify multiple local broadcast interfaces
232275970Scy(subnets) and/or multiple multicast groups.
233275970ScyNote that local
234275970Scybroadcast messages go only to the interface associated with the
235275970Scysubnet specified, but multicast messages go to all interfaces.
236275970ScyIn broadcast mode the local server sends periodic broadcast
237275970Scymessages to a client population at the
238275970Scy.Ar address
239275970Scyspecified, which is usually the broadcast address on (one of) the
240275970Scylocal network(s) or a multicast address assigned to NTP.
241275970ScyThe IANA
242275970Scyhas assigned the multicast group address IPv4 224.0.1.1 and
243275970ScyIPv6 ff05::101 (site local) exclusively to
244275970ScyNTP, but other nonconflicting addresses can be used to contain the
245275970Scymessages within administrative boundaries.
246275970ScyOrdinarily, this
247275970Scyspecification applies only to the local server operating as a
248275970Scysender; for operation as a broadcast client, see the
249275970Scy.Ic broadcastclient
250275970Scyor
251275970Scy.Ic multicastclient
252275970Scycommands
253275970Scybelow.
254275970Scy.It Ic manycastclient
255275970ScyFor type m addresses (only), this command mobilizes a
256275970Scymanycast client mode association for the multicast address
257275970Scyspecified.
258275970ScyIn this case a specific address must be supplied which
259275970Scymatches the address used on the
260275970Scy.Ic manycastserver
261275970Scycommand for
262275970Scythe designated manycast servers.
263275970ScyThe NTP multicast address
264275970Scy224.0.1.1 assigned by the IANA should NOT be used, unless specific
265275970Scymeans are taken to avoid spraying large areas of the Internet with
266275970Scythese messages and causing a possibly massive implosion of replies
267275970Scyat the sender.
268275970ScyThe
269275970Scy.Ic manycastserver
270275970Scycommand specifies that the local server
271275970Scyis to operate in client mode with the remote servers that are
272275970Scydiscovered as the result of broadcast/multicast messages.
273275970ScyThe
274275970Scyclient broadcasts a request message to the group address associated
275275970Scywith the specified
276275970Scy.Ar address
277275970Scyand specifically enabled
278275970Scyservers respond to these messages.
279275970ScyThe client selects the servers
280275970Scyproviding the best time and continues as with the
281275970Scy.Ic server
282275970Scycommand.
283275970ScyThe remaining servers are discarded as if never
284275970Scyheard.
285275970Scy.El
286275970Scy.Pp
287275970ScyOptions:
288275970Scy.Bl -tag -width indent
289275970Scy.It Cm autokey
290275970ScyAll packets sent to and received from the server or peer are to
291275970Scyinclude authentication fields encrypted using the autokey scheme
292275970Scydescribed in
293275970Scy.Sx Authentication Options .
294275970Scy.It Cm burst
295275970Scywhen the server is reachable, send a burst of eight packets
296275970Scyinstead of the usual one.
297275970ScyThe packet spacing is normally 2 s;
298275970Scyhowever, the spacing between the first and second packets
299298770Sdelphijcan be changed with the
300298770Sdelphij.Ic calldelay
301298770Sdelphijcommand to allow
302275970Scyadditional time for a modem or ISDN call to complete.
303275970ScyThis is designed to improve timekeeping quality
304275970Scywith the
305275970Scy.Ic server
306275970Scycommand and s addresses.
307275970Scy.It Cm iburst
308275970ScyWhen the server is unreachable, send a burst of eight packets
309275970Scyinstead of the usual one.
310275970ScyThe packet spacing is normally 2 s;
311275970Scyhowever, the spacing between the first two packets can be
312298770Sdelphijchanged with the
313298770Sdelphij.Ic calldelay
314298770Sdelphijcommand to allow
315275970Scyadditional time for a modem or ISDN call to complete.
316275970ScyThis is designed to speed the initial synchronization
317275970Scyacquisition with the
318275970Scy.Ic server
319275970Scycommand and s addresses and when
320275970Scy.Xr ntpd @NTPD_MS@
321275970Scyis started with the
322275970Scy.Fl q
323275970Scyoption.
324275970Scy.It Cm key Ar key
325275970ScyAll packets sent to and received from the server or peer are to
326275970Scyinclude authentication fields encrypted using the specified
327275970Scy.Ar key
328275970Scyidentifier with values from 1 to 65534, inclusive.
329275970ScyThe
330275970Scydefault is to include no encryption field.
331275970Scy.It Cm minpoll Ar minpoll
332275970Scy.It Cm maxpoll Ar maxpoll
333275970ScyThese options specify the minimum and maximum poll intervals
334275970Scyfor NTP messages, as a power of 2 in seconds
335275970ScyThe maximum poll
336275970Scyinterval defaults to 10 (1,024 s), but can be increased by the
337275970Scy.Cm maxpoll
338275970Scyoption to an upper limit of 17 (36.4 h).
339275970ScyThe
340275970Scyminimum poll interval defaults to 6 (64 s), but can be decreased by
341275970Scythe
342275970Scy.Cm minpoll
343275970Scyoption to a lower limit of 4 (16 s).
344275970Scy.It Cm noselect
345275970ScyMarks the server as unused, except for display purposes.
346275970ScyThe server is discarded by the selection algroithm.
347298770Sdelphij.It Cm preempt
348298770SdelphijSays the association can be preempted.
349298770Sdelphij.It Cm true
350298770SdelphijMarks the server as a truechimer.
351298770SdelphijUse this option only for testing.
352275970Scy.It Cm prefer
353275970ScyMarks the server as preferred.
354275970ScyAll other things being equal,
355275970Scythis host will be chosen for synchronization among a set of
356275970Scycorrectly operating hosts.
357275970ScySee the
358275970Scy.Qq Mitigation Rules and the prefer Keyword
359275970Scypage
360275970Scy(available as part of the HTML documentation
361275970Scyprovided in
362275970Scy.Pa /usr/share/doc/ntp )
363275970Scyfor further information.
364298770Sdelphij.It Cm true
365298770SdelphijForces the association to always survive the selection and clustering algorithms.
366298770SdelphijThis option should almost certainly
367298770Sdelphij.Em only
368298770Sdelphijbe used while testing an association.
369275970Scy.It Cm ttl Ar ttl
370275970ScyThis option is used only with broadcast server and manycast
371275970Scyclient modes.
372275970ScyIt specifies the time\-to\-live
373275970Scy.Ar ttl
374275970Scyto
375275970Scyuse on broadcast server and multicast server and the maximum
376275970Scy.Ar ttl
377275970Scyfor the expanding ring search with manycast
378275970Scyclient packets.
379275970ScySelection of the proper value, which defaults to
380275970Scy127, is something of a black art and should be coordinated with the
381275970Scynetwork administrator.
382275970Scy.It Cm version Ar version
383275970ScySpecifies the version number to be used for outgoing NTP
384275970Scypackets.
385275970ScyVersions 1\-4 are the choices, with version 4 the
386275970Scydefault.
387298770Sdelphij.It Cm xleave
388298770SdelphijValid in
389298770Sdelphij.Cm peer
390298770Sdelphijand
391298770Sdelphij.Cm broadcast
392298770Sdelphijmodes only, this flag enables interleave mode.
393275970Scy.El
394275970Scy.Ss Auxiliary Commands
395275970Scy.Bl -tag -width indent
396275970Scy.It Ic broadcastclient
397275970ScyThis command enables reception of broadcast server messages to
398275970Scyany local interface (type b) address.
399275970ScyUpon receiving a message for
400275970Scythe first time, the broadcast client measures the nominal server
401275970Scypropagation delay using a brief client/server exchange with the
402275970Scyserver, then enters the broadcast client mode, in which it
403275970Scysynchronizes to succeeding broadcast messages.
404275970ScyNote that, in order
405275970Scyto avoid accidental or malicious disruption in this mode, both the
406275970Scyserver and client should operate using symmetric\-key or public\-key
407275970Scyauthentication as described in
408275970Scy.Sx Authentication Options .
409275970Scy.It Ic manycastserver Ar address ...
410275970ScyThis command enables reception of manycast client messages to
411275970Scythe multicast group address(es) (type m) specified.
412275970ScyAt least one
413275970Scyaddress is required, but the NTP multicast address 224.0.1.1
414275970Scyassigned by the IANA should NOT be used, unless specific means are
415275970Scytaken to limit the span of the reply and avoid a possibly massive
416275970Scyimplosion at the original sender.
417275970ScyNote that, in order to avoid
418275970Scyaccidental or malicious disruption in this mode, both the server
419275970Scyand client should operate using symmetric\-key or public\-key
420275970Scyauthentication as described in
421275970Scy.Sx Authentication Options .
422275970Scy.It Ic multicastclient Ar address ...
423275970ScyThis command enables reception of multicast server messages to
424275970Scythe multicast group address(es) (type m) specified.
425275970ScyUpon receiving
426275970Scya message for the first time, the multicast client measures the
427275970Scynominal server propagation delay using a brief client/server
428275970Scyexchange with the server, then enters the broadcast client mode, in
429275970Scywhich it synchronizes to succeeding multicast messages.
430275970ScyNote that,
431275970Scyin order to avoid accidental or malicious disruption in this mode,
432275970Scyboth the server and client should operate using symmetric\-key or
433275970Scypublic\-key authentication as described in
434275970Scy.Sx Authentication Options .
435280849Scy.It Ic mdnstries Ar number
436280849ScyIf we are participating in mDNS,
437280849Scyafter we have synched for the first time
438280849Scywe attempt to register with the mDNS system.
439280849ScyIf that registration attempt fails,
440280849Scywe try again at one minute intervals for up to
441280849Scy.Ic mdnstries
442280849Scytimes.
443280849ScyAfter all,
444280849Scy.Ic ntpd
445280849Scymay be starting before mDNS.
446280849ScyThe default value for
447280849Scy.Ic mdnstries
448280849Scyis 5.
449275970Scy.El
450275970Scy.Sh Authentication Support
451275970ScyAuthentication support allows the NTP client to verify that the
452275970Scyserver is in fact known and trusted and not an intruder intending
453275970Scyaccidentally or on purpose to masquerade as that server.
454275970ScyThe NTPv3
455275970Scyspecification RFC\-1305 defines a scheme which provides
456275970Scycryptographic authentication of received NTP packets.
457275970ScyOriginally,
458275970Scythis was done using the Data Encryption Standard (DES) algorithm
459275970Scyoperating in Cipher Block Chaining (CBC) mode, commonly called
460275970ScyDES\-CBC.
461275970ScySubsequently, this was replaced by the RSA Message Digest
462275970Scy5 (MD5) algorithm using a private key, commonly called keyed\-MD5.
463275970ScyEither algorithm computes a message digest, or one\-way hash, which
464275970Scycan be used to verify the server has the correct private key and
465275970Scykey identifier.
466275970Scy.Pp
467275970ScyNTPv4 retains the NTPv3 scheme, properly described as symmetric key
468275970Scycryptography and, in addition, provides a new Autokey scheme
469275970Scybased on public key cryptography.
470275970ScyPublic key cryptography is generally considered more secure
471275970Scythan symmetric key cryptography, since the security is based
472275970Scyon a private value which is generated by each server and
473275970Scynever revealed.
474275970ScyWith Autokey all key distribution and
475275970Scymanagement functions involve only public values, which
476275970Scyconsiderably simplifies key distribution and storage.
477275970ScyPublic key management is based on X.509 certificates,
478275970Scywhich can be provided by commercial services or
479275970Scyproduced by utility programs in the OpenSSL software library
480275970Scyor the NTPv4 distribution.
481275970Scy.Pp
482275970ScyWhile the algorithms for symmetric key cryptography are
483275970Scyincluded in the NTPv4 distribution, public key cryptography
484275970Scyrequires the OpenSSL software library to be installed
485275970Scybefore building the NTP distribution.
486275970ScyDirections for doing that
487275970Scyare on the Building and Installing the Distribution page.
488275970Scy.Pp
489275970ScyAuthentication is configured separately for each association
490275970Scyusing the
491275970Scy.Cm key
492275970Scyor
493275970Scy.Cm autokey
494275970Scysubcommand on the
495275970Scy.Ic peer ,
496275970Scy.Ic server ,
497275970Scy.Ic broadcast
498275970Scyand
499275970Scy.Ic manycastclient
500275970Scyconfiguration commands as described in
501275970Scy.Sx Configuration Options
502275970Scypage.
503275970ScyThe authentication
504275970Scyoptions described below specify the locations of the key files,
505275970Scyif other than default, which symmetric keys are trusted
506275970Scyand the interval between various operations, if other than default.
507275970Scy.Pp
508275970ScyAuthentication is always enabled,
509275970Scyalthough ineffective if not configured as
510275970Scydescribed below.
511275970ScyIf a NTP packet arrives
512275970Scyincluding a message authentication
513275970Scycode (MAC), it is accepted only if it
514275970Scypasses all cryptographic checks.
515275970ScyThe
516275970Scychecks require correct key ID, key value
517275970Scyand message digest.
518275970ScyIf the packet has
519275970Scybeen modified in any way or replayed
520275970Scyby an intruder, it will fail one or more
521275970Scyof these checks and be discarded.
522275970ScyFurthermore, the Autokey scheme requires a
523275970Scypreliminary protocol exchange to obtain
524275970Scythe server certificate, verify its
525275970Scycredentials and initialize the protocol
526275970Scy.Pp
527275970ScyThe
528275970Scy.Cm auth
529275970Scyflag controls whether new associations or
530275970Scyremote configuration commands require cryptographic authentication.
531275970ScyThis flag can be set or reset by the
532275970Scy.Ic enable
533275970Scyand
534275970Scy.Ic disable
535275970Scycommands and also by remote
536275970Scyconfiguration commands sent by a
537275970Scy.Xr ntpdc @NTPDC_MS@
538298770Sdelphijprogram running on
539275970Scyanother machine.
540275970ScyIf this flag is enabled, which is the default
541275970Scycase, new broadcast client and symmetric passive associations and
542275970Scyremote configuration commands must be cryptographically
543275970Scyauthenticated using either symmetric key or public key cryptography.
544275970ScyIf this
545275970Scyflag is disabled, these operations are effective
546275970Scyeven if not cryptographic
547275970Scyauthenticated.
548275970ScyIt should be understood
549275970Scythat operating with the
550275970Scy.Ic auth
551275970Scyflag disabled invites a significant vulnerability
552275970Scywhere a rogue hacker can
553275970Scymasquerade as a falseticker and seriously
554275970Scydisrupt system timekeeping.
555275970ScyIt is
556275970Scyimportant to note that this flag has no purpose
557275970Scyother than to allow or disallow
558275970Scya new association in response to new broadcast
559275970Scyand symmetric active messages
560275970Scyand remote configuration commands and, in particular,
561275970Scythe flag has no effect on
562275970Scythe authentication process itself.
563275970Scy.Pp
564275970ScyAn attractive alternative where multicast support is available
565275970Scyis manycast mode, in which clients periodically troll
566275970Scyfor servers as described in the
567275970Scy.Sx Automatic NTP Configuration Options
568275970Scypage.
569275970ScyEither symmetric key or public key
570275970Scycryptographic authentication can be used in this mode.
571275970ScyThe principle advantage
572275970Scyof manycast mode is that potential servers need not be
573275970Scyconfigured in advance,
574275970Scysince the client finds them during regular operation,
575275970Scyand the configuration
576275970Scyfiles for all clients can be identical.
577275970Scy.Pp
578275970ScyThe security model and protocol schemes for
579275970Scyboth symmetric key and public key
580275970Scycryptography are summarized below;
581275970Scyfurther details are in the briefings, papers
582275970Scyand reports at the NTP project page linked from
583275970Scy.Li http://www.ntp.org/ .
584275970Scy.Ss Symmetric\-Key Cryptography
585275970ScyThe original RFC\-1305 specification allows any one of possibly
586275970Scy65,534 keys, each distinguished by a 32\-bit key identifier, to
587275970Scyauthenticate an association.
588275970ScyThe servers and clients involved must
589275970Scyagree on the key and key identifier to
590275970Scyauthenticate NTP packets.
591275970ScyKeys and
592275970Scyrelated information are specified in a key
593275970Scyfile, usually called
594275970Scy.Pa ntp.keys ,
595275970Scywhich must be distributed and stored using
596275970Scysecure means beyond the scope of the NTP protocol itself.
597275970ScyBesides the keys used
598275970Scyfor ordinary NTP associations,
599275970Scyadditional keys can be used as passwords for the
600275970Scy.Xr ntpq @NTPQ_MS@
601275970Scyand
602275970Scy.Xr ntpdc @NTPDC_MS@
603275970Scyutility programs.
604275970Scy.Pp
605275970ScyWhen
606275970Scy.Xr ntpd @NTPD_MS@
607275970Scyis first started, it reads the key file specified in the
608275970Scy.Ic keys
609275970Scyconfiguration command and installs the keys
610275970Scyin the key cache.
611275970ScyHowever,
612275970Scyindividual keys must be activated with the
613275970Scy.Ic trusted
614275970Scycommand before use.
615275970ScyThis
616275970Scyallows, for instance, the installation of possibly
617275970Scyseveral batches of keys and
618275970Scythen activating or deactivating each batch
619275970Scyremotely using
620275970Scy.Xr ntpdc @NTPDC_MS@ .
621275970ScyThis also provides a revocation capability that can be used
622275970Scyif a key becomes compromised.
623275970ScyThe
624275970Scy.Ic requestkey
625275970Scycommand selects the key used as the password for the
626275970Scy.Xr ntpdc @NTPDC_MS@
627275970Scyutility, while the
628275970Scy.Ic controlkey
629275970Scycommand selects the key used as the password for the
630275970Scy.Xr ntpq @NTPQ_MS@
631275970Scyutility.
632275970Scy.Ss Public Key Cryptography
633275970ScyNTPv4 supports the original NTPv3 symmetric key scheme
634275970Scydescribed in RFC\-1305 and in addition the Autokey protocol,
635275970Scywhich is based on public key cryptography.
636275970ScyThe Autokey Version 2 protocol described on the Autokey Protocol
637275970Scypage verifies packet integrity using MD5 message digests
638275970Scyand verifies the source with digital signatures and any of several
639275970Scydigest/signature schemes.
640275970ScyOptional identity schemes described on the Identity Schemes
641275970Scypage and based on cryptographic challenge/response algorithms
642275970Scyare also available.
643275970ScyUsing all of these schemes provides strong security against
644275970Scyreplay with or without modification, spoofing, masquerade
645275970Scyand most forms of clogging attacks.
646275970Scy.\" .Pp
647275970Scy.\" The cryptographic means necessary for all Autokey operations
648275970Scy.\" is provided by the OpenSSL software library.
649275970Scy.\" This library is available from http://www.openssl.org/
650275970Scy.\" and can be installed using the procedures outlined
651275970Scy.\" in the Building and Installing the Distribution page.
652275970Scy.\" Once installed,
653275970Scy.\" the configure and build
654275970Scy.\" process automatically detects the library and links
655275970Scy.\" the library routines required.
656275970Scy.Pp
657275970ScyThe Autokey protocol has several modes of operation
658275970Scycorresponding to the various NTP modes supported.
659275970ScyMost modes use a special cookie which can be
660275970Scycomputed independently by the client and server,
661275970Scybut encrypted in transmission.
662275970ScyAll modes use in addition a variant of the S\-KEY scheme,
663275970Scyin which a pseudo\-random key list is generated and used
664275970Scyin reverse order.
665275970ScyThese schemes are described along with an executive summary,
666275970Scycurrent status, briefing slides and reading list on the
667275970Scy.Sx Autonomous Authentication
668275970Scypage.
669275970Scy.Pp
670275970ScyThe specific cryptographic environment used by Autokey servers
671275970Scyand clients is determined by a set of files
672275970Scyand soft links generated by the
673275970Scy.Xr ntp\-keygen 1ntpkeygenmdoc
674275970Scyprogram.
675275970ScyThis includes a required host key file,
676275970Scyrequired certificate file and optional sign key file,
677275970Scyleapsecond file and identity scheme files.
678275970ScyThe
679275970Scydigest/signature scheme is specified in the X.509 certificate
680275970Scyalong with the matching sign key.
681275970ScyThere are several schemes
682275970Scyavailable in the OpenSSL software library, each identified
683275970Scyby a specific string such as
684275970Scy.Cm md5WithRSAEncryption ,
685275970Scywhich stands for the MD5 message digest with RSA
686275970Scyencryption scheme.
687275970ScyThe current NTP distribution supports
688275970Scyall the schemes in the OpenSSL library, including
689275970Scythose based on RSA and DSA digital signatures.
690275970Scy.Pp
691275970ScyNTP secure groups can be used to define cryptographic compartments
692275970Scyand security hierarchies.
693275970ScyIt is important that every host
694275970Scyin the group be able to construct a certificate trail to one
695275970Scyor more trusted hosts in the same group.
696275970ScyEach group
697275970Scyhost runs the Autokey protocol to obtain the certificates
698275970Scyfor all hosts along the trail to one or more trusted hosts.
699275970ScyThis requires the configuration file in all hosts to be
700275970Scyengineered so that, even under anticipated failure conditions,
701275970Scythe NTP subnet will form such that every group host can find
702275970Scya trail to at least one trusted host.
703275970Scy.Ss Naming and Addressing
704275970ScyIt is important to note that Autokey does not use DNS to
705275970Scyresolve addresses, since DNS can't be completely trusted
706275970Scyuntil the name servers have synchronized clocks.
707275970ScyThe cryptographic name used by Autokey to bind the host identity
708275970Scycredentials and cryptographic values must be independent
709275970Scyof interface, network and any other naming convention.
710275970ScyThe name appears in the host certificate in either or both
711275970Scythe subject and issuer fields, so protection against
712275970ScyDNS compromise is essential.
713275970Scy.Pp
714275970ScyBy convention, the name of an Autokey host is the name returned
715275970Scyby the Unix
716275970Scy.Xr gethostname 2
717275970Scysystem call or equivalent in other systems.
718275970ScyBy the system design
719275970Scymodel, there are no provisions to allow alternate names or aliases.
720275970ScyHowever, this is not to say that DNS aliases, different names
721275970Scyfor each interface, etc., are constrained in any way.
722275970Scy.Pp
723275970ScyIt is also important to note that Autokey verifies authenticity
724275970Scyusing the host name, network address and public keys,
725275970Scyall of which are bound together by the protocol specifically
726275970Scyto deflect masquerade attacks.
727275970ScyFor this reason Autokey
728298770Sdelphijincludes the source and destination IP addresses in message digest
729275970Scycomputations and so the same addresses must be available
730275970Scyat both the server and client.
731275970ScyFor this reason operation
732275970Scywith network address translation schemes is not possible.
733275970ScyThis reflects the intended robust security model where government
734275970Scyand corporate NTP servers are operated outside firewall perimeters.
735275970Scy.Ss Operation
736275970ScyA specific combination of authentication scheme (none,
737275970Scysymmetric key, public key) and identity scheme is called
738275970Scya cryptotype, although not all combinations are compatible.
739275970ScyThere may be management configurations where the clients,
740275970Scyservers and peers may not all support the same cryptotypes.
741275970ScyA secure NTPv4 subnet can be configured in many ways while
742275970Scykeeping in mind the principles explained above and
743275970Scyin this section.
744275970ScyNote however that some cryptotype
745275970Scycombinations may successfully interoperate with each other,
746275970Scybut may not represent good security practice.
747275970Scy.Pp
748275970ScyThe cryptotype of an association is determined at the time
749275970Scyof mobilization, either at configuration time or some time
750275970Scylater when a message of appropriate cryptotype arrives.
751275970ScyWhen mobilized by a
752275970Scy.Ic server
753275970Scyor
754275970Scy.Ic peer
755275970Scyconfiguration command and no
756275970Scy.Ic key
757275970Scyor
758275970Scy.Ic autokey
759275970Scysubcommands are present, the association is not
760275970Scyauthenticated; if the
761275970Scy.Ic key
762275970Scysubcommand is present, the association is authenticated
763275970Scyusing the symmetric key ID specified; if the
764275970Scy.Ic autokey
765275970Scysubcommand is present, the association is authenticated
766275970Scyusing Autokey.
767275970Scy.Pp
768275970ScyWhen multiple identity schemes are supported in the Autokey
769275970Scyprotocol, the first message exchange determines which one is used.
770275970ScyThe client request message contains bits corresponding
771275970Scyto which schemes it has available.
772275970ScyThe server response message
773275970Scycontains bits corresponding to which schemes it has available.
774275970ScyBoth server and client match the received bits with their own
775275970Scyand select a common scheme.
776275970Scy.Pp
777275970ScyFollowing the principle that time is a public value,
778275970Scya server responds to any client packet that matches
779275970Scyits cryptotype capabilities.
780275970ScyThus, a server receiving
781275970Scyan unauthenticated packet will respond with an unauthenticated
782275970Scypacket, while the same server receiving a packet of a cryptotype
783275970Scyit supports will respond with packets of that cryptotype.
784275970ScyHowever, unconfigured broadcast or manycast client
785275970Scyassociations or symmetric passive associations will not be
786275970Scymobilized unless the server supports a cryptotype compatible
787275970Scywith the first packet received.
788275970ScyBy default, unauthenticated associations will not be mobilized
789275970Scyunless overridden in a decidedly dangerous way.
790275970Scy.Pp
791275970ScySome examples may help to reduce confusion.
792275970ScyClient Alice has no specific cryptotype selected.
793275970ScyServer Bob has both a symmetric key file and minimal Autokey files.
794275970ScyAlice's unauthenticated messages arrive at Bob, who replies with
795275970Scyunauthenticated messages.
796275970ScyCathy has a copy of Bob's symmetric
797275970Scykey file and has selected key ID 4 in messages to Bob.
798275970ScyBob verifies the message with his key ID 4.
799275970ScyIf it's the
800275970Scysame key and the message is verified, Bob sends Cathy a reply
801275970Scyauthenticated with that key.
802275970ScyIf verification fails,
803275970ScyBob sends Cathy a thing called a crypto\-NAK, which tells her
804275970Scysomething broke.
805275970ScyShe can see the evidence using the
806275970Scy.Xr ntpq @NTPQ_MS@
807275970Scyprogram.
808275970Scy.Pp
809275970ScyDenise has rolled her own host key and certificate.
810275970ScyShe also uses one of the identity schemes as Bob.
811275970ScyShe sends the first Autokey message to Bob and they
812275970Scyboth dance the protocol authentication and identity steps.
813275970ScyIf all comes out okay, Denise and Bob continue as described above.
814275970Scy.Pp
815275970ScyIt should be clear from the above that Bob can support
816275970Scyall the girls at the same time, as long as he has compatible
817275970Scyauthentication and identity credentials.
818275970ScyNow, Bob can act just like the girls in his own choice of servers;
819275970Scyhe can run multiple configured associations with multiple different
820275970Scyservers (or the same server, although that might not be useful).
821275970ScyBut, wise security policy might preclude some cryptotype
822275970Scycombinations; for instance, running an identity scheme
823275970Scywith one server and no authentication with another might not be wise.
824275970Scy.Ss Key Management
825275970ScyThe cryptographic values used by the Autokey protocol are
826275970Scyincorporated as a set of files generated by the
827275970Scy.Xr ntp\-keygen 1ntpkeygenmdoc
828275970Scyutility program, including symmetric key, host key and
829275970Scypublic certificate files, as well as sign key, identity parameters
830275970Scyand leapseconds files.
831275970ScyAlternatively, host and sign keys and
832275970Scycertificate files can be generated by the OpenSSL utilities
833275970Scyand certificates can be imported from public certificate
834275970Scyauthorities.
835275970ScyNote that symmetric keys are necessary for the
836275970Scy.Xr ntpq @NTPQ_MS@
837275970Scyand
838275970Scy.Xr ntpdc @NTPDC_MS@
839275970Scyutility programs.
840275970ScyThe remaining files are necessary only for the
841275970ScyAutokey protocol.
842275970Scy.Pp
843275970ScyCertificates imported from OpenSSL or public certificate
844275970Scyauthorities have certian limitations.
845275970ScyThe certificate should be in ASN.1 syntax, X.509 Version 3
846275970Scyformat and encoded in PEM, which is the same format
847275970Scyused by OpenSSL.
848275970ScyThe overall length of the certificate encoded
849275970Scyin ASN.1 must not exceed 1024 bytes.
850275970ScyThe subject distinguished
851275970Scyname field (CN) is the fully qualified name of the host
852275970Scyon which it is used; the remaining subject fields are ignored.
853275970ScyThe certificate extension fields must not contain either
854275970Scya subject key identifier or a issuer key identifier field;
855275970Scyhowever, an extended key usage field for a trusted host must
856275970Scycontain the value
857275970Scy.Cm trustRoot ; .
858275970ScyOther extension fields are ignored.
859275970Scy.Ss Authentication Commands
860275970Scy.Bl -tag -width indent
861275970Scy.It Ic autokey Op Ar logsec
862275970ScySpecifies the interval between regenerations of the session key
863275970Scylist used with the Autokey protocol.
864275970ScyNote that the size of the key
865275970Scylist for each association depends on this interval and the current
866275970Scypoll interval.
867275970ScyThe default value is 12 (4096 s or about 1.1 hours).
868275970ScyFor poll intervals above the specified interval, a session key list
869275970Scywith a single entry will be regenerated for every message
870275970Scysent.
871275970Scy.It Ic controlkey Ar key
872275970ScySpecifies the key identifier to use with the
873275970Scy.Xr ntpq @NTPQ_MS@
874275970Scyutility, which uses the standard
875275970Scyprotocol defined in RFC\-1305.
876275970ScyThe
877275970Scy.Ar key
878275970Scyargument is
879275970Scythe key identifier for a trusted key, where the value can be in the
880275970Scyrange 1 to 65,534, inclusive.
881275970Scy.It Xo Ic crypto
882275970Scy.Op Cm cert Ar file
883275970Scy.Op Cm leap Ar file
884275970Scy.Op Cm randfile Ar file
885275970Scy.Op Cm host Ar file
886275970Scy.Op Cm sign Ar file
887275970Scy.Op Cm gq Ar file
888275970Scy.Op Cm gqpar Ar file
889275970Scy.Op Cm iffpar Ar file
890275970Scy.Op Cm mvpar Ar file
891275970Scy.Op Cm pw Ar password
892275970Scy.Xc
893275970ScyThis command requires the OpenSSL library.
894275970ScyIt activates public key
895275970Scycryptography, selects the message digest and signature
896275970Scyencryption scheme and loads the required private and public
897275970Scyvalues described above.
898275970ScyIf one or more files are left unspecified,
899275970Scythe default names are used as described above.
900275970ScyUnless the complete path and name of the file are specified, the
901275970Scylocation of a file is relative to the keys directory specified
902275970Scyin the
903275970Scy.Ic keysdir
904275970Scycommand or default
905275970Scy.Pa /usr/local/etc .
906275970ScyFollowing are the subcommands:
907275970Scy.Bl -tag -width indent
908275970Scy.It Cm cert Ar file
909275970ScySpecifies the location of the required host public certificate file.
910275970ScyThis overrides the link
911275970Scy.Pa ntpkey_cert_ Ns Ar hostname
912275970Scyin the keys directory.
913275970Scy.It Cm gqpar Ar file
914275970ScySpecifies the location of the optional GQ parameters file.
915275970ScyThis
916275970Scyoverrides the link
917275970Scy.Pa ntpkey_gq_ Ns Ar hostname
918275970Scyin the keys directory.
919275970Scy.It Cm host Ar file
920275970ScySpecifies the location of the required host key file.
921275970ScyThis overrides
922275970Scythe link
923275970Scy.Pa ntpkey_key_ Ns Ar hostname
924275970Scyin the keys directory.
925275970Scy.It Cm iffpar Ar file
926298770SdelphijSpecifies the location of the optional IFF parameters file.
927298770SdelphijThis overrides the link
928275970Scy.Pa ntpkey_iff_ Ns Ar hostname
929275970Scyin the keys directory.
930275970Scy.It Cm leap Ar file
931275970ScySpecifies the location of the optional leapsecond file.
932275970ScyThis overrides the link
933275970Scy.Pa ntpkey_leap
934275970Scyin the keys directory.
935275970Scy.It Cm mvpar Ar file
936275970ScySpecifies the location of the optional MV parameters file.
937298770SdelphijThis overrides the link
938275970Scy.Pa ntpkey_mv_ Ns Ar hostname
939275970Scyin the keys directory.
940275970Scy.It Cm pw Ar password
941275970ScySpecifies the password to decrypt files containing private keys and
942275970Scyidentity parameters.
943275970ScyThis is required only if these files have been
944275970Scyencrypted.
945275970Scy.It Cm randfile Ar file
946275970ScySpecifies the location of the random seed file used by the OpenSSL
947275970Scylibrary.
948275970ScyThe defaults are described in the main text above.
949275970Scy.It Cm sign Ar file
950275970ScySpecifies the location of the optional sign key file.
951275970ScyThis overrides
952275970Scythe link
953275970Scy.Pa ntpkey_sign_ Ns Ar hostname
954275970Scyin the keys directory.
955275970ScyIf this file is
956275970Scynot found, the host key is also the sign key.
957275970Scy.El
958275970Scy.It Ic keys Ar keyfile
959275970ScySpecifies the complete path and location of the MD5 key file
960275970Scycontaining the keys and key identifiers used by
961275970Scy.Xr ntpd @NTPD_MS@ ,
962275970Scy.Xr ntpq @NTPQ_MS@
963275970Scyand
964275970Scy.Xr ntpdc @NTPDC_MS@
965275970Scywhen operating with symmetric key cryptography.
966275970ScyThis is the same operation as the
967275970Scy.Fl k
968275970Scycommand line option.
969275970Scy.It Ic keysdir Ar path
970275970ScyThis command specifies the default directory path for
971275970Scycryptographic keys, parameters and certificates.
972275970ScyThe default is
973275970Scy.Pa /usr/local/etc/ .
974275970Scy.It Ic requestkey Ar key
975275970ScySpecifies the key identifier to use with the
976275970Scy.Xr ntpdc @NTPDC_MS@
977275970Scyutility program, which uses a
978275970Scyproprietary protocol specific to this implementation of
979275970Scy.Xr ntpd @NTPD_MS@ .
980275970ScyThe
981275970Scy.Ar key
982275970Scyargument is a key identifier
983275970Scyfor the trusted key, where the value can be in the range 1 to
984275970Scy65,534, inclusive.
985275970Scy.It Ic revoke Ar logsec
986275970ScySpecifies the interval between re\-randomization of certain
987275970Scycryptographic values used by the Autokey scheme, as a power of 2 in
988275970Scyseconds.
989275970ScyThese values need to be updated frequently in order to
990275970Scydeflect brute\-force attacks on the algorithms of the scheme;
991275970Scyhowever, updating some values is a relatively expensive operation.
992275970ScyThe default interval is 16 (65,536 s or about 18 hours).
993275970ScyFor poll
994275970Scyintervals above the specified interval, the values will be updated
995275970Scyfor every message sent.
996275970Scy.It Ic trustedkey Ar key ...
997275970ScySpecifies the key identifiers which are trusted for the
998275970Scypurposes of authenticating peers with symmetric key cryptography,
999275970Scyas well as keys used by the
1000275970Scy.Xr ntpq @NTPQ_MS@
1001275970Scyand
1002275970Scy.Xr ntpdc @NTPDC_MS@
1003275970Scyprograms.
1004275970ScyThe authentication procedures require that both the local
1005275970Scyand remote servers share the same key and key identifier for this
1006275970Scypurpose, although different keys can be used with different
1007275970Scyservers.
1008275970ScyThe
1009275970Scy.Ar key
1010275970Scyarguments are 32\-bit unsigned
1011275970Scyintegers with values from 1 to 65,534.
1012275970Scy.El
1013275970Scy.Ss Error Codes
1014275970ScyThe following error codes are reported via the NTP control
1015275970Scyand monitoring protocol trap mechanism.
1016275970Scy.Bl -tag -width indent
1017275970Scy.It 101
1018275970Scy.Pq bad field format or length
1019275970ScyThe packet has invalid version, length or format.
1020275970Scy.It 102
1021275970Scy.Pq bad timestamp
1022275970ScyThe packet timestamp is the same or older than the most recent received.
1023275970ScyThis could be due to a replay or a server clock time step.
1024275970Scy.It 103
1025275970Scy.Pq bad filestamp
1026275970ScyThe packet filestamp is the same or older than the most recent received.
1027275970ScyThis could be due to a replay or a key file generation error.
1028275970Scy.It 104
1029275970Scy.Pq bad or missing public key
1030275970ScyThe public key is missing, has incorrect format or is an unsupported type.
1031275970Scy.It 105
1032275970Scy.Pq unsupported digest type
1033275970ScyThe server requires an unsupported digest/signature scheme.
1034275970Scy.It 106
1035275970Scy.Pq mismatched digest types
1036275970ScyNot used.
1037275970Scy.It 107
1038275970Scy.Pq bad signature length
1039275970ScyThe signature length does not match the current public key.
1040275970Scy.It 108
1041275970Scy.Pq signature not verified
1042275970ScyThe message fails the signature check.
1043275970ScyIt could be bogus or signed by a
1044275970Scydifferent private key.
1045275970Scy.It 109
1046275970Scy.Pq certificate not verified
1047275970ScyThe certificate is invalid or signed with the wrong key.
1048275970Scy.It 110
1049275970Scy.Pq certificate not verified
1050275970ScyThe certificate is not yet valid or has expired or the signature could not
1051275970Scybe verified.
1052275970Scy.It 111
1053275970Scy.Pq bad or missing cookie
1054275970ScyThe cookie is missing, corrupted or bogus.
1055275970Scy.It 112
1056275970Scy.Pq bad or missing leapseconds table
1057275970ScyThe leapseconds table is missing, corrupted or bogus.
1058275970Scy.It 113
1059275970Scy.Pq bad or missing certificate
1060275970ScyThe certificate is missing, corrupted or bogus.
1061275970Scy.It 114
1062275970Scy.Pq bad or missing identity
1063275970ScyThe identity key is missing, corrupt or bogus.
1064275970Scy.El
1065275970Scy.Sh Monitoring Support
1066275970Scy.Xr ntpd @NTPD_MS@
1067275970Scyincludes a comprehensive monitoring facility suitable
1068275970Scyfor continuous, long term recording of server and client
1069275970Scytimekeeping performance.
1070275970ScySee the
1071275970Scy.Ic statistics
1072275970Scycommand below
1073275970Scyfor a listing and example of each type of statistics currently
1074275970Scysupported.
1075275970ScyStatistic files are managed using file generation sets
1076275970Scyand scripts in the
1077275970Scy.Pa ./scripts
1078298770Sdelphijdirectory of the source code distribution.
1079275970ScyUsing
1080275970Scythese facilities and
1081275970Scy.Ux
1082275970Scy.Xr cron 8
1083275970Scyjobs, the data can be
1084275970Scyautomatically summarized and archived for retrospective analysis.
1085275970Scy.Ss Monitoring Commands
1086275970Scy.Bl -tag -width indent
1087275970Scy.It Ic statistics Ar name ...
1088275970ScyEnables writing of statistics records.
1089275970ScyCurrently, eight kinds of
1090275970Scy.Ar name
1091275970Scystatistics are supported.
1092275970Scy.Bl -tag -width indent
1093275970Scy.It Cm clockstats
1094275970ScyEnables recording of clock driver statistics information.
1095275970ScyEach update
1096275970Scyreceived from a clock driver appends a line of the following form to
1097275970Scythe file generation set named
1098275970Scy.Cm clockstats :
1099275970Scy.Bd -literal
1100275970Scy49213 525.624 127.127.4.1 93 226 00:08:29.606 D
1101275970Scy.Ed
1102275970Scy.Pp
1103275970ScyThe first two fields show the date (Modified Julian Day) and time
1104275970Scy(seconds and fraction past UTC midnight).
1105275970ScyThe next field shows the
1106275970Scyclock address in dotted\-quad notation.
1107275970ScyThe final field shows the last
1108275970Scytimecode received from the clock in decoded ASCII format, where
1109275970Scymeaningful.
1110275970ScyIn some clock drivers a good deal of additional information
1111275970Scycan be gathered and displayed as well.
1112275970ScySee information specific to each
1113275970Scyclock for further details.
1114275970Scy.It Cm cryptostats
1115275970ScyThis option requires the OpenSSL cryptographic software library.
1116275970ScyIt
1117275970Scyenables recording of cryptographic public key protocol information.
1118275970ScyEach message received by the protocol module appends a line of the
1119275970Scyfollowing form to the file generation set named
1120275970Scy.Cm cryptostats :
1121275970Scy.Bd -literal
1122275970Scy49213 525.624 127.127.4.1 message
1123275970Scy.Ed
1124275970Scy.Pp
1125275970ScyThe first two fields show the date (Modified Julian Day) and time
1126275970Scy(seconds and fraction past UTC midnight).
1127275970ScyThe next field shows the peer
1128275970Scyaddress in dotted\-quad notation, The final message field includes the
1129275970Scymessage type and certain ancillary information.
1130275970ScySee the
1131275970Scy.Sx Authentication Options
1132275970Scysection for further information.
1133275970Scy.It Cm loopstats
1134275970ScyEnables recording of loop filter statistics information.
1135275970ScyEach
1136275970Scyupdate of the local clock outputs a line of the following form to
1137275970Scythe file generation set named
1138275970Scy.Cm loopstats :
1139275970Scy.Bd -literal
1140275970Scy50935 75440.031 0.000006019 13.778190 0.000351733 0.0133806
1141275970Scy.Ed
1142275970Scy.Pp
1143275970ScyThe first two fields show the date (Modified Julian Day) and
1144275970Scytime (seconds and fraction past UTC midnight).
1145275970ScyThe next five fields
1146275970Scyshow time offset (seconds), frequency offset (parts per million \-
1147275970ScyPPM), RMS jitter (seconds), Allan deviation (PPM) and clock
1148275970Scydiscipline time constant.
1149275970Scy.It Cm peerstats
1150275970ScyEnables recording of peer statistics information.
1151275970ScyThis includes
1152275970Scystatistics records of all peers of a NTP server and of special
1153275970Scysignals, where present and configured.
1154275970ScyEach valid update appends a
1155275970Scyline of the following form to the current element of a file
1156275970Scygeneration set named
1157275970Scy.Cm peerstats :
1158275970Scy.Bd -literal
1159275970Scy48773 10847.650 127.127.4.1 9714 \-0.001605376 0.000000000 0.001424877 0.000958674
1160275970Scy.Ed
1161275970Scy.Pp
1162275970ScyThe first two fields show the date (Modified Julian Day) and
1163275970Scytime (seconds and fraction past UTC midnight).
1164275970ScyThe next two fields
1165275970Scyshow the peer address in dotted\-quad notation and status,
1166275970Scyrespectively.
1167275970ScyThe status field is encoded in hex in the format
1168275970Scydescribed in Appendix A of the NTP specification RFC 1305.
1169275970ScyThe final four fields show the offset,
1170275970Scydelay, dispersion and RMS jitter, all in seconds.
1171275970Scy.It Cm rawstats
1172275970ScyEnables recording of raw\-timestamp statistics information.
1173275970ScyThis
1174275970Scyincludes statistics records of all peers of a NTP server and of
1175275970Scyspecial signals, where present and configured.
1176275970ScyEach NTP message
1177275970Scyreceived from a peer or clock driver appends a line of the
1178275970Scyfollowing form to the file generation set named
1179275970Scy.Cm rawstats :
1180275970Scy.Bd -literal
1181275970Scy50928 2132.543 128.4.1.1 128.4.1.20 3102453281.584327000 3102453281.58622800031 02453332.540806000 3102453332.541458000
1182275970Scy.Ed
1183275970Scy.Pp
1184275970ScyThe first two fields show the date (Modified Julian Day) and
1185275970Scytime (seconds and fraction past UTC midnight).
1186275970ScyThe next two fields
1187275970Scyshow the remote peer or clock address followed by the local address
1188275970Scyin dotted\-quad notation.
1189275970ScyThe final four fields show the originate,
1190275970Scyreceive, transmit and final NTP timestamps in order.
1191275970ScyThe timestamp
1192275970Scyvalues are as received and before processing by the various data
1193275970Scysmoothing and mitigation algorithms.
1194275970Scy.It Cm sysstats
1195275970ScyEnables recording of ntpd statistics counters on a periodic basis.
1196275970ScyEach
1197275970Scyhour a line of the following form is appended to the file generation
1198275970Scyset named
1199275970Scy.Cm sysstats :
1200275970Scy.Bd -literal
1201275970Scy50928 2132.543 36000 81965 0 9546 56 71793 512 540 10 147
1202275970Scy.Ed
1203275970Scy.Pp
1204275970ScyThe first two fields show the date (Modified Julian Day) and time
1205275970Scy(seconds and fraction past UTC midnight).
1206275970ScyThe remaining ten fields show
1207275970Scythe statistics counter values accumulated since the last generated
1208275970Scyline.
1209275970Scy.Bl -tag -width indent
1210275970Scy.It Time since restart Cm 36000
1211275970ScyTime in hours since the system was last rebooted.
1212275970Scy.It Packets received Cm 81965
1213275970ScyTotal number of packets received.
1214275970Scy.It Packets processed Cm 0
1215275970ScyNumber of packets received in response to previous packets sent
1216275970Scy.It Current version Cm 9546
1217275970ScyNumber of packets matching the current NTP version.
1218275970Scy.It Previous version Cm 56
1219275970ScyNumber of packets matching the previous NTP version.
1220275970Scy.It Bad version Cm 71793
1221275970ScyNumber of packets matching neither NTP version.
1222275970Scy.It Access denied Cm 512
1223275970ScyNumber of packets denied access for any reason.
1224275970Scy.It Bad length or format Cm 540
1225275970ScyNumber of packets with invalid length, format or port number.
1226275970Scy.It Bad authentication Cm 10
1227275970ScyNumber of packets not verified as authentic.
1228275970Scy.It Rate exceeded Cm 147
1229275970ScyNumber of packets discarded due to rate limitation.
1230275970Scy.El
1231275970Scy.It Cm statsdir Ar directory_path
1232275970ScyIndicates the full path of a directory where statistics files
1233275970Scyshould be created (see below).
1234275970ScyThis keyword allows
1235275970Scythe (otherwise constant)
1236275970Scy.Cm filegen
1237275970Scyfilename prefix to be modified for file generation sets, which
1238275970Scyis useful for handling statistics logs.
1239275970Scy.It Cm filegen Ar name Xo
1240275970Scy.Op Cm file Ar filename
1241275970Scy.Op Cm type Ar typename
1242275970Scy.Op Cm link | nolink
1243275970Scy.Op Cm enable | disable
1244275970Scy.Xc
1245275970ScyConfigures setting of generation file set name.
1246275970ScyGeneration
1247275970Scyfile sets provide a means for handling files that are
1248275970Scycontinuously growing during the lifetime of a server.
1249275970ScyServer statistics are a typical example for such files.
1250275970ScyGeneration file sets provide access to a set of files used
1251275970Scyto store the actual data.
1252275970ScyAt any time at most one element
1253275970Scyof the set is being written to.
1254275970ScyThe type given specifies
1255275970Scywhen and how data will be directed to a new element of the set.
1256275970ScyThis way, information stored in elements of a file set
1257275970Scythat are currently unused are available for administrational
1258275970Scyoperations without the risk of disturbing the operation of ntpd.
1259275970Scy(Most important: they can be removed to free space for new data
1260275970Scyproduced.)
1261275970Scy.Pp
1262275970ScyNote that this command can be sent from the
1263275970Scy.Xr ntpdc @NTPDC_MS@
1264275970Scyprogram running at a remote location.
1265275970Scy.Bl -tag -width indent
1266275970Scy.It Cm name
1267275970ScyThis is the type of the statistics records, as shown in the
1268275970Scy.Cm statistics
1269275970Scycommand.
1270275970Scy.It Cm file Ar filename
1271275970ScyThis is the file name for the statistics records.
1272275970ScyFilenames of set
1273275970Scymembers are built from three concatenated elements
1274275970Scy.Ar Cm prefix ,
1275275970Scy.Ar Cm filename
1276275970Scyand
1277275970Scy.Ar Cm suffix :
1278275970Scy.Bl -tag -width indent
1279275970Scy.It Cm prefix
1280275970ScyThis is a constant filename path.
1281275970ScyIt is not subject to
1282275970Scymodifications via the
1283275970Scy.Ar filegen
1284275970Scyoption.
1285275970ScyIt is defined by the
1286275970Scyserver, usually specified as a compile\-time constant.
1287275970ScyIt may,
1288275970Scyhowever, be configurable for individual file generation sets
1289275970Scyvia other commands.
1290275970ScyFor example, the prefix used with
1291275970Scy.Ar loopstats
1292275970Scyand
1293275970Scy.Ar peerstats
1294275970Scygeneration can be configured using the
1295275970Scy.Ar statsdir
1296275970Scyoption explained above.
1297275970Scy.It Cm filename
1298275970ScyThis string is directly concatenated to the prefix mentioned
1299275970Scyabove (no intervening
1300275970Scy.Ql / ) .
1301275970ScyThis can be modified using
1302275970Scythe file argument to the
1303275970Scy.Ar filegen
1304275970Scystatement.
1305275970ScyNo
1306275970Scy.Pa ..
1307275970Scyelements are
1308275970Scyallowed in this component to prevent filenames referring to
1309275970Scyparts outside the filesystem hierarchy denoted by
1310275970Scy.Ar prefix .
1311275970Scy.It Cm suffix
1312275970ScyThis part is reflects individual elements of a file set.
1313275970ScyIt is
1314275970Scygenerated according to the type of a file set.
1315275970Scy.El
1316275970Scy.It Cm type Ar typename
1317275970ScyA file generation set is characterized by its type.
1318275970ScyThe following
1319275970Scytypes are supported:
1320275970Scy.Bl -tag -width indent
1321275970Scy.It Cm none
1322275970ScyThe file set is actually a single plain file.
1323275970Scy.It Cm pid
1324275970ScyOne element of file set is used per incarnation of a ntpd
1325275970Scyserver.
1326275970ScyThis type does not perform any changes to file set
1327275970Scymembers during runtime, however it provides an easy way of
1328275970Scyseparating files belonging to different
1329275970Scy.Xr ntpd @NTPD_MS@
1330275970Scyserver incarnations.
1331275970ScyThe set member filename is built by appending a
1332275970Scy.Ql \&.
1333275970Scyto concatenated
1334275970Scy.Ar prefix
1335275970Scyand
1336275970Scy.Ar filename
1337275970Scystrings, and
1338275970Scyappending the decimal representation of the process ID of the
1339275970Scy.Xr ntpd @NTPD_MS@
1340275970Scyserver process.
1341275970Scy.It Cm day
1342275970ScyOne file generation set element is created per day.
1343275970ScyA day is
1344275970Scydefined as the period between 00:00 and 24:00 UTC.
1345275970ScyThe file set
1346275970Scymember suffix consists of a
1347275970Scy.Ql \&.
1348275970Scyand a day specification in
1349275970Scythe form
1350275970Scy.Cm YYYYMMdd .
1351275970Scy.Cm YYYY
1352275970Scyis a 4\-digit year number (e.g., 1992).
1353275970Scy.Cm MM
1354275970Scyis a two digit month number.
1355275970Scy.Cm dd
1356275970Scyis a two digit day number.
1357275970ScyThus, all information written at 10 December 1992 would end up
1358275970Scyin a file named
1359275970Scy.Ar prefix
1360275970Scy.Ar filename Ns .19921210 .
1361275970Scy.It Cm week
1362275970ScyAny file set member contains data related to a certain week of
1363275970Scya year.
1364275970ScyThe term week is defined by computing day\-of\-year
1365275970Scymodulo 7.
1366275970ScyElements of such a file generation set are
1367275970Scydistinguished by appending the following suffix to the file set
1368275970Scyfilename base: A dot, a 4\-digit year number, the letter
1369275970Scy.Cm W ,
1370275970Scyand a 2\-digit week number.
1371275970ScyFor example, information from January,
1372275970Scy10th 1992 would end up in a file with suffix
1373275970Scy.No . Ns Ar 1992W1 .
1374275970Scy.It Cm month
1375275970ScyOne generation file set element is generated per month.
1376275970ScyThe
1377275970Scyfile name suffix consists of a dot, a 4\-digit year number, and
1378275970Scya 2\-digit month.
1379275970Scy.It Cm year
1380275970ScyOne generation file element is generated per year.
1381275970ScyThe filename
1382275970Scysuffix consists of a dot and a 4 digit year number.
1383275970Scy.It Cm age
1384275970ScyThis type of file generation sets changes to a new element of
1385275970Scythe file set every 24 hours of server operation.
1386275970ScyThe filename
1387275970Scysuffix consists of a dot, the letter
1388275970Scy.Cm a ,
1389275970Scyand an 8\-digit number.
1390275970ScyThis number is taken to be the number of seconds the server is
1391275970Scyrunning at the start of the corresponding 24\-hour period.
1392275970ScyInformation is only written to a file generation by specifying
1393275970Scy.Cm enable ;
1394275970Scyoutput is prevented by specifying
1395275970Scy.Cm disable .
1396275970Scy.El
1397275970Scy.It Cm link | nolink
1398275970ScyIt is convenient to be able to access the current element of a file
1399275970Scygeneration set by a fixed name.
1400275970ScyThis feature is enabled by
1401275970Scyspecifying
1402275970Scy.Cm link
1403275970Scyand disabled using
1404275970Scy.Cm nolink .
1405275970ScyIf link is specified, a
1406275970Scyhard link from the current file set element to a file without
1407275970Scysuffix is created.
1408275970ScyWhen there is already a file with this name and
1409275970Scythe number of links of this file is one, it is renamed appending a
1410275970Scydot, the letter
1411275970Scy.Cm C ,
1412298770Sdelphijand the pid of the
1413298770Sdelphij.Xr ntpd @NTPD_MS@
1414298770Sdelphijserver process.
1415275970ScyWhen the
1416275970Scynumber of links is greater than one, the file is unlinked.
1417275970ScyThis
1418275970Scyallows the current file to be accessed by a constant name.
1419275970Scy.It Cm enable \&| Cm disable
1420275970ScyEnables or disables the recording function.
1421275970Scy.El
1422275970Scy.El
1423275970Scy.El
1424275970Scy.Sh Access Control Support
1425275970ScyThe
1426275970Scy.Xr ntpd @NTPD_MS@
1427275970Scydaemon implements a general purpose address/mask based restriction
1428275970Scylist.
1429275970ScyThe list contains address/match entries sorted first
1430275970Scyby increasing address values and and then by increasing mask values.
1431275970ScyA match occurs when the bitwise AND of the mask and the packet
1432275970Scysource address is equal to the bitwise AND of the mask and
1433275970Scyaddress in the list.
1434275970ScyThe list is searched in order with the
1435275970Scylast match found defining the restriction flags associated
1436275970Scywith the entry.
1437275970ScyAdditional information and examples can be found in the
1438275970Scy.Qq Notes on Configuring NTP and Setting up a NTP Subnet
1439275970Scypage
1440275970Scy(available as part of the HTML documentation
1441275970Scyprovided in
1442275970Scy.Pa /usr/share/doc/ntp ) .
1443275970Scy.Pp
1444275970ScyThe restriction facility was implemented in conformance
1445275970Scywith the access policies for the original NSFnet backbone
1446275970Scytime servers.
1447275970ScyLater the facility was expanded to deflect
1448275970Scycryptographic and clogging attacks.
1449275970ScyWhile this facility may
1450275970Scybe useful for keeping unwanted or broken or malicious clients
1451275970Scyfrom congesting innocent servers, it should not be considered
1452275970Scyan alternative to the NTP authentication facilities.
1453275970ScySource address based restrictions are easily circumvented
1454275970Scyby a determined cracker.
1455275970Scy.Pp
1456275970ScyClients can be denied service because they are explicitly
1457298770Sdelphijincluded in the restrict list created by the
1458298770Sdelphij.Ic restrict
1459298770Sdelphijcommand
1460275970Scyor implicitly as the result of cryptographic or rate limit
1461275970Scyviolations.
1462275970ScyCryptographic violations include certificate
1463275970Scyor identity verification failure; rate limit violations generally
1464275970Scyresult from defective NTP implementations that send packets
1465275970Scyat abusive rates.
1466275970ScySome violations cause denied service
1467275970Scyonly for the offending packet, others cause denied service
1468275970Scyfor a timed period and others cause the denied service for
1469298770Sdelphijan indefinite period.
1470275970ScyWhen a client or network is denied access
1471298770Sdelphijfor an indefinite period, the only way at present to remove
1472275970Scythe restrictions is by restarting the server.
1473275970Scy.Ss The Kiss\-of\-Death Packet
1474275970ScyOrdinarily, packets denied service are simply dropped with no
1475275970Scyfurther action except incrementing statistics counters.
1476275970ScySometimes a
1477275970Scymore proactive response is needed, such as a server message that
1478275970Scyexplicitly requests the client to stop sending and leave a message
1479275970Scyfor the system operator.
1480275970ScyA special packet format has been created
1481275970Scyfor this purpose called the "kiss\-of\-death" (KoD) packet.
1482275970ScyKoD packets have the leap bits set unsynchronized and stratum set
1483275970Scyto zero and the reference identifier field set to a four\-byte
1484275970ScyASCII code.
1485275970ScyIf the
1486275970Scy.Cm noserve
1487275970Scyor
1488275970Scy.Cm notrust
1489275970Scyflag of the matching restrict list entry is set,
1490275970Scythe code is "DENY"; if the
1491275970Scy.Cm limited
1492275970Scyflag is set and the rate limit
1493275970Scyis exceeded, the code is "RATE".
1494275970ScyFinally, if a cryptographic violation occurs, the code is "CRYP".
1495275970Scy.Pp
1496275970ScyA client receiving a KoD performs a set of sanity checks to
1497275970Scyminimize security exposure, then updates the stratum and
1498275970Scyreference identifier peer variables, sets the access
1499275970Scydenied (TEST4) bit in the peer flash variable and sends
1500275970Scya message to the log.
1501275970ScyAs long as the TEST4 bit is set,
1502275970Scythe client will send no further packets to the server.
1503275970ScyThe only way at present to recover from this condition is
1504275970Scyto restart the protocol at both the client and server.
1505275970ScyThis
1506275970Scyhappens automatically at the client when the association times out.
1507275970ScyIt will happen at the server only if the server operator cooperates.
1508275970Scy.Ss Access Control Commands
1509275970Scy.Bl -tag -width indent
1510275970Scy.It Xo Ic discard
1511275970Scy.Op Cm average Ar avg
1512275970Scy.Op Cm minimum Ar min
1513275970Scy.Op Cm monitor Ar prob
1514275970Scy.Xc
1515275970ScySet the parameters of the
1516275970Scy.Cm limited
1517275970Scyfacility which protects the server from
1518275970Scyclient abuse.
1519275970ScyThe
1520275970Scy.Cm average
1521275970Scysubcommand specifies the minimum average packet
1522275970Scyspacing, while the
1523275970Scy.Cm minimum
1524275970Scysubcommand specifies the minimum packet spacing.
1525275970ScyPackets that violate these minima are discarded
1526275970Scyand a kiss\-o'\-death packet returned if enabled.
1527275970ScyThe default
1528275970Scyminimum average and minimum are 5 and 2, respectively.
1529298770SdelphijThe
1530298770Sdelphij.Ic monitor
1531298770Sdelphijsubcommand specifies the probability of discard
1532275970Scyfor packets that overflow the rate\-control window.
1533275970Scy.It Xo Ic restrict address
1534275970Scy.Op Cm mask Ar mask
1535275970Scy.Op Ar flag ...
1536275970Scy.Xc
1537275970ScyThe
1538275970Scy.Ar address
1539275970Scyargument expressed in
1540275970Scydotted\-quad form is the address of a host or network.
1541275970ScyAlternatively, the
1542275970Scy.Ar address
1543275970Scyargument can be a valid host DNS name.
1544275970ScyThe
1545275970Scy.Ar mask
1546275970Scyargument expressed in dotted\-quad form defaults to
1547275970Scy.Cm 255.255.255.255 ,
1548275970Scymeaning that the
1549275970Scy.Ar address
1550275970Scyis treated as the address of an individual host.
1551275970ScyA default entry (address
1552275970Scy.Cm 0.0.0.0 ,
1553275970Scymask
1554275970Scy.Cm 0.0.0.0 )
1555275970Scyis always included and is always the first entry in the list.
1556275970ScyNote that text string
1557275970Scy.Cm default ,
1558275970Scywith no mask option, may
1559275970Scybe used to indicate the default entry.
1560275970ScyIn the current implementation,
1561275970Scy.Cm flag
1562275970Scyalways
1563275970Scyrestricts access, i.e., an entry with no flags indicates that free
1564275970Scyaccess to the server is to be given.
1565275970ScyThe flags are not orthogonal,
1566275970Scyin that more restrictive flags will often make less restrictive
1567275970Scyones redundant.
1568275970ScyThe flags can generally be classed into two
1569275970Scycategories, those which restrict time service and those which
1570275970Scyrestrict informational queries and attempts to do run\-time
1571275970Scyreconfiguration of the server.
1572275970ScyOne or more of the following flags
1573275970Scymay be specified:
1574275970Scy.Bl -tag -width indent
1575275970Scy.It Cm ignore
1576275970ScyDeny packets of all kinds, including
1577275970Scy.Xr ntpq @NTPQ_MS@
1578275970Scyand
1579275970Scy.Xr ntpdc @NTPDC_MS@
1580275970Scyqueries.
1581275970Scy.It Cm kod
1582275970ScyIf this flag is set when an access violation occurs, a kiss\-o'\-death
1583275970Scy(KoD) packet is sent.
1584275970ScyKoD packets are rate limited to no more than one
1585275970Scyper second.
1586275970ScyIf another KoD packet occurs within one second after the
1587275970Scylast one, the packet is dropped.
1588275970Scy.It Cm limited
1589275970ScyDeny service if the packet spacing violates the lower limits specified
1590298770Sdelphijin the
1591298770Sdelphij.Ic discard
1592298770Sdelphijcommand.
1593275970ScyA history of clients is kept using the
1594275970Scymonitoring capability of
1595275970Scy.Xr ntpd @NTPD_MS@ .
1596275970ScyThus, monitoring is always active as
1597275970Scylong as there is a restriction entry with the
1598275970Scy.Cm limited
1599275970Scyflag.
1600275970Scy.It Cm lowpriotrap
1601275970ScyDeclare traps set by matching hosts to be low priority.
1602275970ScyThe
1603275970Scynumber of traps a server can maintain is limited (the current limit
1604275970Scyis 3).
1605275970ScyTraps are usually assigned on a first come, first served
1606275970Scybasis, with later trap requestors being denied service.
1607275970ScyThis flag
1608275970Scymodifies the assignment algorithm by allowing low priority traps to
1609275970Scybe overridden by later requests for normal priority traps.
1610275970Scy.It Cm nomodify
1611275970ScyDeny
1612275970Scy.Xr ntpq @NTPQ_MS@
1613275970Scyand
1614275970Scy.Xr ntpdc @NTPDC_MS@
1615275970Scyqueries which attempt to modify the state of the
1616275970Scyserver (i.e., run time reconfiguration).
1617275970ScyQueries which return
1618275970Scyinformation are permitted.
1619275970Scy.It Cm noquery
1620275970ScyDeny
1621275970Scy.Xr ntpq @NTPQ_MS@
1622275970Scyand
1623275970Scy.Xr ntpdc @NTPDC_MS@
1624275970Scyqueries.
1625275970ScyTime service is not affected.
1626275970Scy.It Cm nopeer
1627275970ScyDeny packets which would result in mobilizing a new association.
1628275970ScyThis
1629275970Scyincludes broadcast and symmetric active packets when a configured
1630275970Scyassociation does not exist.
1631275970ScyIt also includes
1632275970Scy.Cm pool
1633275970Scyassociations, so if you want to use servers from a 
1634275970Scy.Cm pool
1635275970Scydirective and also want to use
1636275970Scy.Cm nopeer
1637275970Scyby default, you'll want a
1638275970Scy.Cm "restrict source ..." line as well that does
1639275970Scy.It not
1640275970Scyinclude the
1641275970Scy.Cm nopeer
1642275970Scydirective.
1643275970Scy.It Cm noserve
1644275970ScyDeny all packets except
1645275970Scy.Xr ntpq @NTPQ_MS@
1646275970Scyand
1647275970Scy.Xr ntpdc @NTPDC_MS@
1648275970Scyqueries.
1649275970Scy.It Cm notrap
1650275970ScyDecline to provide mode 6 control message trap service to matching
1651275970Scyhosts.
1652298770SdelphijThe trap service is a subsystem of the
1653298770Sdelphij.Xr ntpq @NTPQ_MS@
1654298770Sdelphijcontrol message
1655275970Scyprotocol which is intended for use by remote event logging programs.
1656275970Scy.It Cm notrust
1657275970ScyDeny service unless the packet is cryptographically authenticated.
1658275970Scy.It Cm ntpport
1659275970ScyThis is actually a match algorithm modifier, rather than a
1660275970Scyrestriction flag.
1661275970ScyIts presence causes the restriction entry to be
1662275970Scymatched only if the source port in the packet is the standard NTP
1663275970ScyUDP port (123).
1664275970ScyBoth
1665275970Scy.Cm ntpport
1666275970Scyand
1667275970Scy.Cm non\-ntpport
1668275970Scymay
1669275970Scybe specified.
1670275970ScyThe
1671275970Scy.Cm ntpport
1672275970Scyis considered more specific and
1673275970Scyis sorted later in the list.
1674275970Scy.It Cm version
1675275970ScyDeny packets that do not match the current NTP version.
1676275970Scy.El
1677275970Scy.Pp
1678275970ScyDefault restriction list entries with the flags ignore, interface,
1679275970Scyntpport, for each of the local host's interface addresses are
1680275970Scyinserted into the table at startup to prevent the server
1681275970Scyfrom attempting to synchronize to its own time.
1682275970ScyA default entry is also always present, though if it is
1683275970Scyotherwise unconfigured; no flags are associated
1684275970Scywith the default entry (i.e., everything besides your own
1685275970ScyNTP server is unrestricted).
1686275970Scy.El
1687275970Scy.Sh Automatic NTP Configuration Options
1688275970Scy.Ss Manycasting
1689275970ScyManycasting is a automatic discovery and configuration paradigm
1690275970Scynew to NTPv4.
1691275970ScyIt is intended as a means for a multicast client
1692275970Scyto troll the nearby network neighborhood to find cooperating
1693275970Scymanycast servers, validate them using cryptographic means
1694275970Scyand evaluate their time values with respect to other servers
1695275970Scythat might be lurking in the vicinity.
1696275970ScyThe intended result is that each manycast client mobilizes
1697275970Scyclient associations with some number of the "best"
1698275970Scyof the nearby manycast servers, yet automatically reconfigures
1699275970Scyto sustain this number of servers should one or another fail.
1700275970Scy.Pp
1701275970ScyNote that the manycasting paradigm does not coincide
1702275970Scywith the anycast paradigm described in RFC\-1546,
1703275970Scywhich is designed to find a single server from a clique
1704275970Scyof servers providing the same service.
1705275970ScyThe manycast paradigm is designed to find a plurality
1706275970Scyof redundant servers satisfying defined optimality criteria.
1707275970Scy.Pp
1708275970ScyManycasting can be used with either symmetric key
1709275970Scyor public key cryptography.
1710275970ScyThe public key infrastructure (PKI)
1711275970Scyoffers the best protection against compromised keys
1712275970Scyand is generally considered stronger, at least with relatively
1713275970Scylarge key sizes.
1714275970ScyIt is implemented using the Autokey protocol and
1715275970Scythe OpenSSL cryptographic library available from
1716275970Scy.Li http://www.openssl.org/ .
1717275970ScyThe library can also be used with other NTPv4 modes
1718275970Scyas well and is highly recommended, especially for broadcast modes.
1719275970Scy.Pp
1720275970ScyA persistent manycast client association is configured
1721298770Sdelphijusing the
1722298770Sdelphij.Ic manycastclient
1723298770Sdelphijcommand, which is similar to the
1724298770Sdelphij.Ic server
1725298770Sdelphijcommand but with a multicast (IPv4 class
1726275970Scy.Cm D
1727275970Scyor IPv6 prefix
1728275970Scy.Cm FF )
1729275970Scygroup address.
1730275970ScyThe IANA has designated IPv4 address 224.1.1.1
1731275970Scyand IPv6 address FF05::101 (site local) for NTP.
1732275970ScyWhen more servers are needed, it broadcasts manycast
1733275970Scyclient messages to this address at the minimum feasible rate
1734275970Scyand minimum feasible time\-to\-live (TTL) hops, depending
1735275970Scyon how many servers have already been found.
1736275970ScyThere can be as many manycast client associations
1737275970Scyas different group address, each one serving as a template
1738275970Scyfor a future ephemeral unicast client/server association.
1739275970Scy.Pp
1740275970ScyManycast servers configured with the
1741275970Scy.Ic manycastserver
1742275970Scycommand listen on the specified group address for manycast
1743275970Scyclient messages.
1744275970ScyNote the distinction between manycast client,
1745275970Scywhich actively broadcasts messages, and manycast server,
1746275970Scywhich passively responds to them.
1747275970ScyIf a manycast server is
1748275970Scyin scope of the current TTL and is itself synchronized
1749275970Scyto a valid source and operating at a stratum level equal
1750275970Scyto or lower than the manycast client, it replies to the
1751275970Scymanycast client message with an ordinary unicast server message.
1752275970Scy.Pp
1753275970ScyThe manycast client receiving this message mobilizes
1754275970Scyan ephemeral client/server association according to the
1755275970Scymatching manycast client template, but only if cryptographically
1756275970Scyauthenticated and the server stratum is less than or equal
1757275970Scyto the client stratum.
1758275970ScyAuthentication is explicitly required
1759275970Scyand either symmetric key or public key (Autokey) can be used.
1760275970ScyThen, the client polls the server at its unicast address
1761275970Scyin burst mode in order to reliably set the host clock
1762275970Scyand validate the source.
1763275970ScyThis normally results
1764275970Scyin a volley of eight client/server at 2\-s intervals
1765275970Scyduring which both the synchronization and cryptographic
1766275970Scyprotocols run concurrently.
1767275970ScyFollowing the volley,
1768275970Scythe client runs the NTP intersection and clustering
1769275970Scyalgorithms, which act to discard all but the "best"
1770275970Scyassociations according to stratum and synchronization
1771275970Scydistance.
1772275970ScyThe surviving associations then continue
1773275970Scyin ordinary client/server mode.
1774275970Scy.Pp
1775275970ScyThe manycast client polling strategy is designed to reduce
1776275970Scyas much as possible the volume of manycast client messages
1777275970Scyand the effects of implosion due to near\-simultaneous
1778275970Scyarrival of manycast server messages.
1779275970ScyThe strategy is determined by the
1780275970Scy.Ic manycastclient ,
1781275970Scy.Ic tos
1782275970Scyand
1783275970Scy.Ic ttl
1784275970Scyconfiguration commands.
1785275970ScyThe manycast poll interval is
1786275970Scynormally eight times the system poll interval,
1787275970Scywhich starts out at the
1788275970Scy.Cm minpoll
1789275970Scyvalue specified in the
1790275970Scy.Ic manycastclient ,
1791275970Scycommand and, under normal circumstances, increments to the
1792275970Scy.Cm maxpolll
1793275970Scyvalue specified in this command.
1794275970ScyInitially, the TTL is
1795298770Sdelphijset at the minimum hops specified by the
1796298770Sdelphij.Ic ttl
1797298770Sdelphijcommand.
1798275970ScyAt each retransmission the TTL is increased until reaching
1799275970Scythe maximum hops specified by this command or a sufficient
1800275970Scynumber client associations have been found.
1801275970ScyFurther retransmissions use the same TTL.
1802275970Scy.Pp
1803275970ScyThe quality and reliability of the suite of associations
1804275970Scydiscovered by the manycast client is determined by the NTP
1805275970Scymitigation algorithms and the
1806275970Scy.Cm minclock
1807275970Scyand
1808275970Scy.Cm minsane
1809275970Scyvalues specified in the
1810275970Scy.Ic tos
1811275970Scyconfiguration command.
1812275970ScyAt least
1813275970Scy.Cm minsane
1814275970Scycandidate servers must be available and the mitigation
1815275970Scyalgorithms produce at least
1816275970Scy.Cm minclock
1817275970Scysurvivors in order to synchronize the clock.
1818275970ScyByzantine agreement principles require at least four
1819275970Scycandidates in order to correctly discard a single falseticker.
1820275970ScyFor legacy purposes,
1821275970Scy.Cm minsane
1822275970Scydefaults to 1 and
1823275970Scy.Cm minclock
1824275970Scydefaults to 3.
1825275970ScyFor manycast service
1826275970Scy.Cm minsane
1827275970Scyshould be explicitly set to 4, assuming at least that
1828275970Scynumber of servers are available.
1829275970Scy.Pp
1830275970ScyIf at least
1831275970Scy.Cm minclock
1832275970Scyservers are found, the manycast poll interval is immediately
1833275970Scyset to eight times
1834275970Scy.Cm maxpoll .
1835275970ScyIf less than
1836275970Scy.Cm minclock
1837275970Scyservers are found when the TTL has reached the maximum hops,
1838275970Scythe manycast poll interval is doubled.
1839275970ScyFor each transmission
1840275970Scyafter that, the poll interval is doubled again until
1841275970Scyreaching the maximum of eight times
1842275970Scy.Cm maxpoll .
1843275970ScyFurther transmissions use the same poll interval and
1844275970ScyTTL values.
1845275970ScyNote that while all this is going on,
1846275970Scyeach client/server association found is operating normally
1847275970Scyit the system poll interval.
1848275970Scy.Pp
1849275970ScyAdministratively scoped multicast boundaries are normally
1850275970Scyspecified by the network router configuration and,
1851275970Scyin the case of IPv6, the link/site scope prefix.
1852275970ScyBy default, the increment for TTL hops is 32 starting
1853275970Scyfrom 31; however, the
1854275970Scy.Ic ttl
1855275970Scyconfiguration command can be
1856275970Scyused to modify the values to match the scope rules.
1857275970Scy.Pp
1858275970ScyIt is often useful to narrow the range of acceptable
1859275970Scyservers which can be found by manycast client associations.
1860275970ScyBecause manycast servers respond only when the client
1861275970Scystratum is equal to or greater than the server stratum,
1862275970Scyprimary (stratum 1) servers fill find only primary servers
1863275970Scyin TTL range, which is probably the most common objective.
1864275970ScyHowever, unless configured otherwise, all manycast clients
1865275970Scyin TTL range will eventually find all primary servers
1866275970Scyin TTL range, which is probably not the most common
1867275970Scyobjective in large networks.
1868275970ScyThe
1869275970Scy.Ic tos
1870275970Scycommand can be used to modify this behavior.
1871275970ScyServers with stratum below
1872275970Scy.Cm floor
1873275970Scyor above
1874275970Scy.Cm ceiling
1875275970Scyspecified in the
1876275970Scy.Ic tos
1877275970Scycommand are strongly discouraged during the selection
1878275970Scyprocess; however, these servers may be temporally
1879275970Scyaccepted if the number of servers within TTL range is
1880275970Scyless than
1881275970Scy.Cm minclock .
1882275970Scy.Pp
1883275970ScyThe above actions occur for each manycast client message,
1884275970Scywhich repeats at the designated poll interval.
1885275970ScyHowever, once the ephemeral client association is mobilized,
1886275970Scysubsequent manycast server replies are discarded,
1887275970Scysince that would result in a duplicate association.
1888275970ScyIf during a poll interval the number of client associations
1889275970Scyfalls below
1890275970Scy.Cm minclock ,
1891275970Scyall manycast client prototype associations are reset
1892275970Scyto the initial poll interval and TTL hops and operation
1893275970Scyresumes from the beginning.
1894275970ScyIt is important to avoid
1895275970Scyfrequent manycast client messages, since each one requires
1896275970Scyall manycast servers in TTL range to respond.
1897275970ScyThe result could well be an implosion, either minor or major,
1898275970Scydepending on the number of servers in range.
1899275970ScyThe recommended value for
1900275970Scy.Cm maxpoll
1901275970Scyis 12 (4,096 s).
1902275970Scy.Pp
1903275970ScyIt is possible and frequently useful to configure a host
1904275970Scyas both manycast client and manycast server.
1905275970ScyA number of hosts configured this way and sharing a common
1906275970Scygroup address will automatically organize themselves
1907275970Scyin an optimum configuration based on stratum and
1908275970Scysynchronization distance.
1909275970ScyFor example, consider an NTP
1910275970Scysubnet of two primary servers and a hundred or more
1911275970Scydependent clients.
1912275970ScyWith two exceptions, all servers
1913275970Scyand clients have identical configuration files including both
1914275970Scy.Ic multicastclient
1915275970Scyand
1916275970Scy.Ic multicastserver
1917275970Scycommands using, for instance, multicast group address
1918275970Scy239.1.1.1.
1919275970ScyThe only exception is that each primary server
1920275970Scyconfiguration file must include commands for the primary
1921275970Scyreference source such as a GPS receiver.
1922275970Scy.Pp
1923275970ScyThe remaining configuration files for all secondary
1924275970Scyservers and clients have the same contents, except for the
1925275970Scy.Ic tos
1926275970Scycommand, which is specific for each stratum level.
1927275970ScyFor stratum 1 and stratum 2 servers, that command is
1928275970Scynot necessary.
1929275970ScyFor stratum 3 and above servers the
1930275970Scy.Cm floor
1931275970Scyvalue is set to the intended stratum number.
1932275970ScyThus, all stratum 3 configuration files are identical,
1933275970Scyall stratum 4 files are identical and so forth.
1934275970Scy.Pp
1935275970ScyOnce operations have stabilized in this scenario,
1936275970Scythe primary servers will find the primary reference source
1937275970Scyand each other, since they both operate at the same
1938275970Scystratum (1), but not with any secondary server or client,
1939275970Scysince these operate at a higher stratum.
1940275970ScyThe secondary
1941275970Scyservers will find the servers at the same stratum level.
1942275970ScyIf one of the primary servers loses its GPS receiver,
1943275970Scyit will continue to operate as a client and other clients
1944275970Scywill time out the corresponding association and
1945275970Scyre\-associate accordingly.
1946275970Scy.Pp
1947275970ScySome administrators prefer to avoid running
1948275970Scy.Xr ntpd @NTPD_MS@
1949275970Scycontinuously and run either
1950289997Sglebius.Xr sntp @SNTP_MS@
1951275970Scyor
1952275970Scy.Xr ntpd @NTPD_MS@
1953275970Scy.Fl q
1954275970Scyas a cron job.
1955275970ScyIn either case the servers must be
1956275970Scyconfigured in advance and the program fails if none are
1957275970Scyavailable when the cron job runs.
1958275970ScyA really slick
1959275970Scyapplication of manycast is with
1960275970Scy.Xr ntpd @NTPD_MS@
1961275970Scy.Fl q .
1962275970ScyThe program wakes up, scans the local landscape looking
1963275970Scyfor the usual suspects, selects the best from among
1964275970Scythe rascals, sets the clock and then departs.
1965275970ScyServers do not have to be configured in advance and
1966275970Scyall clients throughout the network can have the same
1967275970Scyconfiguration file.
1968275970Scy.Ss Manycast Interactions with Autokey
1969275970ScyEach time a manycast client sends a client mode packet
1970275970Scyto a multicast group address, all manycast servers
1971275970Scyin scope generate a reply including the host name
1972275970Scyand status word.
1973275970ScyThe manycast clients then run
1974275970Scythe Autokey protocol, which collects and verifies
1975275970Scyall certificates involved.
1976275970ScyFollowing the burst interval
1977275970Scyall but three survivors are cast off,
1978275970Scybut the certificates remain in the local cache.
1979275970ScyIt often happens that several complete signing trails
1980275970Scyfrom the client to the primary servers are collected in this way.
1981275970Scy.Pp
1982275970ScyAbout once an hour or less often if the poll interval
1983275970Scyexceeds this, the client regenerates the Autokey key list.
1984275970ScyThis is in general transparent in client/server mode.
1985275970ScyHowever, about once per day the server private value
1986275970Scyused to generate cookies is refreshed along with all
1987275970Scymanycast client associations.
1988275970ScyIn this case all
1989275970Scycryptographic values including certificates is refreshed.
1990275970ScyIf a new certificate has been generated since
1991275970Scythe last refresh epoch, it will automatically revoke
1992275970Scyall prior certificates that happen to be in the
1993275970Scycertificate cache.
1994275970ScyAt the same time, the manycast
1995275970Scyscheme starts all over from the beginning and
1996275970Scythe expanding ring shrinks to the minimum and increments
1997275970Scyfrom there while collecting all servers in scope.
1998275970Scy.Ss Manycast Options
1999275970Scy.Bl -tag -width indent
2000275970Scy.It Xo Ic tos
2001275970Scy.Oo
2002275970Scy.Cm ceiling Ar ceiling |
2003275970Scy.Cm cohort { 0 | 1 } |
2004275970Scy.Cm floor Ar floor |
2005275970Scy.Cm minclock Ar minclock |
2006275970Scy.Cm minsane Ar minsane
2007275970Scy.Oc
2008275970Scy.Xc
2009275970ScyThis command affects the clock selection and clustering
2010275970Scyalgorithms.
2011275970ScyIt can be used to select the quality and
2012275970Scyquantity of peers used to synchronize the system clock
2013275970Scyand is most useful in manycast mode.
2014275970ScyThe variables operate
2015275970Scyas follows:
2016275970Scy.Bl -tag -width indent
2017275970Scy.It Cm ceiling Ar ceiling
2018275970ScyPeers with strata above
2019275970Scy.Cm ceiling
2020275970Scywill be discarded if there are at least
2021275970Scy.Cm minclock
2022275970Scypeers remaining.
2023275970ScyThis value defaults to 15, but can be changed
2024275970Scyto any number from 1 to 15.
2025275970Scy.It Cm cohort Bro 0 | 1 Brc
2026275970ScyThis is a binary flag which enables (0) or disables (1)
2027275970Scymanycast server replies to manycast clients with the same
2028275970Scystratum level.
2029275970ScyThis is useful to reduce implosions where
2030275970Scylarge numbers of clients with the same stratum level
2031275970Scyare present.
2032275970ScyThe default is to enable these replies.
2033275970Scy.It Cm floor Ar floor
2034275970ScyPeers with strata below
2035275970Scy.Cm floor
2036275970Scywill be discarded if there are at least
2037275970Scy.Cm minclock
2038275970Scypeers remaining.
2039275970ScyThis value defaults to 1, but can be changed
2040275970Scyto any number from 1 to 15.
2041275970Scy.It Cm minclock Ar minclock
2042289997SglebiusThe clustering algorithm repeatedly casts out outlier
2043275970Scyassociations until no more than
2044275970Scy.Cm minclock
2045275970Scyassociations remain.
2046275970ScyThis value defaults to 3,
2047275970Scybut can be changed to any number from 1 to the number of
2048275970Scyconfigured sources.
2049275970Scy.It Cm minsane Ar minsane
2050275970ScyThis is the minimum number of candidates available
2051275970Scyto the clock selection algorithm in order to produce
2052275970Scyone or more truechimers for the clustering algorithm.
2053275970ScyIf fewer than this number are available, the clock is
2054275970Scyundisciplined and allowed to run free.
2055275970ScyThe default is 1
2056275970Scyfor legacy purposes.
2057275970ScyHowever, according to principles of
2058275970ScyByzantine agreement,
2059275970Scy.Cm minsane
2060275970Scyshould be at least 4 in order to detect and discard
2061275970Scya single falseticker.
2062275970Scy.El
2063275970Scy.It Cm ttl Ar hop ...
2064275970ScyThis command specifies a list of TTL values in increasing
2065275970Scyorder, up to 8 values can be specified.
2066275970ScyIn manycast mode these values are used in turn
2067275970Scyin an expanding\-ring search.
2068275970ScyThe default is eight
2069275970Scymultiples of 32 starting at 31.
2070275970Scy.El
2071275970Scy.Sh Reference Clock Support
2072275970ScyThe NTP Version 4 daemon supports some three dozen different radio,
2073275970Scysatellite and modem reference clocks plus a special pseudo\-clock
2074275970Scyused for backup or when no other clock source is available.
2075275970ScyDetailed descriptions of individual device drivers and options can
2076275970Scybe found in the
2077275970Scy.Qq Reference Clock Drivers
2078275970Scypage
2079275970Scy(available as part of the HTML documentation
2080275970Scyprovided in
2081275970Scy.Pa /usr/share/doc/ntp ) .
2082275970ScyAdditional information can be found in the pages linked
2083275970Scythere, including the
2084275970Scy.Qq Debugging Hints for Reference Clock Drivers
2085275970Scyand
2086275970Scy.Qq How To Write a Reference Clock Driver
2087275970Scypages
2088275970Scy(available as part of the HTML documentation
2089275970Scyprovided in
2090275970Scy.Pa /usr/share/doc/ntp ) .
2091275970ScyIn addition, support for a PPS
2092275970Scysignal is available as described in the
2093275970Scy.Qq Pulse\-per\-second (PPS) Signal Interfacing
2094275970Scypage
2095275970Scy(available as part of the HTML documentation
2096275970Scyprovided in
2097275970Scy.Pa /usr/share/doc/ntp ) .
2098275970ScyMany
2099275970Scydrivers support special line discipline/streams modules which can
2100275970Scysignificantly improve the accuracy using the driver.
2101275970ScyThese are
2102275970Scydescribed in the
2103275970Scy.Qq Line Disciplines and Streams Drivers
2104275970Scypage
2105275970Scy(available as part of the HTML documentation
2106275970Scyprovided in
2107275970Scy.Pa /usr/share/doc/ntp ) .
2108275970Scy.Pp
2109275970ScyA reference clock will generally (though not always) be a radio
2110275970Scytimecode receiver which is synchronized to a source of standard
2111275970Scytime such as the services offered by the NRC in Canada and NIST and
2112275970ScyUSNO in the US.
2113275970ScyThe interface between the computer and the timecode
2114275970Scyreceiver is device dependent, but is usually a serial port.
2115275970ScyA
2116275970Scydevice driver specific to each reference clock must be selected and
2117275970Scycompiled in the distribution; however, most common radio, satellite
2118275970Scyand modem clocks are included by default.
2119275970ScyNote that an attempt to
2120275970Scyconfigure a reference clock when the driver has not been compiled
2121275970Scyor the hardware port has not been appropriately configured results
2122275970Scyin a scalding remark to the system log file, but is otherwise non
2123275970Scyhazardous.
2124275970Scy.Pp
2125275970ScyFor the purposes of configuration,
2126275970Scy.Xr ntpd @NTPD_MS@
2127275970Scytreats
2128275970Scyreference clocks in a manner analogous to normal NTP peers as much
2129275970Scyas possible.
2130275970ScyReference clocks are identified by a syntactically
2131275970Scycorrect but invalid IP address, in order to distinguish them from
2132275970Scynormal NTP peers.
2133275970ScyReference clock addresses are of the form
2134275970Scy.Sm off
2135275970Scy.Li 127.127. Ar t . Ar u ,
2136275970Scy.Sm on
2137275970Scywhere
2138275970Scy.Ar t
2139275970Scyis an integer
2140275970Scydenoting the clock type and
2141275970Scy.Ar u
2142275970Scyindicates the unit
2143275970Scynumber in the range 0\-3.
2144275970ScyWhile it may seem overkill, it is in fact
2145275970Scysometimes useful to configure multiple reference clocks of the same
2146275970Scytype, in which case the unit numbers must be unique.
2147275970Scy.Pp
2148275970ScyThe
2149275970Scy.Ic server
2150275970Scycommand is used to configure a reference
2151275970Scyclock, where the
2152275970Scy.Ar address
2153275970Scyargument in that command
2154275970Scyis the clock address.
2155275970ScyThe
2156275970Scy.Cm key ,
2157275970Scy.Cm version
2158275970Scyand
2159275970Scy.Cm ttl
2160275970Scyoptions are not used for reference clock support.
2161275970ScyThe
2162275970Scy.Cm mode
2163275970Scyoption is added for reference clock support, as
2164275970Scydescribed below.
2165275970ScyThe
2166275970Scy.Cm prefer
2167275970Scyoption can be useful to
2168275970Scypersuade the server to cherish a reference clock with somewhat more
2169275970Scyenthusiasm than other reference clocks or peers.
2170275970ScyFurther
2171275970Scyinformation on this option can be found in the
2172275970Scy.Qq Mitigation Rules and the prefer Keyword
2173275970Scy(available as part of the HTML documentation
2174275970Scyprovided in
2175275970Scy.Pa /usr/share/doc/ntp )
2176275970Scypage.
2177275970ScyThe
2178275970Scy.Cm minpoll
2179275970Scyand
2180275970Scy.Cm maxpoll
2181275970Scyoptions have
2182275970Scymeaning only for selected clock drivers.
2183275970ScySee the individual clock
2184275970Scydriver document pages for additional information.
2185275970Scy.Pp
2186275970ScyThe
2187275970Scy.Ic fudge
2188275970Scycommand is used to provide additional
2189275970Scyinformation for individual clock drivers and normally follows
2190275970Scyimmediately after the
2191275970Scy.Ic server
2192275970Scycommand.
2193275970ScyThe
2194275970Scy.Ar address
2195275970Scyargument specifies the clock address.
2196275970ScyThe
2197275970Scy.Cm refid
2198275970Scyand
2199275970Scy.Cm stratum
2200275970Scyoptions can be used to
2201275970Scyoverride the defaults for the device.
2202275970ScyThere are two optional
2203275970Scydevice\-dependent time offsets and four flags that can be included
2204275970Scyin the
2205275970Scy.Ic fudge
2206275970Scycommand as well.
2207275970Scy.Pp
2208275970ScyThe stratum number of a reference clock is by default zero.
2209275970ScySince the
2210275970Scy.Xr ntpd @NTPD_MS@
2211275970Scydaemon adds one to the stratum of each
2212275970Scypeer, a primary server ordinarily displays an external stratum of
2213275970Scyone.
2214275970ScyIn order to provide engineered backups, it is often useful to
2215275970Scyspecify the reference clock stratum as greater than zero.
2216275970ScyThe
2217275970Scy.Cm stratum
2218275970Scyoption is used for this purpose.
2219275970ScyAlso, in cases
2220275970Scyinvolving both a reference clock and a pulse\-per\-second (PPS)
2221275970Scydiscipline signal, it is useful to specify the reference clock
2222275970Scyidentifier as other than the default, depending on the driver.
2223275970ScyThe
2224275970Scy.Cm refid
2225275970Scyoption is used for this purpose.
2226275970ScyExcept where noted,
2227275970Scythese options apply to all clock drivers.
2228275970Scy.Ss Reference Clock Commands
2229275970Scy.Bl -tag -width indent
2230275970Scy.It Xo Ic server
2231275970Scy.Sm off
2232275970Scy.Li 127.127. Ar t . Ar u
2233275970Scy.Sm on
2234275970Scy.Op Cm prefer
2235275970Scy.Op Cm mode Ar int
2236275970Scy.Op Cm minpoll Ar int
2237275970Scy.Op Cm maxpoll Ar int
2238275970Scy.Xc
2239275970ScyThis command can be used to configure reference clocks in
2240275970Scyspecial ways.
2241275970ScyThe options are interpreted as follows:
2242275970Scy.Bl -tag -width indent
2243275970Scy.It Cm prefer
2244275970ScyMarks the reference clock as preferred.
2245275970ScyAll other things being
2246275970Scyequal, this host will be chosen for synchronization among a set of
2247275970Scycorrectly operating hosts.
2248275970ScySee the
2249275970Scy.Qq Mitigation Rules and the prefer Keyword
2250275970Scypage
2251275970Scy(available as part of the HTML documentation
2252275970Scyprovided in
2253275970Scy.Pa /usr/share/doc/ntp )
2254275970Scyfor further information.
2255275970Scy.It Cm mode Ar int
2256275970ScySpecifies a mode number which is interpreted in a
2257275970Scydevice\-specific fashion.
2258275970ScyFor instance, it selects a dialing
2259275970Scyprotocol in the ACTS driver and a device subtype in the
2260275970Scyparse
2261275970Scydrivers.
2262275970Scy.It Cm minpoll Ar int
2263275970Scy.It Cm maxpoll Ar int
2264275970ScyThese options specify the minimum and maximum polling interval
2265275970Scyfor reference clock messages, as a power of 2 in seconds
2266275970ScyFor
2267275970Scymost directly connected reference clocks, both
2268275970Scy.Cm minpoll
2269275970Scyand
2270275970Scy.Cm maxpoll
2271275970Scydefault to 6 (64 s).
2272275970ScyFor modem reference clocks,
2273275970Scy.Cm minpoll
2274275970Scydefaults to 10 (17.1 m) and
2275275970Scy.Cm maxpoll
2276275970Scydefaults to 14 (4.5 h).
2277275970ScyThe allowable range is 4 (16 s) to 17 (36.4 h) inclusive.
2278275970Scy.El
2279275970Scy.It Xo Ic fudge
2280275970Scy.Sm off
2281275970Scy.Li 127.127. Ar t . Ar u
2282275970Scy.Sm on
2283275970Scy.Op Cm time1 Ar sec
2284275970Scy.Op Cm time2 Ar sec
2285275970Scy.Op Cm stratum Ar int
2286275970Scy.Op Cm refid Ar string
2287275970Scy.Op Cm mode Ar int
2288275970Scy.Op Cm flag1 Cm 0 \&| Cm 1
2289275970Scy.Op Cm flag2 Cm 0 \&| Cm 1
2290275970Scy.Op Cm flag3 Cm 0 \&| Cm 1
2291275970Scy.Op Cm flag4 Cm 0 \&| Cm 1
2292275970Scy.Xc
2293275970ScyThis command can be used to configure reference clocks in
2294275970Scyspecial ways.
2295275970ScyIt must immediately follow the
2296275970Scy.Ic server
2297275970Scycommand which configures the driver.
2298275970ScyNote that the same capability
2299275970Scyis possible at run time using the
2300275970Scy.Xr ntpdc @NTPDC_MS@
2301275970Scyprogram.
2302275970ScyThe options are interpreted as
2303275970Scyfollows:
2304275970Scy.Bl -tag -width indent
2305275970Scy.It Cm time1 Ar sec
2306275970ScySpecifies a constant to be added to the time offset produced by
2307275970Scythe driver, a fixed\-point decimal number in seconds.
2308275970ScyThis is used
2309275970Scyas a calibration constant to adjust the nominal time offset of a
2310275970Scyparticular clock to agree with an external standard, such as a
2311275970Scyprecision PPS signal.
2312275970ScyIt also provides a way to correct a
2313275970Scysystematic error or bias due to serial port or operating system
2314275970Scylatencies, different cable lengths or receiver internal delay.
2315275970ScyThe
2316275970Scyspecified offset is in addition to the propagation delay provided
2317275970Scyby other means, such as internal DIPswitches.
2318275970ScyWhere a calibration
2319275970Scyfor an individual system and driver is available, an approximate
2320275970Scycorrection is noted in the driver documentation pages.
2321275970ScyNote: in order to facilitate calibration when more than one
2322275970Scyradio clock or PPS signal is supported, a special calibration
2323275970Scyfeature is available.
2324275970ScyIt takes the form of an argument to the
2325275970Scy.Ic enable
2326275970Scycommand described in
2327275970Scy.Sx Miscellaneous Options
2328275970Scypage and operates as described in the
2329275970Scy.Qq Reference Clock Drivers
2330275970Scypage
2331275970Scy(available as part of the HTML documentation
2332275970Scyprovided in
2333275970Scy.Pa /usr/share/doc/ntp ) .
2334275970Scy.It Cm time2 Ar secs
2335275970ScySpecifies a fixed\-point decimal number in seconds, which is
2336275970Scyinterpreted in a driver\-dependent way.
2337275970ScySee the descriptions of
2338275970Scyspecific drivers in the
2339275970Scy.Qq Reference Clock Drivers
2340275970Scypage
2341275970Scy(available as part of the HTML documentation
2342275970Scyprovided in
2343275970Scy.Pa /usr/share/doc/ntp ) .
2344275970Scy.It Cm stratum Ar int
2345275970ScySpecifies the stratum number assigned to the driver, an integer
2346275970Scybetween 0 and 15.
2347275970ScyThis number overrides the default stratum number
2348275970Scyordinarily assigned by the driver itself, usually zero.
2349275970Scy.It Cm refid Ar string
2350275970ScySpecifies an ASCII string of from one to four characters which
2351275970Scydefines the reference identifier used by the driver.
2352275970ScyThis string
2353275970Scyoverrides the default identifier ordinarily assigned by the driver
2354275970Scyitself.
2355275970Scy.It Cm mode Ar int
2356275970ScySpecifies a mode number which is interpreted in a
2357275970Scydevice\-specific fashion.
2358275970ScyFor instance, it selects a dialing
2359275970Scyprotocol in the ACTS driver and a device subtype in the
2360275970Scyparse
2361275970Scydrivers.
2362275970Scy.It Cm flag1 Cm 0 \&| Cm 1
2363275970Scy.It Cm flag2 Cm 0 \&| Cm 1
2364275970Scy.It Cm flag3 Cm 0 \&| Cm 1
2365275970Scy.It Cm flag4 Cm 0 \&| Cm 1
2366275970ScyThese four flags are used for customizing the clock driver.
2367275970ScyThe
2368275970Scyinterpretation of these values, and whether they are used at all,
2369275970Scyis a function of the particular clock driver.
2370275970ScyHowever, by
2371275970Scyconvention
2372275970Scy.Cm flag4
2373275970Scyis used to enable recording monitoring
2374275970Scydata to the
2375275970Scy.Cm clockstats
2376275970Scyfile configured with the
2377275970Scy.Ic filegen
2378275970Scycommand.
2379275970ScyFurther information on the
2380275970Scy.Ic filegen
2381275970Scycommand can be found in
2382275970Scy.Sx Monitoring Options .
2383275970Scy.El
2384275970Scy.El
2385275970Scy.Sh Miscellaneous Options
2386275970Scy.Bl -tag -width indent
2387275970Scy.It Ic broadcastdelay Ar seconds
2388275970ScyThe broadcast and multicast modes require a special calibration
2389275970Scyto determine the network delay between the local and remote
2390275970Scyservers.
2391275970ScyOrdinarily, this is done automatically by the initial
2392275970Scyprotocol exchanges between the client and server.
2393275970ScyIn some cases,
2394275970Scythe calibration procedure may fail due to network or server access
2395275970Scycontrols, for example.
2396275970ScyThis command specifies the default delay to
2397275970Scybe used under these circumstances.
2398275970ScyTypically (for Ethernet), a
2399275970Scynumber between 0.003 and 0.007 seconds is appropriate.
2400275970ScyThe default
2401275970Scywhen this command is not used is 0.004 seconds.
2402275970Scy.It Ic calldelay Ar delay
2403275970ScyThis option controls the delay in seconds between the first and second
2404275970Scypackets sent in burst or iburst mode to allow additional time for a modem
2405275970Scyor ISDN call to complete.
2406275970Scy.It Ic driftfile Ar driftfile
2407275970ScyThis command specifies the complete path and name of the file used to
2408275970Scyrecord the frequency of the local clock oscillator.
2409275970ScyThis is the same
2410275970Scyoperation as the
2411275970Scy.Fl f
2412275970Scycommand line option.
2413275970ScyIf the file exists, it is read at
2414275970Scystartup in order to set the initial frequency and then updated once per
2415275970Scyhour with the current frequency computed by the daemon.
2416275970ScyIf the file name is
2417275970Scyspecified, but the file itself does not exist, the starts with an initial
2418275970Scyfrequency of zero and creates the file when writing it for the first time.
2419275970ScyIf this command is not given, the daemon will always start with an initial
2420275970Scyfrequency of zero.
2421275970Scy.Pp
2422275970ScyThe file format consists of a single line containing a single
2423275970Scyfloating point number, which records the frequency offset measured
2424275970Scyin parts\-per\-million (PPM).
2425275970ScyThe file is updated by first writing
2426275970Scythe current drift value into a temporary file and then renaming
2427275970Scythis file to replace the old version.
2428275970ScyThis implies that
2429275970Scy.Xr ntpd @NTPD_MS@
2430275970Scymust have write permission for the directory the
2431275970Scydrift file is located in, and that file system links, symbolic or
2432275970Scyotherwise, should be avoided.
2433285612Sdelphij.It Ic dscp Ar value
2434285612SdelphijThis option specifies the Differentiated Services Control Point (DSCP) value,
2435298770Sdelphija 6\-bit code.
2436298770SdelphijThe default value is 46, signifying Expedited Forwarding.
2437275970Scy.It Xo Ic enable
2438275970Scy.Oo
2439275970Scy.Cm auth | Cm bclient |
2440275970Scy.Cm calibrate | Cm kernel |
2441294569Sdelphij.Cm mode7 | Cm monitor |
2442294569Sdelphij.Cm ntp | Cm stats |
2443301301Sdelphij.Cm peer_clear_digest_early |
2444294569Sdelphij.Cm unpeer_crypto_early | Cm unpeer_crypto_nak_early | Cm unpeer_digest_early
2445275970Scy.Oc
2446275970Scy.Xc
2447275970Scy.It Xo Ic disable
2448275970Scy.Oo
2449275970Scy.Cm auth | Cm bclient |
2450275970Scy.Cm calibrate | Cm kernel |
2451294569Sdelphij.Cm mode7 | Cm monitor |
2452294569Sdelphij.Cm ntp | Cm stats |
2453301301Sdelphij.Cm peer_clear_digest_early |
2454294569Sdelphij.Cm unpeer_crypto_early | Cm unpeer_crypto_nak_early | Cm unpeer_digest_early
2455275970Scy.Oc
2456275970Scy.Xc
2457275970ScyProvides a way to enable or disable various server options.
2458275970ScyFlags not mentioned are unaffected.
2459275970ScyNote that all of these flags
2460275970Scycan be controlled remotely using the
2461275970Scy.Xr ntpdc @NTPDC_MS@
2462275970Scyutility program.
2463275970Scy.Bl -tag -width indent
2464275970Scy.It Cm auth
2465275970ScyEnables the server to synchronize with unconfigured peers only if the
2466275970Scypeer has been correctly authenticated using either public key or
2467275970Scyprivate key cryptography.
2468275970ScyThe default for this flag is
2469275970Scy.Ic enable .
2470275970Scy.It Cm bclient
2471275970ScyEnables the server to listen for a message from a broadcast or
2472275970Scymulticast server, as in the
2473275970Scy.Ic multicastclient
2474275970Scycommand with default
2475275970Scyaddress.
2476275970ScyThe default for this flag is
2477275970Scy.Ic disable .
2478275970Scy.It Cm calibrate
2479275970ScyEnables the calibrate feature for reference clocks.
2480275970ScyThe default for
2481275970Scythis flag is
2482275970Scy.Ic disable .
2483275970Scy.It Cm kernel
2484275970ScyEnables the kernel time discipline, if available.
2485275970ScyThe default for this
2486275970Scyflag is
2487275970Scy.Ic enable
2488275970Scyif support is available, otherwise
2489275970Scy.Ic disable .
2490275970Scy.It Cm mode7
2491275970ScyEnables processing of NTP mode 7 implementation\-specific requests
2492275970Scywhich are used by the deprecated
2493275970Scy.Xr ntpdc @NTPDC_MS@
2494275970Scyprogram.
2495275970ScyThe default for this flag is disable.
2496275970ScyThis flag is excluded from runtime configuration using
2497275970Scy.Xr ntpq @NTPQ_MS@ .
2498275970ScyThe
2499275970Scy.Xr ntpq @NTPQ_MS@
2500275970Scyprogram provides the same capabilities as
2501275970Scy.Xr ntpdc @NTPDC_MS@
2502275970Scyusing standard mode 6 requests.
2503275970Scy.It Cm monitor
2504275970ScyEnables the monitoring facility.
2505275970ScySee the
2506275970Scy.Xr ntpdc @NTPDC_MS@
2507275970Scyprogram
2508275970Scyand the
2509275970Scy.Ic monlist
2510275970Scycommand or further information.
2511275970ScyThe
2512275970Scydefault for this flag is
2513275970Scy.Ic enable .
2514275970Scy.It Cm ntp
2515275970ScyEnables time and frequency discipline.
2516275970ScyIn effect, this switch opens and
2517275970Scycloses the feedback loop, which is useful for testing.
2518275970ScyThe default for
2519275970Scythis flag is
2520275970Scy.Ic enable .
2521301301Sdelphij.It Cm peer_clear_digest_early
2522301301SdelphijBy default, if
2523301301Sdelphij.Xr ntpd @NTPD_MS@
2524301301Sdelphijis using autokey and it
2525301301Sdelphijreceives a crypto\-NAK packet that
2526301301Sdelphijpasses the duplicate packet and origin timestamp checks
2527301301Sdelphijthe peer variables are immediately cleared.
2528301301SdelphijWhile this is generally a feature
2529301301Sdelphijas it allows for quick recovery if a server key has changed,
2530301301Sdelphija properly forged and appropriately delivered crypto\-NAK packet
2531301301Sdelphijcan be used in a DoS attack.
2532301301SdelphijIf you have active noticable problems with this type of DoS attack
2533301301Sdelphijthen you should consider
2534301301Sdelphijdisabling this option.
2535301301SdelphijYou can check your
2536301301Sdelphij.Cm peerstats
2537301301Sdelphijfile for evidence of any of these attacks.
2538301301SdelphijThe
2539301301Sdelphijdefault for this flag is
2540301301Sdelphij.Ic enable .
2541275970Scy.It Cm stats
2542275970ScyEnables the statistics facility.
2543275970ScySee the
2544275970Scy.Sx Monitoring Options
2545275970Scysection for further information.
2546275970ScyThe default for this flag is
2547275970Scy.Ic disable .
2548294569Sdelphij.It Cm unpeer_crypto_early
2549294569SdelphijBy default, if
2550294569Sdelphij.Xr ntpd @NTPD_MS@
2551294569Sdelphijreceives an autokey packet that fails TEST9,
2552294569Sdelphija crypto failure,
2553294569Sdelphijthe association is immediately cleared.
2554294569SdelphijThis is almost certainly a feature,
2555294569Sdelphijbut if, in spite of the current recommendation of not using autokey,
2556294569Sdelphijyou are
2557294569Sdelphij.B still
2558294569Sdelphijusing autokey
2559294569Sdelphij.B and
2560294569Sdelphijyou are seeing this sort of DoS attack
2561294569Sdelphijdisabling this flag will delay
2562294569Sdelphijtearing down the association until the reachability counter
2563294569Sdelphijbecomes zero.
2564294569SdelphijYou can check your
2565294569Sdelphij.Cm peerstats
2566294569Sdelphijfile for evidence of any of these attacks.
2567294569SdelphijThe
2568294569Sdelphijdefault for this flag is
2569294569Sdelphij.Ic enable .
2570294569Sdelphij.It Cm unpeer_crypto_nak_early
2571294569SdelphijBy default, if
2572294569Sdelphij.Xr ntpd @NTPD_MS@
2573294569Sdelphijreceives a crypto\-NAK packet that
2574294569Sdelphijpasses the duplicate packet and origin timestamp checks
2575294569Sdelphijthe association is immediately cleared.
2576294569SdelphijWhile this is generally a feature
2577294569Sdelphijas it allows for quick recovery if a server key has changed,
2578294569Sdelphija properly forged and appropriately delivered crypto\-NAK packet
2579294569Sdelphijcan be used in a DoS attack.
2580294569SdelphijIf you have active noticable problems with this type of DoS attack
2581294569Sdelphijthen you should consider
2582294569Sdelphijdisabling this option.
2583294569SdelphijYou can check your
2584294569Sdelphij.Cm peerstats
2585294569Sdelphijfile for evidence of any of these attacks.
2586294569SdelphijThe
2587294569Sdelphijdefault for this flag is
2588294569Sdelphij.Ic enable .
2589294569Sdelphij.It Cm unpeer_digest_early
2590294569SdelphijBy default, if
2591294569Sdelphij.Xr ntpd @NTPD_MS@
2592294569Sdelphijreceives what should be an authenticated packet
2593294569Sdelphijthat passes other packet sanity checks but
2594294569Sdelphijcontains an invalid digest
2595294569Sdelphijthe association is immediately cleared.
2596294569SdelphijWhile this is generally a feature
2597294569Sdelphijas it allows for quick recovery,
2598294569Sdelphijif this type of packet is carefully forged and sent
2599294569Sdelphijduring an appropriate window it can be used for a DoS attack.
2600294569SdelphijIf you have active noticable problems with this type of DoS attack
2601294569Sdelphijthen you should consider
2602294569Sdelphijdisabling this option.
2603294569SdelphijYou can check your
2604294569Sdelphij.Cm peerstats
2605294569Sdelphijfile for evidence of any of these attacks.
2606294569SdelphijThe
2607294569Sdelphijdefault for this flag is
2608294569Sdelphij.Ic enable .
2609275970Scy.El
2610275970Scy.It Ic includefile Ar includefile
2611275970ScyThis command allows additional configuration commands
2612275970Scyto be included from a separate file.
2613275970ScyInclude files may
2614275970Scybe nested to a depth of five; upon reaching the end of any
2615275970Scyinclude file, command processing resumes in the previous
2616275970Scyconfiguration file.
2617275970ScyThis option is useful for sites that run
2618275970Scy.Xr ntpd @NTPD_MS@
2619275970Scyon multiple hosts, with (mostly) common options (e.g., a
2620275970Scyrestriction list).
2621285612Sdelphij.It Ic leapsmearinterval Ar seconds
2622285612SdelphijThis EXPERIMENTAL option is only available if
2623285612Sdelphij.Xr ntpd @NTPD_MS@
2624285612Sdelphijwas built with the
2625285612Sdelphij.Cm \-\-enable\-leap\-smear
2626285612Sdelphijoption to the
2627285612Sdelphij.Cm configure
2628285612Sdelphijscript.
2629285612SdelphijIt specifies the interval over which a leap second correction will be applied.
2630285612SdelphijRecommended values for this option are between
2631285612Sdelphij7200 (2 hours) and 86400 (24 hours).
2632285612Sdelphij.Sy DO NOT USE THIS OPTION ON PUBLIC\-ACCESS SERVERS!
2633285612SdelphijSee http://bugs.ntp.org/2855 for more information.
2634275970Scy.It Ic logconfig Ar configkeyword
2635275970ScyThis command controls the amount and type of output written to
2636275970Scythe system
2637275970Scy.Xr syslog 3
2638275970Scyfacility or the alternate
2639275970Scy.Ic logfile
2640275970Scylog file.
2641275970ScyBy default, all output is turned on.
2642275970ScyAll
2643275970Scy.Ar configkeyword
2644275970Scykeywords can be prefixed with
2645275970Scy.Ql = ,
2646275970Scy.Ql +
2647275970Scyand
2648275970Scy.Ql \- ,
2649275970Scywhere
2650275970Scy.Ql =
2651275970Scysets the
2652275970Scy.Xr syslog 3
2653275970Scypriority mask,
2654275970Scy.Ql +
2655275970Scyadds and
2656275970Scy.Ql \-
2657275970Scyremoves
2658275970Scymessages.
2659275970Scy.Xr syslog 3
2660275970Scymessages can be controlled in four
2661275970Scyclasses
2662275970Scy.Po
2663275970Scy.Cm clock ,
2664275970Scy.Cm peer ,
2665275970Scy.Cm sys
2666275970Scyand
2667275970Scy.Cm sync
2668275970Scy.Pc .
2669275970ScyWithin these classes four types of messages can be
2670275970Scycontrolled: informational messages
2671275970Scy.Po
2672275970Scy.Cm info
2673275970Scy.Pc ,
2674275970Scyevent messages
2675275970Scy.Po
2676275970Scy.Cm events
2677275970Scy.Pc ,
2678275970Scystatistics messages
2679275970Scy.Po
2680275970Scy.Cm statistics
2681275970Scy.Pc
2682275970Scyand
2683275970Scystatus messages
2684275970Scy.Po
2685275970Scy.Cm status
2686275970Scy.Pc .
2687275970Scy.Pp
2688275970ScyConfiguration keywords are formed by concatenating the message class with
2689275970Scythe event class.
2690275970ScyThe
2691275970Scy.Cm all
2692275970Scyprefix can be used instead of a message class.
2693275970ScyA
2694275970Scymessage class may also be followed by the
2695275970Scy.Cm all
2696275970Scykeyword to enable/disable all
2697298770Sdelphijmessages of the respective message class.
2698298770SdelphijThus, a minimal log configuration
2699275970Scycould look like this:
2700275970Scy.Bd -literal
2701275970Scylogconfig =syncstatus +sysevents
2702275970Scy.Ed
2703275970Scy.Pp
2704275970ScyThis would just list the synchronizations state of
2705275970Scy.Xr ntpd @NTPD_MS@
2706275970Scyand the major system events.
2707275970ScyFor a simple reference server, the
2708275970Scyfollowing minimum message configuration could be useful:
2709275970Scy.Bd -literal
2710275970Scylogconfig =syncall +clockall
2711275970Scy.Ed
2712275970Scy.Pp
2713275970ScyThis configuration will list all clock information and
2714275970Scysynchronization information.
2715275970ScyAll other events and messages about
2716275970Scypeers, system events and so on is suppressed.
2717275970Scy.It Ic logfile Ar logfile
2718275970ScyThis command specifies the location of an alternate log file to
2719275970Scybe used instead of the default system
2720275970Scy.Xr syslog 3
2721275970Scyfacility.
2722298770SdelphijThis is the same operation as the
2723298770Sdelphij.Fl l
2724298770Sdelphijcommand line option.
2725275970Scy.It Ic setvar Ar variable Op Cm default
2726275970ScyThis command adds an additional system variable.
2727275970ScyThese
2728275970Scyvariables can be used to distribute additional information such as
2729275970Scythe access policy.
2730275970ScyIf the variable of the form
2731275970Scy.Sm off
2732275970Scy.Va name = Ar value
2733275970Scy.Sm on
2734275970Scyis followed by the
2735275970Scy.Cm default
2736275970Scykeyword, the
2737275970Scyvariable will be listed as part of the default system variables
2738275970Scy.Po
2739275970Scy.Xr ntpq @NTPQ_MS@
2740275970Scy.Ic rv
2741275970Scycommand
2742275970Scy.Pc ) .
2743275970ScyThese additional variables serve
2744275970Scyinformational purposes only.
2745275970ScyThey are not related to the protocol
2746275970Scyother that they can be listed.
2747275970ScyThe known protocol variables will
2748275970Scyalways override any variables defined via the
2749275970Scy.Ic setvar
2750275970Scymechanism.
2751275970ScyThere are three special variables that contain the names
2752275970Scyof all variable of the same group.
2753275970ScyThe
2754275970Scy.Va sys_var_list
2755275970Scyholds
2756275970Scythe names of all system variables.
2757275970ScyThe
2758275970Scy.Va peer_var_list
2759275970Scyholds
2760275970Scythe names of all peer variables and the
2761275970Scy.Va clock_var_list
2762275970Scyholds the names of the reference clock variables.
2763275970Scy.It Xo Ic tinker
2764275970Scy.Oo
2765275970Scy.Cm allan Ar allan |
2766275970Scy.Cm dispersion Ar dispersion |
2767275970Scy.Cm freq Ar freq |
2768275970Scy.Cm huffpuff Ar huffpuff |
2769275970Scy.Cm panic Ar panic |
2770285612Sdelphij.Cm step Ar step |
2771285612Sdelphij.Cm stepback Ar stepback |
2772285612Sdelphij.Cm stepfwd Ar stepfwd |
2773275970Scy.Cm stepout Ar stepout
2774275970Scy.Oc
2775275970Scy.Xc
2776275970ScyThis command can be used to alter several system variables in
2777275970Scyvery exceptional circumstances.
2778275970ScyIt should occur in the
2779275970Scyconfiguration file before any other configuration options.
2780275970ScyThe
2781275970Scydefault values of these variables have been carefully optimized for
2782275970Scya wide range of network speeds and reliability expectations.
2783275970ScyIn
2784275970Scygeneral, they interact in intricate ways that are hard to predict
2785275970Scyand some combinations can result in some very nasty behavior.
2786275970ScyVery
2787275970Scyrarely is it necessary to change the default values; but, some
2788275970Scyfolks cannot resist twisting the knobs anyway and this command is
2789275970Scyfor them.
2790275970ScyEmphasis added: twisters are on their own and can expect
2791275970Scyno help from the support group.
2792275970Scy.Pp
2793275970ScyThe variables operate as follows:
2794275970Scy.Bl -tag -width indent
2795275970Scy.It Cm allan Ar allan
2796275970ScyThe argument becomes the new value for the minimum Allan
2797275970Scyintercept, which is a parameter of the PLL/FLL clock discipline
2798275970Scyalgorithm.
2799275970ScyThe value in log2 seconds defaults to 7 (1024 s), which is also the lower
2800275970Scylimit.
2801275970Scy.It Cm dispersion Ar dispersion
2802275970ScyThe argument becomes the new value for the dispersion increase rate,
2803275970Scynormally .000015 s/s.
2804275970Scy.It Cm freq Ar freq
2805275970ScyThe argument becomes the initial value of the frequency offset in
2806275970Scyparts\-per\-million.
2807275970ScyThis overrides the value in the frequency file, if
2808275970Scypresent, and avoids the initial training state if it is not.
2809275970Scy.It Cm huffpuff Ar huffpuff
2810275970ScyThe argument becomes the new value for the experimental
2811275970Scyhuff\-n'\-puff filter span, which determines the most recent interval
2812275970Scythe algorithm will search for a minimum delay.
2813275970ScyThe lower limit is
2814275970Scy900 s (15 m), but a more reasonable value is 7200 (2 hours).
2815275970ScyThere
2816275970Scyis no default, since the filter is not enabled unless this command
2817275970Scyis given.
2818275970Scy.It Cm panic Ar panic
2819275970ScyThe argument is the panic threshold, normally 1000 s.
2820275970ScyIf set to zero,
2821275970Scythe panic sanity check is disabled and a clock offset of any value will
2822275970Scybe accepted.
2823275970Scy.It Cm step Ar step
2824275970ScyThe argument is the step threshold, which by default is 0.128 s.
2825275970ScyIt can
2826275970Scybe set to any positive number in seconds.
2827275970ScyIf set to zero, step
2828275970Scyadjustments will never occur.
2829275970ScyNote: The kernel time discipline is
2830275970Scydisabled if the step threshold is set to zero or greater than the
2831275970Scydefault.
2832285612Sdelphij.It Cm stepback Ar stepback
2833285612SdelphijThe argument is the step threshold for the backward direction,
2834285612Sdelphijwhich by default is 0.128 s.
2835285612SdelphijIt can
2836285612Sdelphijbe set to any positive number in seconds.
2837285612SdelphijIf both the forward and backward step thresholds are set to zero, step
2838285612Sdelphijadjustments will never occur.
2839285612SdelphijNote: The kernel time discipline is
2840285612Sdelphijdisabled if
2841285612Sdelphijeach direction of step threshold are either
2842285612Sdelphijset to zero or greater than .5 second.
2843285612Sdelphij.It Cm stepfwd Ar stepfwd
2844285612SdelphijAs for stepback, but for the forward direction.
2845275970Scy.It Cm stepout Ar stepout
2846275970ScyThe argument is the stepout timeout, which by default is 900 s.
2847275970ScyIt can
2848275970Scybe set to any positive number in seconds.
2849275970ScyIf set to zero, the stepout
2850275970Scypulses will not be suppressed.
2851275970Scy.El
2852275970Scy.It Xo Ic rlimit
2853275970Scy.Oo
2854275970Scy.Cm memlock Ar Nmegabytes |
2855275970Scy.Cm stacksize Ar N4kPages
2856275970Scy.Cm filenum Ar Nfiledescriptors
2857275970Scy.Oc
2858275970Scy.Xc
2859275970Scy.Bl -tag -width indent
2860275970Scy.It Cm memlock Ar Nmegabytes
2861289997SglebiusSpecify the number of megabytes of memory that should be
2862289997Sglebiusallocated and locked.
2863289997SglebiusProbably only available under Linux, this option may be useful
2864275970Scywhen dropping root (the
2865275970Scy.Fl i
2866275970Scyoption).
2867289997SglebiusThe default is 32 megabytes on non\-Linux machines, and \-1 under Linux.
2868289997Sglebius-1 means "do not lock the process into memory".
2869289997Sglebius0 means "lock whatever memory the process wants into memory".
2870275970Scy.It Cm stacksize Ar N4kPages
2871275970ScySpecifies the maximum size of the process stack on systems with the
2872275970Scy.Fn mlockall
2873275970Scyfunction.
2874275970ScyDefaults to 50 4k pages (200 4k pages in OpenBSD).
2875285612Sdelphij.It Cm filenum Ar Nfiledescriptors
2876298770SdelphijSpecifies the maximum number of file descriptors ntpd may have open at once.
2877298770SdelphijDefaults to the system default.
2878275970Scy.El
2879275970Scy.It Xo Ic trap Ar host_address
2880275970Scy.Op Cm port Ar port_number
2881275970Scy.Op Cm interface Ar interface_address
2882275970Scy.Xc
2883275970ScyThis command configures a trap receiver at the given host
2884275970Scyaddress and port number for sending messages with the specified
2885275970Scylocal interface address.
2886275970ScyIf the port number is unspecified, a value
2887275970Scyof 18447 is used.
2888275970ScyIf the interface address is not specified, the
2889275970Scymessage is sent with a source address of the local interface the
2890275970Scymessage is sent through.
2891275970ScyNote that on a multihomed host the
2892275970Scyinterface used may vary from time to time with routing changes.
2893275970Scy.Pp
2894275970ScyThe trap receiver will generally log event messages and other
2895275970Scyinformation from the server in a log file.
2896275970ScyWhile such monitor
2897275970Scyprograms may also request their own trap dynamically, configuring a
2898275970Scytrap receiver will ensure that no messages are lost when the server
2899275970Scyis started.
2900275970Scy.It Cm hop Ar ...
2901275970ScyThis command specifies a list of TTL values in increasing order, up to 8
2902275970Scyvalues can be specified.
2903275970ScyIn manycast mode these values are used in turn in
2904275970Scyan expanding\-ring search.
2905275970ScyThe default is eight multiples of 32 starting at
2906275970Scy31.
2907275970Scy.El
2908275970Scy.Sh "OPTIONS"
2909275970Scy.Bl -tag
2910275970Scy.It Fl \-help
2911275970ScyDisplay usage information and exit.
2912275970Scy.It Fl \-more\-help
2913275970ScyPass the extended usage information through a pager.
2914275970Scy.It Fl \-version Op Brq Ar v|c|n
2915275970ScyOutput version of program and exit.  The default mode is `v', a simple
2916275970Scyversion.  The `c' mode will print copyright information and `n' will
2917275970Scyprint the full copyright notice.
2918275970Scy.El
2919275970Scy.Sh "OPTION PRESETS"
2920275970ScyAny option that is not marked as \fInot presettable\fP may be preset
2921275970Scyby loading values from environment variables named:
2922275970Scy.nf
2923275970Scy  \fBNTP_CONF_<option\-name>\fP or \fBNTP_CONF\fP
2924275970Scy.fi
2925275970Scy.ad
2926275970Scy.Sh "ENVIRONMENT"
2927275970ScySee \fBOPTION PRESETS\fP for configuration environment variables.
2928275970Scy.Sh FILES
2929275970Scy.Bl -tag -width /etc/ntp.drift -compact
2930275970Scy.It Pa /etc/ntp.conf
2931275970Scythe default name of the configuration file
2932275970Scy.It Pa ntp.keys
2933275970Scyprivate MD5 keys
2934275970Scy.It Pa ntpkey
2935275970ScyRSA private key
2936275970Scy.It Pa ntpkey_ Ns Ar host
2937275970ScyRSA public key
2938275970Scy.It Pa ntp_dh
2939275970ScyDiffie\-Hellman agreement parameters
2940275970Scy.El
2941275970Scy.Sh "EXIT STATUS"
2942275970ScyOne of the following exit values will be returned:
2943275970Scy.Bl -tag
2944275970Scy.It 0 " (EXIT_SUCCESS)"
2945275970ScySuccessful program execution.
2946275970Scy.It 1 " (EXIT_FAILURE)"
2947275970ScyThe operation failed or the command syntax was not valid.
2948275970Scy.It 70 " (EX_SOFTWARE)"
2949275970Scylibopts had an internal operational error.  Please report
2950275970Scyit to autogen\-users@lists.sourceforge.net.  Thank you.
2951275970Scy.El
2952275970Scy.Sh "SEE ALSO"
2953275970Scy.Xr ntpd @NTPD_MS@ ,
2954275970Scy.Xr ntpdc @NTPDC_MS@ ,
2955275970Scy.Xr ntpq @NTPQ_MS@
2956275970Scy.Pp
2957275970ScyIn addition to the manual pages provided,
2958275970Scycomprehensive documentation is available on the world wide web
2959275970Scyat
2960275970Scy.Li http://www.ntp.org/ .
2961275970ScyA snapshot of this documentation is available in HTML format in
2962275970Scy.Pa /usr/share/doc/ntp .
2963275970Scy.Rs
2964275970Scy.%A David L. Mills
2965275970Scy.%T Network Time Protocol (Version 4)
2966275970Scy.%O RFC5905
2967275970Scy.Re
2968275970Scy.Sh "AUTHORS"
2969280849ScyThe University of Delaware and Network Time Foundation
2970275970Scy.Sh "COPYRIGHT"
2971294569SdelphijCopyright (C) 1992\-2016 The University of Delaware and Network Time Foundation all rights reserved.
2972275970ScyThis program is released under the terms of the NTP license, <http://ntp.org/license>.
2973275970Scy.Sh BUGS
2974275970ScyThe syntax checking is not picky; some combinations of
2975275970Scyridiculous and even hilarious options and modes may not be
2976275970Scydetected.
2977275970Scy.Pp
2978275970ScyThe
2979275970Scy.Pa ntpkey_ Ns Ar host
2980275970Scyfiles are really digital
2981275970Scycertificates.
2982275970ScyThese should be obtained via secure directory
2983275970Scyservices when they become universally available.
2984275970Scy.Pp
2985275970ScyPlease send bug reports to: http://bugs.ntp.org, bugs@ntp.org
2986275970Scy.Sh NOTES
2987275970ScyThis document was derived from FreeBSD.
2988275970Scy.Pp
2989275970ScyThis manual page was \fIAutoGen\fP\-erated from the \fBntp.conf\fP
2990275970Scyoption definitions.
2991