1ntp.conf(5) File Formats ntp.conf(5)
2
3
4
6 ntp.conf - Network Time Protocol (NTP) daemon configuration file format
7
9 ntp.conf [--option-name] [--option-name value]
10
11 All arguments must be options.
12
13
15 The ntp.conf configuration file is read at initial startup by the
16 ntpd(8) daemon in order to specify the synchronization sources, modes
17 and other related information. Usually, it is installed in the /etc
18 directory, but could be installed elsewhere (see the daemon's -c com‐
19 mand line option).
20
21 The file format is similar to other UNIX configuration files. Comments
22 begin with a ‘#’ character and extend to the end of the line; blank
23 lines are ignored. Configuration commands consist of an initial key‐
24 word followed by a list of arguments, some of which may be optional,
25 separated by whitespace. Commands may not be continued over multiple
26 lines. Arguments may be host names, host addresses written in numeric,
27 dotted-quad form, integers, floating point numbers (when specifying
28 times in seconds) and text strings.
29
30 The rest of this page describes the configuration and control options.
31 The "Notes on Configuring NTP and Setting up an NTP Subnet" page
32 (available as part of the HTML documentation provided in
33 /usr/share/doc/ntp) contains an extended discussion of these options.
34 In addition to the discussion of general Configuration Options, there
35 are sections describing the following supported functionality and the
36 options used to control it:
37
38 · Authentication Support
39
40 · Monitoring Support
41
42 · Access Control Support
43
44 · Automatic NTP Configuration Options
45
46 · Reference Clock Support
47
48 · Miscellaneous Options
49
50 Following these is a section describing Miscellaneous Options. While
51 there is a rich set of options available, the only required option is
52 one or more pool, server, peer, broadcast or manycastclient commands.
53
55 Following is a description of the configuration commands in NTPv4.
56 These commands have the same basic functions as in NTPv3 and in some
57 cases new functions and new arguments. There are two classes of com‐
58 mands, configuration commands that configure a persistent association
59 with a remote server or peer or reference clock, and auxiliary commands
60 that specify environmental variables that control various related oper‐
61 ations.
62
63 Configuration Commands
64 The various modes are determined by the command keyword and the type of
65 the required IP address. Addresses are classed by type as (s) a remote
66 server or peer (IPv4 class A, B and C), (b) the broadcast address of a
67 local interface, (m) a multicast address (IPv4 class D), or (r) a ref‐
68 erence clock address (127.127.x.x). Note that only those options
69 applicable to each command are listed below. Use of options not listed
70 may not be caught as an error, but may result in some weird and even
71 destructive behavior.
72
73 If the Basic Socket Interface Extensions for IPv6 (RFC-2553) is
74 detected, support for the IPv6 address family is generated in addition
75 to the default support of the IPv4 address family. In a few cases,
76 including the reslist billboard generated by ntpq(8) or ntpdc(8), IPv6
77 addresses are automatically generated. IPv6 addresses can be identi‐
78 fied by the presence of colons : in the address field. IPv6 addresses
79 can be used almost everywhere where IPv4 addresses can be used, with
80 the exception of reference clock addresses, which are always IPv4.
81
82 Note that in contexts where a host name is expected, a -4 qualifier
83 preceding the host name forces DNS resolution to the IPv4 namespace,
84 while a -6 qualifier forces DNS resolution to the IPv6 namespace. See
85 IPv6 references for the equivalent classes for that address family.
86
87 pool address [burst] [iburst] [version version] [prefer] [minpoll min‐
88 poll] [maxpoll maxpoll] [xmtnonce]
89
90 server address [key key | autokey] [burst] [iburst] [version version]
91 [prefer] [minpoll minpoll] [maxpoll maxpoll] [true] [xmtnonce]
92
93 peer address [key key | autokey] [version version] [prefer] [minpoll
94 minpoll] [maxpoll maxpoll] [true] [xleave]
95
96 broadcast address [key key | autokey] [version version] [prefer] [min‐
97 poll minpoll] [ttl ttl] [xleave]
98
99 manycastclient address [key key | autokey] [version version] [prefer]
100 [minpoll minpoll] [maxpoll maxpoll] [ttl ttl]
101
102 These five commands specify the time server name or address to be used
103 and the mode in which to operate. The address can be either a DNS name
104 or an IP address in dotted-quad notation. Additional information on
105 association behavior can be found in the "Association Management" page
106 (available as part of the HTML documentation provided in
107 /usr/share/doc/ntp).
108
109 pool For type s addresses, this command mobilizes a persistent client
110 mode association with a number of remote servers. In this mode
111 the local clock can synchronized to the remote server, but the
112 remote server can never be synchronized to the local clock.
113
114 server For type s and r addresses, this command mobilizes a persistent
115 client mode association with the specified remote server or
116 local radio clock. In this mode the local clock can synchro‐
117 nized to the remote server, but the remote server can never be
118 synchronized to the local clock. This command should not be
119 used for type b or m addresses.
120
121 peer For type s addresses (only), this command mobilizes a persistent
122 symmetric-active mode association with the specified remote
123 peer. In this mode the local clock can be synchronized to the
124 remote peer or the remote peer can be synchronized to the local
125 clock. This is useful in a network of servers where, depending
126 on various failure scenarios, either the local or remote peer
127 may be the better source of time. This command should NOT be
128 used for type b, m or r addresses.
129
130 broadcast
131 For type b and m addresses (only), this command mobilizes a per‐
132 sistent broadcast mode association. Multiple commands can be
133 used to specify multiple local broadcast interfaces (subnets)
134 and/or multiple multicast groups. Note that local broadcast
135 messages go only to the interface associated with the subnet
136 specified, but multicast messages go to all interfaces. In
137 broadcast mode the local server sends periodic broadcast mes‐
138 sages to a client population at the address specified, which is
139 usually the broadcast address on (one of) the local network(s)
140 or a multicast address assigned to NTP. The IANA has assigned
141 the multicast group address IPv4 224.0.1.1 and IPv6 ff05::101
142 (site local) exclusively to NTP, but other nonconflicting
143 addresses can be used to contain the messages within administra‐
144 tive boundaries. Ordinarily, this specification applies only to
145 the local server operating as a sender; for operation as a
146 broadcast client, see the broadcastclient or multicastclient
147 commands below.
148
149 manycastclient
150 For type m addresses (only), this command mobilizes a manycast
151 client mode association for the multicast address specified. In
152 this case a specific address must be supplied which matches the
153 address used on the manycastserver command for the designated
154 manycast servers. The NTP multicast address 224.0.1.1 assigned
155 by the IANA should NOT be used, unless specific means are taken
156 to avoid spraying large areas of the Internet with these mes‐
157 sages and causing a possibly massive implosion of replies at the
158 sender. The manycastserver command specifies that the local
159 server is to operate in client mode with the remote servers that
160 are discovered as the result of broadcast/multicast messages.
161 The client broadcasts a request message to the group address
162 associated with the specified address and specifically enabled
163 servers respond to these messages. The client selects the
164 servers providing the best time and continues as with the server
165 command. The remaining servers are discarded as if never heard.
166
167 Options:
168
169 autokey
170 All packets sent to and received from the server or peer are to
171 include authentication fields encrypted using the autokey scheme
172 described in Authentication Options.
173
174 burst when the server is reachable, send a burst of eight packets
175 instead of the usual one. The packet spacing is normally 2 s;
176 however, the spacing between the first and second packets can be
177 changed with the calldelay command to allow additional time for
178 a modem or ISDN call to complete. This is designed to improve
179 timekeeping quality with the server command and s addresses.
180
181 iburst When the server is unreachable, send a burst of eight packets
182 instead of the usual one. The packet spacing is normally 2 s;
183 however, the spacing between the first two packets can be
184 changed with the calldelay command to allow additional time for
185 a modem or ISDN call to complete. This is designed to speed the
186 initial synchronization acquisition with the server command and
187 s addresses and when ntpd(8) is started with the -q option.
188
189 key key
190 All packets sent to and received from the server or peer are to
191 include authentication fields encrypted using the specified key
192 identifier with values from 1 to 65535, inclusive. The default
193 is to include no encryption field.
194
195 minpoll minpoll
196
197 maxpoll maxpoll
198 These options specify the minimum and maximum poll intervals for
199 NTP messages, as a power of 2 in seconds The maximum poll inter‐
200 val defaults to 10 (1,024 s), but can be increased by the max‐
201 poll option to an upper limit of 17 (36.4 h). The minimum poll
202 interval defaults to 6 (64 s), but can be decreased by the min‐
203 poll option to a lower limit of 4 (16 s).
204
205 noselect
206 Marks the server as unused, except for display purposes. The
207 server is discarded by the selection algroithm.
208
209 preempt
210 Says the association can be preempted.
211
212 prefer Marks the server as preferred. All other things being equal,
213 this host will be chosen for synchronization among a set of cor‐
214 rectly operating hosts. See the "Mitigation Rules and the pre‐
215 fer Keyword" page (available as part of the HTML documentation
216 provided in /usr/share/doc/ntp) for further information.
217
218 true Marks the server as a truechimer, forcing the association to
219 always survive the selection and clustering algorithms. This
220 option should almost certainly only be used while testing an
221 association.
222
223 ttl ttl
224 This option is used only with broadcast server and manycast
225 client modes. It specifies the time-to-live ttl to use on
226 broadcast server and multicast server and the maximum ttl for
227 the expanding ring search with manycast client packets. Selec‐
228 tion of the proper value, which defaults to 127, is something of
229 a black art and should be coordinated with the network adminis‐
230 trator.
231
232 version version
233 Specifies the version number to be used for outgoing NTP pack‐
234 ets. Versions 1-4 are the choices, with version 4 the default.
235
236 xleave Valid in peer and broadcast modes only, this flag enables inter‐
237 leave mode.
238
239 xmtnonce
240 Valid only for server and pool modes, this flag puts a random
241 number in the packet's transmit timestamp.
242
243 Auxiliary Commands
244 broadcastclient
245 This command enables reception of broadcast server messages to
246 any local interface (type b) address. Upon receiving a message
247 for the first time, the broadcast client measures the nominal
248 server propagation delay using a brief client/server exchange
249 with the server, then enters the broadcast client mode, in which
250 it synchronizes to succeeding broadcast messages. Note that, in
251 order to avoid accidental or malicious disruption in this mode,
252 both the server and client should operate using symmetric-key or
253 public-key authentication as described in Authentication
254 Options.
255
256 manycastserver address ...
257 This command enables reception of manycast client messages to
258 the multicast group address(es) (type m) specified. At least
259 one address is required, but the NTP multicast address 224.0.1.1
260 assigned by the IANA should NOT be used, unless specific means
261 are taken to limit the span of the reply and avoid a possibly
262 massive implosion at the original sender. Note that, in order
263 to avoid accidental or malicious disruption in this mode, both
264 the server and client should operate using symmetric-key or pub‐
265 lic-key authentication as described in Authentication Options.
266
267 multicastclient address ...
268 This command enables reception of multicast server messages to
269 the multicast group address(es) (type m) specified. Upon
270 receiving a message for the first time, the multicast client
271 measures the nominal server propagation delay using a brief
272 client/server exchange with the server, then enters the broad‐
273 cast client mode, in which it synchronizes to succeeding multi‐
274 cast messages. Note that, in order to avoid accidental or mali‐
275 cious disruption in this mode, both the server and client should
276 operate using symmetric-key or public-key authentication as
277 described in Authentication Options.
278
279 mdnstries number
280 If we are participating in mDNS, after we have synched for the
281 first time we attempt to register with the mDNS system. If that
282 registration attempt fails, we try again at one minute intervals
283 for up to mdnstries times. After all, ntpd may be starting
284 before mDNS. The default value for mdnstries is 5.
285
287 Authentication support allows the NTP client to verify that the server
288 is in fact known and trusted and not an intruder intending accidentally
289 or on purpose to masquerade as that server. The NTPv3 specification
290 RFC-1305 defines a scheme which provides cryptographic authentication
291 of received NTP packets. Originally, this was done using the Data
292 Encryption Standard (DES) algorithm operating in Cipher Block Chaining
293 (CBC) mode, commonly called DES-CBC. Subsequently, this was replaced
294 by the RSA Message Digest 5 (MD5) algorithm using a private key, com‐
295 monly called keyed-MD5. Either algorithm computes a message digest, or
296 one-way hash, which can be used to verify the server has the correct
297 private key and key identifier.
298
299 NTPv4 retains the NTPv3 scheme, properly described as symmetric key
300 cryptography and, in addition, provides a new Autokey scheme based on
301 public key cryptography. Public key cryptography is generally consid‐
302 ered more secure than symmetric key cryptography, since the security is
303 based on a private value which is generated by each server and never
304 revealed. With Autokey all key distribution and management functions
305 involve only public values, which considerably simplifies key distribu‐
306 tion and storage. Public key management is based on X.509 certifi‐
307 cates, which can be provided by commercial services or produced by
308 utility programs in the OpenSSL software library or the NTPv4 distribu‐
309 tion.
310
311 While the algorithms for symmetric key cryptography are included in the
312 NTPv4 distribution, public key cryptography requires the OpenSSL soft‐
313 ware library to be installed before building the NTP distribution.
314 Directions for doing that are on the Building and Installing the Dis‐
315 tribution page.
316
317 Authentication is configured separately for each association using the
318 key or autokey subcommand on the peer, server, broadcast and manycast‐
319 client configuration commands as described in Configuration Options
320 page. The authentication options described below specify the locations
321 of the key files, if other than default, which symmetric keys are
322 trusted and the interval between various operations, if other than
323 default.
324
325 Authentication is always enabled, although ineffective if not config‐
326 ured as described below. If a NTP packet arrives including a message
327 authentication code (MAC), it is accepted only if it passes all crypto‐
328 graphic checks. The checks require correct key ID, key value and mes‐
329 sage digest. If the packet has been modified in any way or replayed by
330 an intruder, it will fail one or more of these checks and be discarded.
331 Furthermore, the Autokey scheme requires a preliminary protocol
332 exchange to obtain the server certificate, verify its credentials and
333 initialize the protocol
334
335 The auth flag controls whether new associations or remote configuration
336 commands require cryptographic authentication. This flag can be set or
337 reset by the enable and disable commands and also by remote configura‐
338 tion commands sent by a ntpdc(8) program running on another machine.
339 If this flag is enabled, which is the default case, new broadcast
340 client and symmetric passive associations and remote configuration com‐
341 mands must be cryptographically authenticated using either symmetric
342 key or public key cryptography. If this flag is disabled, these opera‐
343 tions are effective even if not cryptographic authenticated. It should
344 be understood that operating with the auth flag disabled invites a sig‐
345 nificant vulnerability where a rogue hacker can masquerade as a falset‐
346 icker and seriously disrupt system timekeeping. It is important to
347 note that this flag has no purpose other than to allow or disallow a
348 new association in response to new broadcast and symmetric active mes‐
349 sages and remote configuration commands and, in particular, the flag
350 has no effect on the authentication process itself.
351
352 An attractive alternative where multicast support is available is many‐
353 cast mode, in which clients periodically troll for servers as described
354 in the Automatic NTP Configuration Options page. Either symmetric key
355 or public key cryptographic authentication can be used in this mode.
356 The principle advantage of manycast mode is that potential servers need
357 not be configured in advance, since the client finds them during regu‐
358 lar operation, and the configuration files for all clients can be iden‐
359 tical.
360
361 The security model and protocol schemes for both symmetric key and pub‐
362 lic key cryptography are summarized below; further details are in the
363 briefings, papers and reports at the NTP project page linked from
364 http://www.ntp.org/.
365
366 Symmetric-Key Cryptography
367 The original RFC-1305 specification allows any one of possibly 65,535
368 keys, each distinguished by a 32-bit key identifier, to authenticate an
369 association. The servers and clients involved must agree on the key
370 and key identifier to authenticate NTP packets. Keys and related
371 information are specified in a key file, usually called ntp.keys, which
372 must be distributed and stored using secure means beyond the scope of
373 the NTP protocol itself. Besides the keys used for ordinary NTP asso‐
374 ciations, additional keys can be used as passwords for the ntpq(8) and
375 ntpdc(8) utility programs.
376
377 When ntpd(8) is first started, it reads the key file specified in the
378 keys configuration command and installs the keys in the key cache.
379 However, individual keys must be activated with the trusted command
380 before use. This allows, for instance, the installation of possibly
381 several batches of keys and then activating or deactivating each batch
382 remotely using ntpdc(8). This also provides a revocation capability
383 that can be used if a key becomes compromised. The requestkey command
384 selects the key used as the password for the ntpdc(8) utility, while
385 the controlkey command selects the key used as the password for the
386 ntpq(8) utility.
387
388 Public Key Cryptography
389 NTPv4 supports the original NTPv3 symmetric key scheme described in
390 RFC-1305 and in addition the Autokey protocol, which is based on public
391 key cryptography. The Autokey Version 2 protocol described on the
392 Autokey Protocol page verifies packet integrity using MD5 message
393 digests and verifies the source with digital signatures and any of sev‐
394 eral digest/signature schemes. Optional identity schemes described on
395 the Identity Schemes page and based on cryptographic challenge/response
396 algorithms are also available. Using all of these schemes provides
397 strong security against replay with or without modification, spoofing,
398 masquerade and most forms of clogging attacks.
399
400 The Autokey protocol has several modes of operation corresponding to
401 the various NTP modes supported. Most modes use a special cookie which
402 can be computed independently by the client and server, but encrypted
403 in transmission. All modes use in addition a variant of the S-KEY
404 scheme, in which a pseudo-random key list is generated and used in
405 reverse order. These schemes are described along with an executive
406 summary, current status, briefing slides and reading list on the Auton‐
407 omous Authentication page.
408
409 The specific cryptographic environment used by Autokey servers and
410 clients is determined by a set of files and soft links generated by the
411 ntp-keygen(1ntpkeygenmdoc) program. This includes a required host key
412 file, required certificate file and optional sign key file, leapsecond
413 file and identity scheme files. The digest/signature scheme is speci‐
414 fied in the X.509 certificate along with the matching sign key. There
415 are several schemes available in the OpenSSL software library, each
416 identified by a specific string such as md5WithRSAEncryption, which
417 stands for the MD5 message digest with RSA encryption scheme. The cur‐
418 rent NTP distribution supports all the schemes in the OpenSSL library,
419 including those based on RSA and DSA digital signatures.
420
421 NTP secure groups can be used to define cryptographic compartments and
422 security hierarchies. It is important that every host in the group be
423 able to construct a certificate trail to one or more trusted hosts in
424 the same group. Each group host runs the Autokey protocol to obtain
425 the certificates for all hosts along the trail to one or more trusted
426 hosts. This requires the configuration file in all hosts to be engi‐
427 neered so that, even under anticipated failure conditions, the NTP sub‐
428 net will form such that every group host can find a trail to at least
429 one trusted host.
430
431 Naming and Addressing
432 It is important to note that Autokey does not use DNS to resolve
433 addresses, since DNS can't be completely trusted until the name servers
434 have synchronized clocks. The cryptographic name used by Autokey to
435 bind the host identity credentials and cryptographic values must be
436 independent of interface, network and any other naming convention. The
437 name appears in the host certificate in either or both the subject and
438 issuer fields, so protection against DNS compromise is essential.
439
440 By convention, the name of an Autokey host is the name returned by the
441 Unix gethostname(2) system call or equivalent in other systems. By the
442 system design model, there are no provisions to allow alternate names
443 or aliases. However, this is not to say that DNS aliases, different
444 names for each interface, etc., are constrained in any way.
445
446 It is also important to note that Autokey verifies authenticity using
447 the host name, network address and public keys, all of which are bound
448 together by the protocol specifically to deflect masquerade attacks.
449 For this reason Autokey includes the source and destination IP
450 addresses in message digest computations and so the same addresses must
451 be available at both the server and client. For this reason operation
452 with network address translation schemes is not possible. This
453 reflects the intended robust security model where government and corpo‐
454 rate NTP servers are operated outside firewall perimeters.
455
456 Operation
457 A specific combination of authentication scheme (none, symmetric key,
458 public key) and identity scheme is called a cryptotype, although not
459 all combinations are compatible. There may be management configura‐
460 tions where the clients, servers and peers may not all support the same
461 cryptotypes. A secure NTPv4 subnet can be configured in many ways
462 while keeping in mind the principles explained above and in this sec‐
463 tion. Note however that some cryptotype combinations may successfully
464 interoperate with each other, but may not represent good security prac‐
465 tice.
466
467 The cryptotype of an association is determined at the time of mobiliza‐
468 tion, either at configuration time or some time later when a message of
469 appropriate cryptotype arrives. When mobilized by a server or peer
470 configuration command and no key or autokey subcommands are present,
471 the association is not authenticated; if the key subcommand is present,
472 the association is authenticated using the symmetric key ID specified;
473 if the autokey subcommand is present, the association is authenticated
474 using Autokey.
475
476 When multiple identity schemes are supported in the Autokey protocol,
477 the first message exchange determines which one is used. The client
478 request message contains bits corresponding to which schemes it has
479 available. The server response message contains bits corresponding to
480 which schemes it has available. Both server and client match the
481 received bits with their own and select a common scheme.
482
483 Following the principle that time is a public value, a server responds
484 to any client packet that matches its cryptotype capabilities. Thus, a
485 server receiving an unauthenticated packet will respond with an unau‐
486 thenticated packet, while the same server receiving a packet of a cryp‐
487 totype it supports will respond with packets of that cryptotype. How‐
488 ever, unconfigured broadcast or manycast client associations or symmet‐
489 ric passive associations will not be mobilized unless the server sup‐
490 ports a cryptotype compatible with the first packet received. By
491 default, unauthenticated associations will not be mobilized unless
492 overridden in a decidedly dangerous way.
493
494 Some examples may help to reduce confusion. Client Alice has no spe‐
495 cific cryptotype selected. Server Bob has both a symmetric key file
496 and minimal Autokey files. Alice's unauthenticated messages arrive at
497 Bob, who replies with unauthenticated messages. Cathy has a copy of
498 Bob's symmetric key file and has selected key ID 4 in messages to Bob.
499 Bob verifies the message with his key ID 4. If it's the same key and
500 the message is verified, Bob sends Cathy a reply authenticated with
501 that key. If verification fails, Bob sends Cathy a thing called a
502 crypto-NAK, which tells her something broke. She can see the evidence
503 using the ntpq(8) program.
504
505 Denise has rolled her own host key and certificate. She also uses one
506 of the identity schemes as Bob. She sends the first Autokey message to
507 Bob and they both dance the protocol authentication and identity steps.
508 If all comes out okay, Denise and Bob continue as described above.
509
510 It should be clear from the above that Bob can support all the girls at
511 the same time, as long as he has compatible authentication and identity
512 credentials. Now, Bob can act just like the girls in his own choice of
513 servers; he can run multiple configured associations with multiple dif‐
514 ferent servers (or the same server, although that might not be useful).
515 But, wise security policy might preclude some cryptotype combinations;
516 for instance, running an identity scheme with one server and no authen‐
517 tication with another might not be wise.
518
519 Key Management
520 The cryptographic values used by the Autokey protocol are incorporated
521 as a set of files generated by the ntp-keygen(1ntpkeygenmdoc) utility
522 program, including symmetric key, host key and public certificate
523 files, as well as sign key, identity parameters and leapseconds files.
524 Alternatively, host and sign keys and certificate files can be gener‐
525 ated by the OpenSSL utilities and certificates can be imported from
526 public certificate authorities. Note that symmetric keys are necessary
527 for the ntpq(8) and ntpdc(8) utility programs. The remaining files are
528 necessary only for the Autokey protocol.
529
530 Certificates imported from OpenSSL or public certificate authorities
531 have certian limitations. The certificate should be in ASN.1 syntax,
532 X.509 Version 3 format and encoded in PEM, which is the same format
533 used by OpenSSL. The overall length of the certificate encoded in
534 ASN.1 must not exceed 1024 bytes. The subject distinguished name field
535 (CN) is the fully qualified name of the host on which it is used; the
536 remaining subject fields are ignored. The certificate extension fields
537 must not contain either a subject key identifier or a issuer key iden‐
538 tifier field; however, an extended key usage field for a trusted host
539 must contain the value trustRoot;. Other extension fields are ignored.
540
541 Authentication Commands
542 autokey [logsec]
543 Specifies the interval between regenerations of the session key
544 list used with the Autokey protocol. Note that the size of the
545 key list for each association depends on this interval and the
546 current poll interval. The default value is 12 (4096 s or about
547 1.1 hours). For poll intervals above the specified interval, a
548 session key list with a single entry will be regenerated for
549 every message sent.
550
551 controlkey key
552 Specifies the key identifier to use with the ntpq(8) utility,
553 which uses the standard protocol defined in RFC-1305. The key
554 argument is the key identifier for a trusted key, where the
555 value can be in the range 1 to 65,535, inclusive.
556
557 crypto [cert file] [leap file] [randfile file] [host file] [sign file]
558 [gq file] [gqpar file] [iffpar file] [mvpar file] [pw password]
559 This command requires the OpenSSL library. It activates public
560 key cryptography, selects the message digest and signature
561 encryption scheme and loads the required private and public val‐
562 ues described above. If one or more files are left unspecified,
563 the default names are used as described above. Unless the com‐
564 plete path and name of the file are specified, the location of a
565 file is relative to the keys directory specified in the keysdir
566 command or default /usr/local/etc. Following are the subcom‐
567 mands:
568
569 cert file
570 Specifies the location of the required host public cer‐
571 tificate file. This overrides the link ntpkey_cert_host‐
572 name in the keys directory.
573
574 gqpar file
575 Specifies the location of the optional GQ parameters
576 file. This overrides the link ntpkey_gq_hostname in the
577 keys directory.
578
579 host file
580 Specifies the location of the required host key file.
581 This overrides the link ntpkey_key_hostname in the keys
582 directory.
583
584 iffpar file
585 Specifies the location of the optional IFF parameters
586 file. This overrides the link ntpkey_iff_hostname in the
587 keys directory.
588
589 leap file
590 Specifies the location of the optional leapsecond file.
591 This overrides the link ntpkey_leap in the keys direc‐
592 tory.
593
594 mvpar file
595 Specifies the location of the optional MV parameters
596 file. This overrides the link ntpkey_mv_hostname in the
597 keys directory.
598
599 pw password
600 Specifies the password to decrypt files containing pri‐
601 vate keys and identity parameters. This is required only
602 if these files have been encrypted.
603
604 randfile file
605 Specifies the location of the random seed file used by
606 the OpenSSL library. The defaults are described in the
607 main text above.
608
609 sign file
610 Specifies the location of the optional sign key file.
611 This overrides the link ntpkey_sign_hostname in the keys
612 directory. If this file is not found, the host key is
613 also the sign key.
614
615 keys keyfile
616 Specifies the complete path and location of the MD5 key file
617 containing the keys and key identifiers used by ntpd(8), ntpq(8)
618 and ntpdc(8) when operating with symmetric key cryptography.
619 This is the same operation as the -k command line option.
620
621 keysdir path
622 This command specifies the default directory path for crypto‐
623 graphic keys, parameters and certificates. The default is
624 /usr/local/etc/.
625
626 requestkey key
627 Specifies the key identifier to use with the ntpdc(8) utility
628 program, which uses a proprietary protocol specific to this
629 implementation of ntpd(8). The key argument is a key identifier
630 for the trusted key, where the value can be in the range 1 to
631 65,535, inclusive.
632
633 revoke logsec
634 Specifies the interval between re-randomization of certain cryp‐
635 tographic values used by the Autokey scheme, as a power of 2 in
636 seconds. These values need to be updated frequently in order to
637 deflect brute-force attacks on the algorithms of the scheme;
638 however, updating some values is a relatively expensive opera‐
639 tion. The default interval is 16 (65,536 s or about 18 hours).
640 For poll intervals above the specified interval, the values will
641 be updated for every message sent.
642
643 trustedkey key ...
644 Specifies the key identifiers which are trusted for the purposes
645 of authenticating peers with symmetric key cryptography, as well
646 as keys used by the ntpq(8) and ntpdc(8) programs. The authen‐
647 tication procedures require that both the local and remote
648 servers share the same key and key identifier for this purpose,
649 although different keys can be used with different servers. The
650 key arguments are 32-bit unsigned integers with values from 1 to
651 65,535.
652
653 Error Codes
654 The following error codes are reported via the NTP control and monitor‐
655 ing protocol trap mechanism.
656
657 101 (bad field format or length) The packet has invalid version,
658 length or format.
659
660 102 (bad timestamp) The packet timestamp is the same or older than
661 the most recent received. This could be due to a replay or a
662 server clock time step.
663
664 103 (bad filestamp) The packet filestamp is the same or older than
665 the most recent received. This could be due to a replay or a
666 key file generation error.
667
668 104 (bad or missing public key) The public key is missing, has
669 incorrect format or is an unsupported type.
670
671 105 (unsupported digest type) The server requires an unsupported
672 digest/signature scheme.
673
674 106 (mismatched digest types) Not used.
675
676 107 (bad signature length) The signature length does not match the
677 current public key.
678
679 108 (signature not verified) The message fails the signature check.
680 It could be bogus or signed by a different private key.
681
682 109 (certificate not verified) The certificate is invalid or signed
683 with the wrong key.
684
685 110 (certificate not verified) The certificate is not yet valid or
686 has expired or the signature could not be verified.
687
688 111 (bad or missing cookie) The cookie is missing, corrupted or
689 bogus.
690
691 112 (bad or missing leapseconds table) The leapseconds table is
692 missing, corrupted or bogus.
693
694 113 (bad or missing certificate) The certificate is missing, cor‐
695 rupted or bogus.
696
697 114 (bad or missing identity) The identity key is missing, corrupt
698 or bogus.
699
701 ntpd(8) includes a comprehensive monitoring facility suitable for con‐
702 tinuous, long term recording of server and client timekeeping perfor‐
703 mance. See the statistics command below for a listing and example of
704 each type of statistics currently supported. Statistic files are man‐
705 aged using file generation sets and scripts in the ./scripts directory
706 of the source code distribution. Using these facilities and UNIX
707 cron(8) jobs, the data can be automatically summarized and archived for
708 retrospective analysis.
709
710 Monitoring Commands
711 statistics name ...
712 Enables writing of statistics records. Currently, eight kinds
713 of name statistics are supported.
714
715 clockstats
716 Enables recording of clock driver statistics information.
717 Each update received from a clock driver appends a line
718 of the following form to the file generation set named
719 clockstats:
720 49213 525.624 127.127.4.1 93 226 00:08:29.606 D
721
722 The first two fields show the date (Modified Julian Day)
723 and time (seconds and fraction past UTC midnight). The
724 next field shows the clock address in dotted-quad nota‐
725 tion. The final field shows the last timecode received
726 from the clock in decoded ASCII format, where meaningful.
727 In some clock drivers a good deal of additional informa‐
728 tion can be gathered and displayed as well. See informa‐
729 tion specific to each clock for further details.
730
731 cryptostats
732 This option requires the OpenSSL cryptographic software
733 library. It enables recording of cryptographic public
734 key protocol information. Each message received by the
735 protocol module appends a line of the following form to
736 the file generation set named cryptostats:
737 49213 525.624 127.127.4.1 message
738
739 The first two fields show the date (Modified Julian Day)
740 and time (seconds and fraction past UTC midnight). The
741 next field shows the peer address in dotted-quad nota‐
742 tion, The final message field includes the message type
743 and certain ancillary information. See the Authentica‐
744 tion Options section for further information.
745
746 loopstats
747 Enables recording of loop filter statistics information.
748 Each update of the local clock outputs a line of the fol‐
749 lowing form to the file generation set named loopstats:
750 50935 75440.031 0.000006019 13.778190 0.000351733 0.0133806
751
752 The first two fields show the date (Modified Julian Day)
753 and time (seconds and fraction past UTC midnight). The
754 next five fields show time offset (seconds), frequency
755 offset (parts per million - PPM), RMS jitter (seconds),
756 Allan deviation (PPM) and clock discipline time constant.
757
758 peerstats
759 Enables recording of peer statistics information. This
760 includes statistics records of all peers of a NTP server
761 and of special signals, where present and configured.
762 Each valid update appends a line of the following form to
763 the current element of a file generation set named peer‐
764 stats:
765 48773 10847.650 127.127.4.1 9714 -0.001605376 0.000000000 0.001424877 0.000958674
766
767 The first two fields show the date (Modified Julian Day)
768 and time (seconds and fraction past UTC midnight). The
769 next two fields show the peer address in dotted-quad
770 notation and status, respectively. The status field is
771 encoded in hex in the format described in Appendix A of
772 the NTP specification RFC 1305. The final four fields
773 show the offset, delay, dispersion and RMS jitter, all in
774 seconds.
775
776 rawstats
777 Enables recording of raw-timestamp statistics informa‐
778 tion. This includes statistics records of all peers of a
779 NTP server and of special signals, where present and con‐
780 figured. Each NTP message received from a peer or clock
781 driver appends a line of the following form to the file
782 generation set named rawstats:
783 50928 2132.543 128.4.1.1 128.4.1.20 3102453281.584327000 3102453281.58622800031 02453332.540806000 3102453332.541458000
784
785 The first two fields show the date (Modified Julian Day)
786 and time (seconds and fraction past UTC midnight). The
787 next two fields show the remote peer or clock address
788 followed by the local address in dotted-quad notation.
789 The final four fields show the originate, receive, trans‐
790 mit and final NTP timestamps in order. The timestamp
791 values are as received and before processing by the vari‐
792 ous data smoothing and mitigation algorithms.
793
794 sysstats
795 Enables recording of ntpd statistics counters on a peri‐
796 odic basis. Each hour a line of the following form is
797 appended to the file generation set named sysstats:
798 50928 2132.543 36000 81965 0 9546 56 71793 512 540 10 147
799
800 The first two fields show the date (Modified Julian Day)
801 and time (seconds and fraction past UTC midnight). The
802 remaining ten fields show the statistics counter values
803 accumulated since the last generated line.
804
805 Time since restart 36000
806 Time in hours since the system was last rebooted.
807
808 Packets received 81965
809 Total number of packets received.
810
811 Packets processed 0
812 Number of packets received in response to previous
813 packets sent
814
815 Current version 9546
816 Number of packets matching the current NTP ver‐
817 sion.
818
819 Previous version 56
820 Number of packets matching the previous NTP ver‐
821 sion.
822
823 Bad version 71793
824 Number of packets matching neither NTP version.
825
826 Access denied 512
827 Number of packets denied access for any reason.
828
829 Bad length or format 540
830 Number of packets with invalid length, format or
831 port number.
832
833 Bad authentication 10
834 Number of packets not verified as authentic.
835
836 Rate exceeded 147
837 Number of packets discarded due to rate limita‐
838 tion.
839
840 statsdir directory_path
841 Indicates the full path of a directory where statistics
842 files should be created (see below). This keyword allows
843 the (otherwise constant) filegen filename prefix to be
844 modified for file generation sets, which is useful for
845 handling statistics logs.
846
847 filegen name [file filename] [type typename] [link | nolink]
848 [enable | disable]
849 Configures setting of generation file set name. Genera‐
850 tion file sets provide a means for handling files that
851 are continuously growing during the lifetime of a server.
852 Server statistics are a typical example for such files.
853 Generation file sets provide access to a set of files
854 used to store the actual data. At any time at most one
855 element of the set is being written to. The type given
856 specifies when and how data will be directed to a new
857 element of the set. This way, information stored in ele‐
858 ments of a file set that are currently unused are avail‐
859 able for administrational operations without the risk of
860 disturbing the operation of ntpd. (Most important: they
861 can be removed to free space for new data produced.)
862
863 Note that this command can be sent from the ntpdc(8) pro‐
864 gram running at a remote location.
865
866 name This is the type of the statistics records, as
867 shown in the statistics command.
868
869 file filename
870 This is the file name for the statistics records.
871 Filenames of set members are built from three con‐
872 catenated elements prefix, filename and suffix:
873
874 prefix This is a constant filename path. It is
875 not subject to modifications via the file‐
876 gen option. It is defined by the server,
877 usually specified as a compile-time con‐
878 stant. It may, however, be configurable
879 for individual file generation sets via
880 other commands. For example, the prefix
881 used with loopstats and peerstats genera‐
882 tion can be configured using the statsdir
883 option explained above.
884
885 filename
886 This string is directly concatenated to the
887 prefix mentioned above (no intervening
888 ‘/’). This can be modified using the file
889 argument to the filegen statement. No ..
890 elements are allowed in this component to
891 prevent filenames referring to parts out‐
892 side the filesystem hierarchy denoted by
893 prefix.
894
895 suffix This part is reflects individual elements
896 of a file set. It is generated according
897 to the type of a file set.
898
899 type typename
900 A file generation set is characterized by its
901 type. The following types are supported:
902
903 none The file set is actually a single plain
904 file.
905
906 pid One element of file set is used per incar‐
907 nation of a ntpd server. This type does
908 not perform any changes to file set members
909 during runtime, however it provides an easy
910 way of separating files belonging to dif‐
911 ferent ntpd(8) server incarnations. The
912 set member filename is built by appending a
913 ‘.’ to concatenated prefix and filename
914 strings, and appending the decimal repre‐
915 sentation of the process ID of the ntpd(8)
916 server process.
917
918 day One file generation set element is created
919 per day. A day is defined as the period
920 between 00:00 and 24:00 UTC. The file set
921 member suffix consists of a ‘.’ and a day
922 specification in the form YYYYMMdd. YYYY
923 is a 4-digit year number (e.g., 1992). MM
924 is a two digit month number. dd is a two
925 digit day number. Thus, all information
926 written at 10 December 1992 would end up in
927 a file named prefix filename.19921210.
928
929 week Any file set member contains data related
930 to a certain week of a year. The term week
931 is defined by computing day-of-year modulo
932 7. Elements of such a file generation set
933 are distinguished by appending the follow‐
934 ing suffix to the file set filename base: A
935 dot, a 4-digit year number, the letter W,
936 and a 2-digit week number. For example,
937 information from January, 10th 1992 would
938 end up in a file with suffix
939
940 month One generation file set element is gener‐
941 ated per month. The file name suffix con‐
942 sists of a dot, a 4-digit year number, and
943 a 2-digit month.
944
945 year One generation file element is generated
946 per year. The filename suffix consists of
947 a dot and a 4 digit year number.
948
949 age This type of file generation sets changes
950 to a new element of the file set every 24
951 hours of server operation. The filename
952 suffix consists of a dot, the letter a, and
953 an 8-digit number. This number is taken to
954 be the number of seconds the server is run‐
955 ning at the start of the corresponding
956 24-hour period. Information is only writ‐
957 ten to a file generation by specifying
958 enable; output is prevented by specifying
959 disable.
960
961 link | nolink
962 It is convenient to be able to access the current
963 element of a file generation set by a fixed name.
964 This feature is enabled by specifying link and
965 disabled using nolink. If link is specified, a
966 hard link from the current file set element to a
967 file without suffix is created. When there is
968 already a file with this name and the number of
969 links of this file is one, it is renamed appending
970 a dot, the letter C, and the pid of the ntpd(8)
971 server process. When the number of links is
972 greater than one, the file is unlinked. This
973 allows the current file to be accessed by a con‐
974 stant name.
975
976 enable | disable
977 Enables or disables the recording function.
978
980 The ntpd(8) daemon implements a general purpose address/mask based
981 restriction list. The list contains address/match entries sorted first
982 by increasing address values and and then by increasing mask values. A
983 match occurs when the bitwise AND of the mask and the packet source
984 address is equal to the bitwise AND of the mask and address in the
985 list. The list is searched in order with the last match found defining
986 the restriction flags associated with the entry. Additional informa‐
987 tion and examples can be found in the "Notes on Configuring NTP and
988 Setting up a NTP Subnet" page (available as part of the HTML documenta‐
989 tion provided in /usr/share/doc/ntp).
990
991 The restriction facility was implemented in conformance with the access
992 policies for the original NSFnet backbone time servers. Later the
993 facility was expanded to deflect cryptographic and clogging attacks.
994 While this facility may be useful for keeping unwanted or broken or
995 malicious clients from congesting innocent servers, it should not be
996 considered an alternative to the NTP authentication facilities. Source
997 address based restrictions are easily circumvented by a determined
998 cracker.
999
1000 Clients can be denied service because they are explicitly included in
1001 the restrict list created by the restrict command or implicitly as the
1002 result of cryptographic or rate limit violations. Cryptographic viola‐
1003 tions include certificate or identity verification failure; rate limit
1004 violations generally result from defective NTP implementations that
1005 send packets at abusive rates. Some violations cause denied service
1006 only for the offending packet, others cause denied service for a timed
1007 period and others cause the denied service for an indefinite period.
1008 When a client or network is denied access for an indefinite period, the
1009 only way at present to remove the restrictions is by restarting the
1010 server.
1011
1012 The Kiss-of-Death Packet
1013 Ordinarily, packets denied service are simply dropped with no further
1014 action except incrementing statistics counters. Sometimes a more
1015 proactive response is needed, such as a server message that explicitly
1016 requests the client to stop sending and leave a message for the system
1017 operator. A special packet format has been created for this purpose
1018 called the "kiss-of-death" (KoD) packet. KoD packets have the leap
1019 bits set unsynchronized and stratum set to zero and the reference iden‐
1020 tifier field set to a four-byte ASCII code. If the noserve or notrust
1021 flag of the matching restrict list entry is set, the code is "DENY"; if
1022 the limited flag is set and the rate limit is exceeded, the code is
1023 "RATE". Finally, if a cryptographic violation occurs, the code is
1024 "CRYP".
1025
1026 A client receiving a KoD performs a set of sanity checks to minimize
1027 security exposure, then updates the stratum and reference identifier
1028 peer variables, sets the access denied (TEST4) bit in the peer flash
1029 variable and sends a message to the log. As long as the TEST4 bit is
1030 set, the client will send no further packets to the server. The only
1031 way at present to recover from this condition is to restart the proto‐
1032 col at both the client and server. This happens automatically at the
1033 client when the association times out. It will happen at the server
1034 only if the server operator cooperates.
1035
1036 Access Control Commands
1037 discard [average avg] [minimum min] [monitor prob]
1038 Set the parameters of the limited facility which protects the
1039 server from client abuse. The average subcommand specifies the
1040 minimum average packet spacing, while the minimum subcommand
1041 specifies the minimum packet spacing. Packets that violate
1042 these minima are discarded and a kiss-o'-death packet returned
1043 if enabled. The default minimum average and minimum are 5 and
1044 2, respectively. The monitor subcommand specifies the probabil‐
1045 ity of discard for packets that overflow the rate-control win‐
1046 dow.
1047
1048 restrict address [mask mask] [ippeerlimit int] [flag ...]
1049 The address argument expressed in dotted-quad form is the
1050 address of a host or network. Alternatively, the address argu‐
1051 ment can be a valid host DNS name. The mask argument expressed
1052 in dotted-quad form defaults to 255.255.255.255, meaning that
1053 the address is treated as the address of an individual host. A
1054 default entry (address 0.0.0.0, mask 0.0.0.0) is always included
1055 and is always the first entry in the list. Note that text
1056 string default, with no mask option, may be used to indicate the
1057 default entry. The ippeerlimit directive limits the number of
1058 peer requests for each IP to int, where a value of -1 means
1059 "unlimited", the current default. A value of 0 means "none".
1060 There would usually be at most 1 peering request per IP, but if
1061 the remote peering requests are behind a proxy there could well
1062 be more than 1 per IP. In the current implementation, flag
1063 always restricts access, i.e., an entry with no flags indicates
1064 that free access to the server is to be given. The flags are
1065 not orthogonal, in that more restrictive flags will often make
1066 less restrictive ones redundant. The flags can generally be
1067 classed into two categories, those which restrict time service
1068 and those which restrict informational queries and attempts to
1069 do run-time reconfiguration of the server. One or more of the
1070 following flags may be specified:
1071
1072 ignore Deny packets of all kinds, including ntpq(8) and ntpdc(8)
1073 queries.
1074
1075 kod If this flag is set when an access violation occurs, a
1076 kiss-o'-death (KoD) packet is sent. KoD packets are rate
1077 limited to no more than one per second. If another KoD
1078 packet occurs within one second after the last one, the
1079 packet is dropped.
1080
1081 limited
1082 Deny service if the packet spacing violates the lower
1083 limits specified in the discard command. A history of
1084 clients is kept using the monitoring capability of
1085 ntpd(8). Thus, monitoring is always active as long as
1086 there is a restriction entry with the limited flag.
1087
1088 lowpriotrap
1089 Declare traps set by matching hosts to be low priority.
1090 The number of traps a server can maintain is limited (the
1091 current limit is 3). Traps are usually assigned on a
1092 first come, first served basis, with later trap
1093 requestors being denied service. This flag modifies the
1094 assignment algorithm by allowing low priority traps to be
1095 overridden by later requests for normal priority traps.
1096
1097 noepeer
1098 Deny ephemeral peer requests, even if they come from an
1099 authenticated source. Note that the ability to use a
1100 symmetric key for authentication may be restricted to one
1101 or more IPs or subnets via the third field of the
1102 ntp.keys file. This restriction is not enabled by
1103 default, to maintain backward compatability. Expect
1104 noepeer to become the default in ntp-4.4.
1105
1106 nomodify
1107 Deny ntpq(8) and ntpdc(8) queries which attempt to modify
1108 the state of the server (i.e., run time reconfiguration).
1109 Queries which return information are permitted.
1110
1111 noquery
1112 Deny ntpq(8) and ntpdc(8) queries. Time service is not
1113 affected.
1114
1115 nopeer Deny unauthenticated packets which would result in mobi‐
1116 lizing a new association. This includes broadcast and
1117 symmetric active packets when a configured association
1118 does not exist. It also includes pool associations, so
1119 if you want to use servers from a pool directive and also
1120 want to use nopeer by default, you'll want a restrict
1121 source ... line as well that does not include the nopeer
1122 directive.
1123
1124 noserve
1125 Deny all packets except ntpq(8) and ntpdc(8) queries.
1126
1127 notrap Decline to provide mode 6 control message trap service to
1128 matching hosts. The trap service is a subsystem of the
1129 ntpq(8) control message protocol which is intended for
1130 use by remote event logging programs.
1131
1132 notrust
1133 Deny service unless the packet is cryptographically
1134 authenticated.
1135
1136 ntpport
1137 This is actually a match algorithm modifier, rather than
1138 a restriction flag. Its presence causes the restriction
1139 entry to be matched only if the source port in the packet
1140 is the standard NTP UDP port (123). Both ntpport and
1141 non-ntpport may be specified. The ntpport is considered
1142 more specific and is sorted later in the list.
1143
1144 serverresponse fuzz
1145 When reponding to server requests, fuzz the low order
1146 bits of the reftime.
1147
1148 version
1149 Deny packets that do not match the current NTP version.
1150
1151 Default restriction list entries with the flags ignore, interface, ntp‐
1152 port, for each of the local host's interface addresses are inserted
1153 into the table at startup to prevent the server from attempting to syn‐
1154 chronize to its own time. A default entry is also always present,
1155 though if it is otherwise unconfigured; no flags are associated with
1156 the default entry (i.e., everything besides your own NTP server is
1157 unrestricted).
1158
1160 Manycasting
1161 Manycasting is a automatic discovery and configuration paradigm new to
1162 NTPv4. It is intended as a means for a multicast client to troll the
1163 nearby network neighborhood to find cooperating manycast servers, vali‐
1164 date them using cryptographic means and evaluate their time values with
1165 respect to other servers that might be lurking in the vicinity. The
1166 intended result is that each manycast client mobilizes client associa‐
1167 tions with some number of the "best" of the nearby manycast servers,
1168 yet automatically reconfigures to sustain this number of servers should
1169 one or another fail.
1170
1171 Note that the manycasting paradigm does not coincide with the anycast
1172 paradigm described in RFC-1546, which is designed to find a single
1173 server from a clique of servers providing the same service. The many‐
1174 cast paradigm is designed to find a plurality of redundant servers sat‐
1175 isfying defined optimality criteria.
1176
1177 Manycasting can be used with either symmetric key or public key cryp‐
1178 tography. The public key infrastructure (PKI) offers the best protec‐
1179 tion against compromised keys and is generally considered stronger, at
1180 least with relatively large key sizes. It is implemented using the
1181 Autokey protocol and the OpenSSL cryptographic library available from
1182 http://www.openssl.org/. The library can also be used with other NTPv4
1183 modes as well and is highly recommended, especially for broadcast
1184 modes.
1185
1186 A persistent manycast client association is configured using the many‐
1187 castclient command, which is similar to the server command but with a
1188 multicast (IPv4 class D or IPv6 prefix FF) group address. The IANA has
1189 designated IPv4 address 224.1.1.1 and IPv6 address FF05::101 (site
1190 local) for NTP. When more servers are needed, it broadcasts manycast
1191 client messages to this address at the minimum feasible rate and mini‐
1192 mum feasible time-to-live (TTL) hops, depending on how many servers
1193 have already been found. There can be as many manycast client associa‐
1194 tions as different group address, each one serving as a template for a
1195 future ephemeral unicast client/server association.
1196
1197 Manycast servers configured with the manycastserver command listen on
1198 the specified group address for manycast client messages. Note the
1199 distinction between manycast client, which actively broadcasts mes‐
1200 sages, and manycast server, which passively responds to them. If a
1201 manycast server is in scope of the current TTL and is itself synchro‐
1202 nized to a valid source and operating at a stratum level equal to or
1203 lower than the manycast client, it replies to the manycast client mes‐
1204 sage with an ordinary unicast server message.
1205
1206 The manycast client receiving this message mobilizes an ephemeral
1207 client/server association according to the matching manycast client
1208 template, but only if cryptographically authenticated and the server
1209 stratum is less than or equal to the client stratum. Authentication is
1210 explicitly required and either symmetric key or public key (Autokey)
1211 can be used. Then, the client polls the server at its unicast address
1212 in burst mode in order to reliably set the host clock and validate the
1213 source. This normally results in a volley of eight client/server at
1214 2-s intervals during which both the synchronization and cryptographic
1215 protocols run concurrently. Following the volley, the client runs the
1216 NTP intersection and clustering algorithms, which act to discard all
1217 but the "best" associations according to stratum and synchronization
1218 distance. The surviving associations then continue in ordinary
1219 client/server mode.
1220
1221 The manycast client polling strategy is designed to reduce as much as
1222 possible the volume of manycast client messages and the effects of
1223 implosion due to near-simultaneous arrival of manycast server messages.
1224 The strategy is determined by the manycastclient, tos and ttl configu‐
1225 ration commands. The manycast poll interval is normally eight times
1226 the system poll interval, which starts out at the minpoll value speci‐
1227 fied in the manycastclient, command and, under normal circumstances,
1228 increments to the maxpolll value specified in this command. Initially,
1229 the TTL is set at the minimum hops specified by the ttl command. At
1230 each retransmission the TTL is increased until reaching the maximum
1231 hops specified by this command or a sufficient number client associa‐
1232 tions have been found. Further retransmissions use the same TTL.
1233
1234 The quality and reliability of the suite of associations discovered by
1235 the manycast client is determined by the NTP mitigation algorithms and
1236 the minclock and minsane values specified in the tos configuration com‐
1237 mand. At least minsane candidate servers must be available and the
1238 mitigation algorithms produce at least minclock survivors in order to
1239 synchronize the clock. Byzantine agreement principles require at least
1240 four candidates in order to correctly discard a single falseticker.
1241 For legacy purposes, minsane defaults to 1 and minclock defaults to 3.
1242 For manycast service minsane should be explicitly set to 4, assuming at
1243 least that number of servers are available.
1244
1245 If at least minclock servers are found, the manycast poll interval is
1246 immediately set to eight times maxpoll. If less than minclock servers
1247 are found when the TTL has reached the maximum hops, the manycast poll
1248 interval is doubled. For each transmission after that, the poll inter‐
1249 val is doubled again until reaching the maximum of eight times maxpoll.
1250 Further transmissions use the same poll interval and TTL values. Note
1251 that while all this is going on, each client/server association found
1252 is operating normally it the system poll interval.
1253
1254 Administratively scoped multicast boundaries are normally specified by
1255 the network router configuration and, in the case of IPv6, the
1256 link/site scope prefix. By default, the increment for TTL hops is 32
1257 starting from 31; however, the ttl configuration command can be used to
1258 modify the values to match the scope rules.
1259
1260 It is often useful to narrow the range of acceptable servers which can
1261 be found by manycast client associations. Because manycast servers
1262 respond only when the client stratum is equal to or greater than the
1263 server stratum, primary (stratum 1) servers fill find only primary
1264 servers in TTL range, which is probably the most common objective.
1265 However, unless configured otherwise, all manycast clients in TTL range
1266 will eventually find all primary servers in TTL range, which is proba‐
1267 bly not the most common objective in large networks. The tos command
1268 can be used to modify this behavior. Servers with stratum below floor
1269 or above ceiling specified in the tos command are strongly discouraged
1270 during the selection process; however, these servers may be temporally
1271 accepted if the number of servers within TTL range is less than min‐
1272 clock.
1273
1274 The above actions occur for each manycast client message, which repeats
1275 at the designated poll interval. However, once the ephemeral client
1276 association is mobilized, subsequent manycast server replies are dis‐
1277 carded, since that would result in a duplicate association. If during
1278 a poll interval the number of client associations falls below minclock,
1279 all manycast client prototype associations are reset to the initial
1280 poll interval and TTL hops and operation resumes from the beginning.
1281 It is important to avoid frequent manycast client messages, since each
1282 one requires all manycast servers in TTL range to respond. The result
1283 could well be an implosion, either minor or major, depending on the
1284 number of servers in range. The recommended value for maxpoll is 12
1285 (4,096 s).
1286
1287 It is possible and frequently useful to configure a host as both many‐
1288 cast client and manycast server. A number of hosts configured this way
1289 and sharing a common group address will automatically organize them‐
1290 selves in an optimum configuration based on stratum and synchronization
1291 distance. For example, consider an NTP subnet of two primary servers
1292 and a hundred or more dependent clients. With two exceptions, all
1293 servers and clients have identical configuration files including both
1294 multicastclient and multicastserver commands using, for instance, mul‐
1295 ticast group address 239.1.1.1. The only exception is that each pri‐
1296 mary server configuration file must include commands for the primary
1297 reference source such as a GPS receiver.
1298
1299 The remaining configuration files for all secondary servers and clients
1300 have the same contents, except for the tos command, which is specific
1301 for each stratum level. For stratum 1 and stratum 2 servers, that com‐
1302 mand is not necessary. For stratum 3 and above servers the floor value
1303 is set to the intended stratum number. Thus, all stratum 3 configura‐
1304 tion files are identical, all stratum 4 files are identical and so
1305 forth.
1306
1307 Once operations have stabilized in this scenario, the primary servers
1308 will find the primary reference source and each other, since they both
1309 operate at the same stratum (1), but not with any secondary server or
1310 client, since these operate at a higher stratum. The secondary servers
1311 will find the servers at the same stratum level. If one of the primary
1312 servers loses its GPS receiver, it will continue to operate as a client
1313 and other clients will time out the corresponding association and re-
1314 associate accordingly.
1315
1316 Some administrators prefer to avoid running ntpd(8) continuously and
1317 run either sntp(8) or ntpd(8) -q as a cron job. In either case the
1318 servers must be configured in advance and the program fails if none are
1319 available when the cron job runs. A really slick application of many‐
1320 cast is with ntpd(8) -q. The program wakes up, scans the local land‐
1321 scape looking for the usual suspects, selects the best from among the
1322 rascals, sets the clock and then departs. Servers do not have to be
1323 configured in advance and all clients throughout the network can have
1324 the same configuration file.
1325
1326 Manycast Interactions with Autokey
1327 Each time a manycast client sends a client mode packet to a multicast
1328 group address, all manycast servers in scope generate a reply including
1329 the host name and status word. The manycast clients then run the
1330 Autokey protocol, which collects and verifies all certificates
1331 involved. Following the burst interval all but three survivors are
1332 cast off, but the certificates remain in the local cache. It often
1333 happens that several complete signing trails from the client to the
1334 primary servers are collected in this way.
1335
1336 About once an hour or less often if the poll interval exceeds this, the
1337 client regenerates the Autokey key list. This is in general transpar‐
1338 ent in client/server mode. However, about once per day the server pri‐
1339 vate value used to generate cookies is refreshed along with all many‐
1340 cast client associations. In this case all cryptographic values
1341 including certificates is refreshed. If a new certificate has been
1342 generated since the last refresh epoch, it will automatically revoke
1343 all prior certificates that happen to be in the certificate cache. At
1344 the same time, the manycast scheme starts all over from the beginning
1345 and the expanding ring shrinks to the minimum and increments from there
1346 while collecting all servers in scope.
1347
1348 Broadcast Options
1349 tos [bcpollbstep gate]
1350 This command provides a way to delay, by the specified number of
1351 broadcast poll intervals, believing backward time steps from a
1352 broadcast server. Broadcast time networks are expected to be
1353 trusted. In the event a broadcast server's time is stepped
1354 backwards, there is clear benefit to having the clients notice
1355 this change as soon as possible. Attacks such as replay attacks
1356 can happen, however, and even though there are a number of pro‐
1357 tections built in to broadcast mode, attempts to perform a
1358 replay attack are possible. This value defaults to 0, but can
1359 be changed to any number of poll intervals between 0 and 4.
1360
1361 Manycast Options
1362 tos [ceiling ceiling | cohort { 0 | 1 } | floor floor | minclock min‐
1363 clock | minsane minsane]
1364 This command affects the clock selection and clustering algo‐
1365 rithms. It can be used to select the quality and quantity of
1366 peers used to synchronize the system clock and is most useful in
1367 manycast mode. The variables operate as follows:
1368
1369 ceiling ceiling
1370 Peers with strata above ceiling will be discarded if
1371 there are at least minclock peers remaining. This value
1372 defaults to 15, but can be changed to any number from 1
1373 to 15.
1374
1375 cohort {0 | 1 }
1376 This is a binary flag which enables (0) or disables (1)
1377 manycast server replies to manycast clients with the same
1378 stratum level. This is useful to reduce implosions where
1379 large numbers of clients with the same stratum level are
1380 present. The default is to enable these replies.
1381
1382 floor floor
1383 Peers with strata below floor will be discarded if there
1384 are at least minclock peers remaining. This value
1385 defaults to 1, but can be changed to any number from 1 to
1386 15.
1387
1388 minclock minclock
1389 The clustering algorithm repeatedly casts out outlier
1390 associations until no more than minclock associations
1391 remain. This value defaults to 3, but can be changed to
1392 any number from 1 to the number of configured sources.
1393
1394 minsane minsane
1395 This is the minimum number of candidates available to the
1396 clock selection algorithm in order to produce one or more
1397 truechimers for the clustering algorithm. If fewer than
1398 this number are available, the clock is undisciplined and
1399 allowed to run free. The default is 1 for legacy pur‐
1400 poses. However, according to principles of Byzantine
1401 agreement, minsane should be at least 4 in order to
1402 detect and discard a single falseticker.
1403
1404 ttl hop ...
1405 This command specifies a list of TTL values in increasing order,
1406 up to 8 values can be specified. In manycast mode these values
1407 are used in turn in an expanding-ring search. The default is
1408 eight multiples of 32 starting at 31.
1409
1411 The NTP Version 4 daemon supports some three dozen different radio,
1412 satellite and modem reference clocks plus a special pseudo-clock used
1413 for backup or when no other clock source is available. Detailed
1414 descriptions of individual device drivers and options can be found in
1415 the "Reference Clock Drivers" page (available as part of the HTML docu‐
1416 mentation provided in /usr/share/doc/ntp). Additional information can
1417 be found in the pages linked there, including the "Debugging Hints for
1418 Reference Clock Drivers" and "How To Write a Reference Clock Driver"
1419 pages (available as part of the HTML documentation provided in
1420 /usr/share/doc/ntp). In addition, support for a PPS signal is avail‐
1421 able as described in the "Pulse-per-second (PPS) Signal Interfacing"
1422 page (available as part of the HTML documentation provided in
1423 /usr/share/doc/ntp). Many drivers support special line disci‐
1424 pline/streams modules which can significantly improve the accuracy
1425 using the driver. These are described in the "Line Disciplines and
1426 Streams Drivers" page (available as part of the HTML documentation pro‐
1427 vided in /usr/share/doc/ntp).
1428
1429 A reference clock will generally (though not always) be a radio time‐
1430 code receiver which is synchronized to a source of standard time such
1431 as the services offered by the NRC in Canada and NIST and USNO in the
1432 US. The interface between the computer and the timecode receiver is
1433 device dependent, but is usually a serial port. A device driver spe‐
1434 cific to each reference clock must be selected and compiled in the dis‐
1435 tribution; however, most common radio, satellite and modem clocks are
1436 included by default. Note that an attempt to configure a reference
1437 clock when the driver has not been compiled or the hardware port has
1438 not been appropriately configured results in a scalding remark to the
1439 system log file, but is otherwise non hazardous.
1440
1441 For the purposes of configuration, ntpd(8) treats reference clocks in a
1442 manner analogous to normal NTP peers as much as possible. Reference
1443 clocks are identified by a syntactically correct but invalid IP
1444 address, in order to distinguish them from normal NTP peers. Reference
1445 clock addresses are of the form 127.127.t.u, where t is an integer
1446 denoting the clock type and u indicates the unit number in the range
1447 0-3. While it may seem overkill, it is in fact sometimes useful to
1448 configure multiple reference clocks of the same type, in which case the
1449 unit numbers must be unique.
1450
1451 The server command is used to configure a reference clock, where the
1452 address argument in that command is the clock address. The key, ver‐
1453 sion and ttl options are not used for reference clock support. The
1454 mode option is added for reference clock support, as described below.
1455 The prefer option can be useful to persuade the server to cherish a
1456 reference clock with somewhat more enthusiasm than other reference
1457 clocks or peers. Further information on this option can be found in
1458 the "Mitigation Rules and the prefer Keyword" (available as part of the
1459 HTML documentation provided in /usr/share/doc/ntp) page. The minpoll
1460 and maxpoll options have meaning only for selected clock drivers. See
1461 the individual clock driver document pages for additional information.
1462
1463 The fudge command is used to provide additional information for indi‐
1464 vidual clock drivers and normally follows immediately after the server
1465 command. The address argument specifies the clock address. The refid
1466 and stratum options can be used to override the defaults for the
1467 device. There are two optional device-dependent time offsets and four
1468 flags that can be included in the fudge command as well.
1469
1470 The stratum number of a reference clock is by default zero. Since the
1471 ntpd(8) daemon adds one to the stratum of each peer, a primary server
1472 ordinarily displays an external stratum of one. In order to provide
1473 engineered backups, it is often useful to specify the reference clock
1474 stratum as greater than zero. The stratum option is used for this pur‐
1475 pose. Also, in cases involving both a reference clock and a pulse-per-
1476 second (PPS) discipline signal, it is useful to specify the reference
1477 clock identifier as other than the default, depending on the driver.
1478 The refid option is used for this purpose. Except where noted, these
1479 options apply to all clock drivers.
1480
1481 Reference Clock Commands
1482 server 127.127.t.u [prefer] [mode int] [minpoll int] [maxpoll int]
1483 This command can be used to configure reference clocks in spe‐
1484 cial ways. The options are interpreted as follows:
1485
1486 prefer Marks the reference clock as preferred. All other things
1487 being equal, this host will be chosen for synchronization
1488 among a set of correctly operating hosts. See the "Miti‐
1489 gation Rules and the prefer Keyword" page (available as
1490 part of the HTML documentation provided in
1491 /usr/share/doc/ntp) for further information.
1492
1493 mode int
1494 Specifies a mode number which is interpreted in a device-
1495 specific fashion. For instance, it selects a dialing
1496 protocol in the ACTS driver and a device subtype in the
1497 parse drivers.
1498
1499 minpoll int
1500
1501 maxpoll int
1502 These options specify the minimum and maximum polling
1503 interval for reference clock messages, as a power of 2 in
1504 seconds For most directly connected reference clocks,
1505 both minpoll and maxpoll default to 6 (64 s). For modem
1506 reference clocks, minpoll defaults to 10 (17.1 m) and
1507 maxpoll defaults to 14 (4.5 h). The allowable range is 4
1508 (16 s) to 17 (36.4 h) inclusive.
1509
1510 fudge 127.127.t.u [time1 sec] [time2 sec] [stratum int] [refid string]
1511 [mode int] [flag1 0 | 1] [flag2 0 | 1] [flag3 0 | 1] [flag4 0 | 1]
1512 This command can be used to configure reference clocks in spe‐
1513 cial ways. It must immediately follow the server command which
1514 configures the driver. Note that the same capability is possi‐
1515 ble at run time using the ntpdc(8) program. The options are
1516 interpreted as follows:
1517
1518 time1 sec
1519 Specifies a constant to be added to the time offset pro‐
1520 duced by the driver, a fixed-point decimal number in sec‐
1521 onds. This is used as a calibration constant to adjust
1522 the nominal time offset of a particular clock to agree
1523 with an external standard, such as a precision PPS sig‐
1524 nal. It also provides a way to correct a systematic
1525 error or bias due to serial port or operating system
1526 latencies, different cable lengths or receiver internal
1527 delay. The specified offset is in addition to the propa‐
1528 gation delay provided by other means, such as internal
1529 DIPswitches. Where a calibration for an individual sys‐
1530 tem and driver is available, an approximate correction is
1531 noted in the driver documentation pages. Note: in order
1532 to facilitate calibration when more than one radio clock
1533 or PPS signal is supported, a special calibration feature
1534 is available. It takes the form of an argument to the
1535 enable command described in Miscellaneous Options page
1536 and operates as described in the "Reference Clock Driv‐
1537 ers" page (available as part of the HTML documentation
1538 provided in /usr/share/doc/ntp).
1539
1540 time2 secs
1541 Specifies a fixed-point decimal number in seconds, which
1542 is interpreted in a driver-dependent way. See the
1543 descriptions of specific drivers in the "Reference Clock
1544 Drivers" page (available as part of the HTML documenta‐
1545 tion provided in /usr/share/doc/ntp ).
1546
1547 stratum int
1548 Specifies the stratum number assigned to the driver, an
1549 integer between 0 and 15. This number overrides the
1550 default stratum number ordinarily assigned by the driver
1551 itself, usually zero.
1552
1553 refid string
1554 Specifies an ASCII string of from one to four characters
1555 which defines the reference identifier used by the
1556 driver. This string overrides the default identifier
1557 ordinarily assigned by the driver itself.
1558
1559 mode int
1560 Specifies a mode number which is interpreted in a device-
1561 specific fashion. For instance, it selects a dialing
1562 protocol in the ACTS driver and a device subtype in the
1563 parse drivers.
1564
1565 flag1 0 | 1
1566
1567 flag2 0 | 1
1568
1569 flag3 0 | 1
1570
1571 flag4 0 | 1
1572 These four flags are used for customizing the clock
1573 driver. The interpretation of these values, and whether
1574 they are used at all, is a function of the particular
1575 clock driver. However, by convention flag4 is used to
1576 enable recording monitoring data to the clockstats file
1577 configured with the filegen command. Further information
1578 on the filegen command can be found in Monitoring
1579 Options.
1580
1582 broadcastdelay seconds
1583 The broadcast and multicast modes require a special calibration
1584 to determine the network delay between the local and remote
1585 servers. Ordinarily, this is done automatically by the initial
1586 protocol exchanges between the client and server. In some
1587 cases, the calibration procedure may fail due to network or
1588 server access controls, for example. This command specifies the
1589 default delay to be used under these circumstances. Typically
1590 (for Ethernet), a number between 0.003 and 0.007 seconds is
1591 appropriate. The default when this command is not used is 0.004
1592 seconds.
1593
1594 calldelay delay
1595 This option controls the delay in seconds between the first and
1596 second packets sent in burst or iburst mode to allow additional
1597 time for a modem or ISDN call to complete.
1598
1599 driftfile driftfile
1600 This command specifies the complete path and name of the file
1601 used to record the frequency of the local clock oscillator.
1602 This is the same operation as the -f command line option. If
1603 the file exists, it is read at startup in order to set the ini‐
1604 tial frequency and then updated once per hour with the current
1605 frequency computed by the daemon. If the file name is speci‐
1606 fied, but the file itself does not exist, the starts with an
1607 initial frequency of zero and creates the file when writing it
1608 for the first time. If this command is not given, the daemon
1609 will always start with an initial frequency of zero.
1610
1611 The file format consists of a single line containing a single
1612 floating point number, which records the frequency offset mea‐
1613 sured in parts-per-million (PPM). The file is updated by first
1614 writing the current drift value into a temporary file and then
1615 renaming this file to replace the old version. This implies
1616 that ntpd(8) must have write permission for the directory the
1617 drift file is located in, and that file system links, symbolic
1618 or otherwise, should be avoided.
1619
1620 dscp value
1621 This option specifies the Differentiated Services Control Point
1622 (DSCP) value, a 6-bit code. The default value is 46, signifying
1623 Expedited Forwarding.
1624
1625 enable [auth | bclient | calibrate | kernel | mode7 | monitor | ntp |
1626 stats | peer_clear_digest_early | unpeer_crypto_early |
1627 unpeer_crypto_nak_early | unpeer_digest_early]
1628
1629 disable [auth | bclient | calibrate | kernel | mode7 | monitor | ntp |
1630 stats | peer_clear_digest_early | unpeer_crypto_early |
1631 unpeer_crypto_nak_early | unpeer_digest_early]
1632 Provides a way to enable or disable various server options.
1633 Flags not mentioned are unaffected. Note that all of these
1634 flags can be controlled remotely using the ntpdc(8) utility pro‐
1635 gram.
1636
1637 auth Enables the server to synchronize with unconfigured peers
1638 only if the peer has been correctly authenticated using
1639 either public key or private key cryptography. The
1640 default for this flag is enable.
1641
1642 bclient
1643 Enables the server to listen for a message from a broad‐
1644 cast or multicast server, as in the multicastclient com‐
1645 mand with default address. The default for this flag is
1646 disable.
1647
1648 calibrate
1649 Enables the calibrate feature for reference clocks. The
1650 default for this flag is disable.
1651
1652 kernel Enables the kernel time discipline, if available. The
1653 default for this flag is enable if support is available,
1654 otherwise disable.
1655
1656 mode7 Enables processing of NTP mode 7 implementation-specific
1657 requests which are used by the deprecated ntpdc(8) pro‐
1658 gram. The default for this flag is disable. This flag
1659 is excluded from runtime configuration using ntpq(8).
1660 The ntpq(8) program provides the same capabilities as
1661 ntpdc(8) using standard mode 6 requests.
1662
1663 monitor
1664 Enables the monitoring facility. See the ntpdc(8) pro‐
1665 gram and the monlist command or further information. The
1666 default for this flag is enable.
1667
1668 ntp Enables time and frequency discipline. In effect, this
1669 switch opens and closes the feedback loop, which is use‐
1670 ful for testing. The default for this flag is enable.
1671
1672 peer_clear_digest_early
1673 By default, if ntpd(8) is using autokey and it receives a
1674 crypto-NAK packet that passes the duplicate packet and
1675 origin timestamp checks the peer variables are immedi‐
1676 ately cleared. While this is generally a feature as it
1677 allows for quick recovery if a server key has changed, a
1678 properly forged and appropriately delivered crypto-NAK
1679 packet can be used in a DoS attack. If you have active
1680 noticable problems with this type of DoS attack then you
1681 should consider disabling this option. You can check
1682 your peerstats file for evidence of any of these attacks.
1683 The default for this flag is enable.
1684
1685 stats Enables the statistics facility. See the Monitoring
1686 Options section for further information. The default for
1687 this flag is disable.
1688
1689 unpeer_crypto_early
1690 By default, if ntpd(8) receives an autokey packet that
1691 fails TEST9, a crypto failure, the association is immedi‐
1692 ately cleared. This is almost certainly a feature, but
1693 if, in spite of the current recommendation of not using
1694 autokey, you are still using autokey and you are seeing
1695 this sort of DoS attack disabling this flag will delay
1696 tearing down the association until the reachability
1697 counter becomes zero. You can check your peerstats file
1698 for evidence of any of these attacks. The default for
1699 this flag is enable.
1700
1701 unpeer_crypto_nak_early
1702 By default, if ntpd(8) receives a crypto-NAK packet that
1703 passes the duplicate packet and origin timestamp checks
1704 the association is immediately cleared. While this is
1705 generally a feature as it allows for quick recovery if a
1706 server key has changed, a properly forged and appropri‐
1707 ately delivered crypto-NAK packet can be used in a DoS
1708 attack. If you have active noticable problems with this
1709 type of DoS attack then you should consider disabling
1710 this option. You can check your peerstats file for evi‐
1711 dence of any of these attacks. The default for this flag
1712 is enable.
1713
1714 unpeer_digest_early
1715 By default, if ntpd(8) receives what should be an authen‐
1716 ticated packet that passes other packet sanity checks but
1717 contains an invalid digest the association is immediately
1718 cleared. While this is generally a feature as it allows
1719 for quick recovery, if this type of packet is carefully
1720 forged and sent during an appropriate window it can be
1721 used for a DoS attack. If you have active noticable
1722 problems with this type of DoS attack then you should
1723 consider disabling this option. You can check your peer‐
1724 stats file for evidence of any of these attacks. The
1725 default for this flag is enable.
1726
1727 includefile includefile
1728 This command allows additional configuration commands to be
1729 included from a separate file. Include files may be nested to a
1730 depth of five; upon reaching the end of any include file, com‐
1731 mand processing resumes in the previous configuration file.
1732 This option is useful for sites that run ntpd(8) on multiple
1733 hosts, with (mostly) common options (e.g., a restriction list).
1734
1735 interface [listen | ignore | drop] [all | ipv4 | ipv6 | wildcard name |
1736 address [/ prefixlen]]
1737 The interface directive controls which network addresses ntpd(8)
1738 opens, and whether input is dropped without processing. The
1739 first parameter determines the action for addresses which match
1740 the second parameter. The second parameter specifies a class of
1741 addresses, or a specific interface name, or an address. In the
1742 address case, prefixlen determines how many bits must match for
1743 this rule to apply. ignore prevents opening matching addresses,
1744 drop causes ntpd(8) to open the address and drop all received
1745 packets without examination. Multiple interface directives can
1746 be used. The last rule which matches a particular address
1747 determines the action for it. interface directives are disabled
1748 if any -I, --interface, -L, or --novirtualips command-line
1749 options are specified in the configuration file, all available
1750 network addresses are opened. The nic directive is an alias for
1751 interface.
1752
1753 leapfile leapfile
1754 This command loads the IERS leapseconds file and initializes the
1755 leapsecond values for the next leapsecond event, leapfile expi‐
1756 ration time, and TAI offset. The file can be obtained directly
1757 from the IERS at https://hpiers.obspm.fr/iers/bul/bulc/ntp/leap-
1758 seconds.list or ftp://hpiers.obspm.fr/iers/bul/bulc/ntp/leap-
1759 seconds.list. The leapfile is scanned when ntpd(8) processes
1760 the leapfile directive or when ntpd detects that the leapfile
1761 has changed. ntpd checks once a day to see if the leapfile has
1762 changed. The update-leap(1update_leapmdoc) script can be run to
1763 see if the leapfile should be updated.
1764
1765 leapsmearinterval seconds
1766 This EXPERIMENTAL option is only available if ntpd(8) was built
1767 with the --enable-leap-smear option to the configure script. It
1768 specifies the interval over which a leap second correction will
1769 be applied. Recommended values for this option are between 7200
1770 (2 hours) and 86400 (24 hours). See http://bugs.ntp.org/2855
1771 for more information.
1772
1773 logconfig configkeyword
1774 This command controls the amount and type of output written to
1775 the system syslog(3) facility or the alternate logfile log file.
1776 By default, all output is turned on. All configkeyword keywords
1777 can be prefixed with ‘=’, ‘+’ and ‘-’, where ‘=’ sets the sys‐
1778 log(3) priority mask, ‘+’ adds and ‘-’ removes messages. sys‐
1779 log(3) messages can be controlled in four classes (clock, peer,
1780 sys and sync). Within these classes four types of messages can
1781 be controlled: informational messages (info), event messages
1782 (events), statistics messages (statistics) and status messages
1783 (status).
1784
1785 Configuration keywords are formed by concatenating the message
1786 class with the event class. The all prefix can be used instead
1787 of a message class. A message class may also be followed by the
1788 all keyword to enable/disable all messages of the respective
1789 message class. Thus, a minimal log configuration could look
1790 like this:
1791 logconfig =syncstatus +sysevents
1792
1793 This would just list the synchronizations state of ntpd(8) and
1794 the major system events. For a simple reference server, the
1795 following minimum message configuration could be useful:
1796 logconfig =syncall +clockall
1797
1798 This configuration will list all clock information and synchro‐
1799 nization information. All other events and messages about
1800 peers, system events and so on is suppressed.
1801
1802 logfile logfile
1803 This command specifies the location of an alternate log file to
1804 be used instead of the default system syslog(3) facility. This
1805 is the same operation as the -l command line option.
1806
1807 mru [maxdepth count | maxmem kilobytes | mindepth count | maxage sec‐
1808 onds | initialloc count | initmem kilobytes | incalloc count | incmem
1809 kilobytes]
1810 Controls size limite of the monitoring facility's Most Recently
1811 Used (MRU) list of client addresses, which is also used by the
1812 rate control facility.
1813
1814 maxdepth count
1815
1816 maxmem kilobytes
1817 Equivalent upper limits on the size of the MRU list, in
1818 terms of entries or kilobytes. The acutal limit will be
1819 up to incalloc entries or incmem kilobytes larger. As
1820 with all of the mru options offered in units of entries
1821 or kilobytes, if both maxdepth and maxmem are used, the
1822 last one used controls. The default is 1024 kilobytes.
1823
1824 mindepth count
1825 Lower limit on the MRU list size. When the MRU list has
1826 fewer than mindepth entries, existing entries are never
1827 removed to make room for newer ones, regardless of their
1828 age. The default is 600 entries.
1829
1830 maxage seconds
1831 Once the MRU list has mindepth entries and an additional
1832 client is to ba added to the list, if the oldest entry
1833 was updated more than maxage seconds ago, that entry is
1834 removed and its storage is reused. If the oldest entry
1835 was updated more recently the MRU list is grown, subject
1836 to maxdepth / moxmem. The default is 64 seconds.
1837
1838 initalloc count
1839
1840 initmem kilobytes
1841 Initial memory allocation at the time the monitoringfa‐
1842 cility is first enabled, in terms of the number of
1843 entries or kilobytes. The default is 4 kilobytes.
1844
1845 incalloc count
1846
1847 incmem kilobytes
1848 Size of additional memory allocations when growing the
1849 MRU list, in entries or kilobytes. The default is 4
1850 kilobytes.
1851
1852 nonvolatile threshold
1853 Specify the threshold delta in seconds before an hourly change
1854 to the driftfile (frequency file) will be written, with a
1855 default value of 1e-7 (0.1 PPM). The frequency file is
1856 inspected each hour. If the difference between the current fre‐
1857 quency and the last value written exceeds the threshold, the
1858 file is written and the threshold becomes the new threshold
1859 value. If the threshold is not exceeeded, it is reduced by
1860 half. This is intended to reduce the number of file writes for
1861 embedded systems with nonvolatile memory.
1862
1863 phone dial ...
1864 This command is used in conjunction with the ACTS modem driver
1865 (type 18) or the JJY driver (type 40, mode 100 - 180). For the
1866 ACTS modem driver (type 18), the arguments consist of a maximum
1867 of 10 telephone numbers used to dial USNO, NIST, or European
1868 time service. For the JJY driver (type 40 mode 100 - 180), the
1869 argument is one telephone number used to dial the telephone JJY
1870 service. The Hayes command ATDT is normally prepended to the
1871 number. The number can contain other modem control codes as
1872 well.
1873
1874 pollskewlist [poll value | value] ... [default value | value]
1875 Enable skewing of our poll requests to our servers. poll is a
1876 number between 3 and 17 inclusive, identifying a specific poll
1877 interval. A poll interval is 2^n seconds in duration, so a poll
1878 value of 3 corresponds to 8 seconds and a poll interval of 17
1879 corresponds to 131,072 seconds, or about a day and a half. The
1880 next two numbers must be between 0 and one-half of the poll
1881 interval, inclusive. The first number specifies how early the
1882 poll may start, while the second number specifies how late the
1883 poll may be delayed. With no arguments, internally specified
1884 default values are chosen.
1885
1886 reset [allpeers] [auth] [ctl] [io] [mem] [sys] [timer]
1887 Reset one or more groups of counters maintained by ntpd and
1888 exposed by ntpq and ntpdc.
1889
1890 rlimit [memlock Nmegabytes | stacksize N4kPages filenum Nfiledescrip‐
1891 tors]
1892
1893 memlock Nmegabytes
1894 Specify the number of megabytes of memory that should be
1895 allocated and locked. Probably only available under
1896 Linux, this option may be useful when dropping root (the
1897 -i option). The default is 32 megabytes on non-Linux
1898 machines, and -1 under Linux. -1 means "do not lock the
1899 process into memory". 0 means "lock whatever memory the
1900 process wants into memory".
1901
1902 stacksize N4kPages
1903 Specifies the maximum size of the process stack on sys‐
1904 tems with the mlockall() function. Defaults to 50 4k
1905 pages (200 4k pages in OpenBSD).
1906
1907 filenum Nfiledescriptors
1908 Specifies the maximum number of file descriptors ntpd may
1909 have open at once. Defaults to the system default.
1910
1911 saveconfigdir directory_path
1912 Specify the directory in which to write configuration snapshots
1913 requested with saveconfig command. If saveconfigdir does not
1914 appear in the configuration file, saveconfig requests are
1915 rejected by ntpd.
1916
1917 saveconfig filename
1918 Write the current configuration, including any runtime modifica‐
1919 tions given with :config or config-from-file to the ntpd host's
1920 filename in the saveconfigdir. This command will be rejected
1921 unless the saveconfigdir directive appears in configuration
1922 file. filename can use strftime(3) format directives to substi‐
1923 tute the current date and time, for example, savecon‐
1924 fig ntp-%Y%m%d-%H%M%S.conf. The filename used is stored in the
1925 system variable savedconfig. Authentication is required.
1926
1927 setvar variable [default]
1928 This command adds an additional system variable. These vari‐
1929 ables can be used to distribute additional information such as
1930 the access policy. If the variable of the form name=value is
1931 followed by the default keyword, the variable will be listed as
1932 part of the default system variables (ntpq(8) rv command)).
1933 These additional variables serve informational purposes only.
1934 They are not related to the protocol other that they can be
1935 listed. The known protocol variables will always override any
1936 variables defined via the setvar mechanism. There are three
1937 special variables that contain the names of all variable of the
1938 same group. The sys_var_list holds the names of all system
1939 variables. The peer_var_list holds the names of all peer vari‐
1940 ables and the clock_var_list holds the names of the reference
1941 clock variables.
1942
1943 sysinfo
1944 Display operational summary.
1945
1946 sysstats
1947 Show statistics counters maintained in the protocol module.
1948
1949 tinker [allan allan | dispersion dispersion | freq freq | huffpuff
1950 huffpuff | panic panic | step step | stepback stepback | stepfwd
1951 stepfwd | stepout stepout]
1952 This command can be used to alter several system variables in
1953 very exceptional circumstances. It should occur in the configu‐
1954 ration file before any other configuration options. The default
1955 values of these variables have been carefully optimized for a
1956 wide range of network speeds and reliability expectations. In
1957 general, they interact in intricate ways that are hard to pre‐
1958 dict and some combinations can result in some very nasty behav‐
1959 ior. Very rarely is it necessary to change the default values;
1960 but, some folks cannot resist twisting the knobs anyway and this
1961 command is for them. Emphasis added: twisters are on their own
1962 and can expect no help from the support group.
1963
1964 The variables operate as follows:
1965
1966 allan allan
1967 The argument becomes the new value for the minimum Allan
1968 intercept, which is a parameter of the PLL/FLL clock dis‐
1969 cipline algorithm. The value in log2 seconds defaults to
1970 7 (1024 s), which is also the lower limit.
1971
1972 dispersion dispersion
1973 The argument becomes the new value for the dispersion
1974 increase rate, normally .000015 s/s.
1975
1976 freq freq
1977 The argument becomes the initial value of the frequency
1978 offset in parts-per-million. This overrides the value in
1979 the frequency file, if present, and avoids the initial
1980 training state if it is not.
1981
1982 huffpuff huffpuff
1983 The argument becomes the new value for the experimental
1984 huff-n'-puff filter span, which determines the most
1985 recent interval the algorithm will search for a minimum
1986 delay. The lower limit is 900 s (15 m), but a more rea‐
1987 sonable value is 7200 (2 hours). There is no default,
1988 since the filter is not enabled unless this command is
1989 given.
1990
1991 panic panic
1992 The argument is the panic threshold, normally 1000 s. If
1993 set to zero, the panic sanity check is disabled and a
1994 clock offset of any value will be accepted.
1995
1996 step step
1997 The argument is the step threshold, which by default is
1998 0.128 s. It can be set to any positive number in sec‐
1999 onds. If set to zero, step adjustments will never occur.
2000 Note: The kernel time discipline is disabled if the step
2001 threshold is set to zero or greater than the default.
2002
2003 stepback stepback
2004 The argument is the step threshold for the backward
2005 direction, which by default is 0.128 s. It can be set to
2006 any positive number in seconds. If both the forward and
2007 backward step thresholds are set to zero, step adjust‐
2008 ments will never occur. Note: The kernel time discipline
2009 is disabled if each direction of step threshold are
2010 either set to zero or greater than .5 second.
2011
2012 stepfwd stepfwd
2013 As for stepback, but for the forward direction.
2014
2015 stepout stepout
2016 The argument is the stepout timeout, which by default is
2017 900 s. It can be set to any positive number in seconds.
2018 If set to zero, the stepout pulses will not be sup‐
2019 pressed.
2020
2021 writevar assocID name = value [,...]
2022 Write (create or update) the specified variables. If the asso‐
2023 cID is zero, the variablea re from the system variables name
2024 space, otherwise they are from the peer variables name space.
2025 The assocID is required, as the same name can occur in both name
2026 spaces.
2027
2028 trap host_address [port port_number] [interface interface_address]
2029 This command configures a trap receiver at the given host
2030 address and port number for sending messages with the specified
2031 local interface address. If the port number is unspecified, a
2032 value of 18447 is used. If the interface address is not speci‐
2033 fied, the message is sent with a source address of the local
2034 interface the message is sent through. Note that on a multi‐
2035 homed host the interface used may vary from time to time with
2036 routing changes.
2037
2038 ttl hop ...
2039 This command specifies a list of TTL values in increasing order.
2040 Up to 8 values can be specified. In manycast mode these values
2041 are used in-turn in an expanding-ring search. The default is
2042 eight multiples of 32 starting at 31.
2043
2044 The trap receiver will generally log event messages and other
2045 information from the server in a log file. While such monitor
2046 programs may also request their own trap dynamically, configur‐
2047 ing a trap receiver will ensure that no messages are lost when
2048 the server is started.
2049
2050 hop ...
2051 This command specifies a list of TTL values in increasing order,
2052 up to 8 values can be specified. In manycast mode these values
2053 are used in turn in an expanding-ring search. The default is
2054 eight multiples of 32 starting at 31.
2055
2057 --help Display usage information and exit.
2058
2059 --more-help
2060 Pass the extended usage information through a pager.
2061
2062 --version [{v|c|n}]
2063 Output version of program and exit. The default mode is `v', a
2064 simple version. The `c' mode will print copyright information
2065 and `n' will print the full copyright notice.
2066
2068 Any option that is not marked as not presettable may be preset by load‐
2069 ing values from environment variables named:
2070 NTP_CONF_<option-name> or NTP_CONF
2071
2073 See OPTION PRESETS for configuration environment variables.
2074
2076 /etc/ntp.conf the default name of the configuration file
2077 ntp.keys private MD5 keys
2078 ntpkey RSA private key
2079 ntpkey_host RSA public key
2080 ntp_dh Diffie-Hellman agreement parameters
2081
2083 One of the following exit values will be returned:
2084
2085 0 (EXIT_SUCCESS)
2086 Successful program execution.
2087
2088 1 (EXIT_FAILURE)
2089 The operation failed or the command syntax was not valid.
2090
2091 70 (EX_SOFTWARE)
2092 libopts had an internal operational error. Please report it to
2093 autogen-users@lists.sourceforge.net. Thank you.
2094
2096 ntpd(8), ntpdc(8), ntpq(8)
2097
2098 In addition to the manual pages provided, comprehensive documentation
2099 is available on the world wide web at http://www.ntp.org/. A snapshot
2100 of this documentation is available in HTML format in
2101 /usr/share/doc/ntp. David L. Mills, Network Time Protocol (Version 4),
2102 RFC5905
2103
2105 The University of Delaware and Network Time Foundation
2106
2108 Copyright (C) 1992-2020 The University of Delaware and Network Time
2109 Foundation all rights reserved. This program is released under the
2110 terms of the NTP license, <http://ntp.org/license>.
2111
2113 The syntax checking is not picky; some combinations of ridiculous and
2114 even hilarious options and modes may not be detected.
2115
2116 The ntpkey_host files are really digital certificates. These should be
2117 obtained via secure directory services when they become universally
2118 available.
2119
2120 Please send bug reports to: http://bugs.ntp.org, bugs@ntp.org
2121
2123 This document was derived from FreeBSD.
2124
2125 This manual page was AutoGen-erated from the ntp.conf option defini‐
2126 tions.
2127
2128
2129
21304.2.8p15 23 Jun 2020 ntp.conf(5)