1CHRONY.CONF(5) Configuration Files CHRONY.CONF(5)
2
3
4
6 chrony.conf - chronyd configuration file
7
9 chrony.conf
10
12 This file configures the chronyd daemon. The compiled-in location is
13 /etc/chrony.conf, but other locations can be specified on the chronyd
14 command line with the -f option.
15
16 Each directive in the configuration file is placed on a separate line.
17 The following sections describe each of the directives in turn. The
18 directives can occur in any order in the file and they are not
19 case-sensitive.
20
21 The configuration directives can also be specified directly on the
22 chronyd command line. In this case each argument is parsed as a new
23 line and the configuration file is ignored.
24
25 While the number of supported directives is large, only a few of them
26 are typically needed. See the EXAMPLES section for configuration in
27 typical operating scenarios.
28
29 The configuration file might contain comment lines. A comment line is
30 any line that starts with zero or more spaces followed by any one of
31 the following characters: !, ;, #, %. Any line with this format will be
32 ignored.
33
35 Time sources
36 server hostname [option]...
37 The server directive specifies an NTP server which can be used as a
38 time source. The client-server relationship is strictly
39 hierarchical: a client might synchronise its system time to that of
40 the server, but the server’s system time will never be influenced
41 by that of a client.
42
43 The server directive is immediately followed by either the name of
44 the server, or its IP address. The server directive supports the
45 following options:
46
47 minpoll poll
48 This option specifies the minimum interval between requests
49 sent to the server as a power of 2 in seconds. For example,
50 minpoll 5 would mean that the polling interval should not drop
51 below 32 seconds. The default is 6 (64 seconds), the minimum is
52 -6 (1/64th of a second), and the maximum is 24 (6 months). Note
53 that intervals shorter than 6 (64 seconds) should generally not
54 be used with public servers on the Internet, because it might
55 be considered abuse. A sub-second interval will be enabled only
56 when the server is reachable and the round-trip delay is
57 shorter than 10 milliseconds, i.e. the server should be in a
58 local network.
59
60 maxpoll poll
61 This option specifies the maximum interval between requests
62 sent to the server as a power of 2 in seconds. For example,
63 maxpoll 9 indicates that the polling interval should stay at or
64 below 9 (512 seconds). The default is 10 (1024 seconds), the
65 minimum is -6 (1/64th of a second), and the maximum is 24 (6
66 months).
67
68 iburst
69 With this option, the interval between the first four requests
70 sent to the server will be 2 seconds or less instead of the
71 interval specified by the minpoll option, which allows chronyd
72 to make the first update of the clock shortly after start.
73
74 burst
75 With this option, chronyd will shorten the interval between up
76 to four requests to 2 seconds or less when it cannot get a good
77 measurement from the server. The number of requests in the
78 burst is limited by the current polling interval to keep the
79 average interval at or above the minimum interval, i.e. the
80 current interval needs to be at least two times longer than the
81 minimum interval in order to allow a burst with two requests.
82
83 key ID
84 The NTP protocol supports a message authentication code (MAC)
85 to prevent computers having their system time upset by rogue
86 packets being sent to them. The MAC is generated as a function
87 of a password specified in the key file, which is specified by
88 the keyfile directive.
89
90 The key option specifies which key (with an ID in the range 1
91 through 2^32-1) should chronyd use to authenticate requests
92 sent to the server and verify its responses. The server must
93 have the same key for this number configured, otherwise no
94 relationship between the computers will be possible.
95
96 If the server is running ntpd and the output size of the hash
97 function used by the key is longer than 160 bits (e.g. SHA256),
98 the version option needs to be set to 4 for compatibility.
99
100 maxdelay delay
101 chronyd uses the network round-trip delay to the server to
102 determine how accurate a particular measurement is likely to
103 be. Long round-trip delays indicate that the request, or the
104 response, or both were delayed. If only one of the messages was
105 delayed the measurement error is likely to be substantial.
106
107 For small variations in the round-trip delay, chronyd uses a
108 weighting scheme when processing the measurements. However,
109 beyond a certain level of delay the measurements are likely to
110 be so corrupted as to be useless. (This is particularly so on
111 dial-up or other slow links, where a long delay probably
112 indicates a highly asymmetric delay caused by the response
113 waiting behind a lot of packets related to a download of some
114 sort).
115
116 If the user knows that round trip delays above a certain level
117 should cause the measurement to be ignored, this level can be
118 defined with the maxdelay option. For example, maxdelay 0.3
119 would indicate that measurements with a round-trip delay of 0.3
120 seconds or more should be ignored. The default value is 3
121 seconds and the maximum value is 1000 seconds.
122
123 maxdelayratio ratio
124 This option is similar to the maxdelay option above. chronyd
125 keeps a record of the minimum round-trip delay amongst the
126 previous measurements that it has buffered. If a measurement
127 has a round trip delay that is greater than the maxdelayratio
128 times the minimum delay, it will be rejected.
129
130 maxdelaydevratio ratio
131 If a measurement has a ratio of the increase in the round-trip
132 delay from the minimum delay amongst the previous measurements
133 to the standard deviation of the previous measurements that is
134 greater than the specified ratio, it will be rejected. The
135 default is 10.0.
136
137 mindelay delay
138 This option specifies a fixed minimum round-trip delay to be
139 used instead of the minimum amongst the previous measurements.
140 This can be useful in networks with static configuration to
141 improve the stability of corrections for asymmetric jitter,
142 weighting of the measurements, and the maxdelayratio and
143 maxdelaydevratio tests. The value should be set accurately in
144 order to have a positive effect on the synchronisation.
145
146 asymmetry ratio
147 This option specifies the asymmetry of the network jitter on
148 the path to the source, which is used to correct the measured
149 offset according to the delay. The asymmetry can be between
150 -0.5 and +0.5. A negative value means the delay of packets sent
151 to the source is more variable than the delay of packets sent
152 from the source back. By default, chronyd estimates the
153 asymmetry automatically.
154
155 offset offset
156 This option specifies a correction (in seconds) which will be
157 applied to offsets measured with this source. It’s particularly
158 useful to compensate for a known asymmetry in network delay or
159 timestamping errors. For example, if packets sent to the source
160 were on average delayed by 100 microseconds more than packets
161 sent from the source back, the correction would be -0.00005
162 (-50 microseconds). The default is 0.0.
163
164 minsamples samples
165 Set the minimum number of samples kept for this source. This
166 overrides the minsamples directive.
167
168 maxsamples samples
169 Set the maximum number of samples kept for this source. This
170 overrides the maxsamples directive.
171
172 filter samples
173 This option enables a median filter to reduce noise in NTP
174 measurements. The filter will reduce the specified number of
175 samples to a single sample. It is intended to be used with very
176 short polling intervals in local networks where it is
177 acceptable to generate a lot of NTP traffic.
178
179 offline
180 If the server will not be reachable when chronyd is started,
181 the offline option can be specified. chronyd will not try to
182 poll the server until it is enabled to do so (by using the
183 online command in chronyc).
184
185 auto_offline
186 With this option, the server will be assumed to have gone
187 offline when sending a request fails, e.g. due to a missing
188 route to the network. This option avoids the need to run the
189 offline command from chronyc when disconnecting the network
190 link. (It will still be necessary to use the online command
191 when the link has been established, to enable measurements to
192 start.)
193
194 prefer
195 Prefer this source over sources without the prefer option.
196
197 noselect
198 Never select this source. This is particularly useful for
199 monitoring.
200
201 trust
202 Assume time from this source is always true. It can be rejected
203 as a falseticker in the source selection only if another source
204 with this option does not agree with it.
205
206 require
207 Require that at least one of the sources specified with this
208 option is selectable (i.e. recently reachable and not a
209 falseticker) before updating the clock. Together with the trust
210 option this might be useful to allow a trusted authenticated
211 source to be safely combined with unauthenticated sources in
212 order to improve the accuracy of the clock. They can be
213 selected and used for synchronisation only if they agree with
214 the trusted and required source.
215
216 xleave
217 This option enables an interleaved mode which allows the server
218 or the peer to send transmit timestamps captured after the
219 actual transmission (e.g. when the server or the peer is
220 running chronyd with software (kernel) or hardware
221 timestamping). This can significantly improve the accuracy of
222 the measurements.
223
224 The interleaved mode is compatible with servers that support
225 only the basic mode, but peers must both support and have
226 enabled the interleaved mode, otherwise the synchronisation
227 will work only in one direction. Note that even servers that
228 support the interleaved mode might respond in the basic mode as
229 the interleaved mode requires the servers to keep some state
230 for each client and the state might be dropped when there are
231 too many clients (e.g. clientloglimit is too small), or it
232 might be overwritten by other clients that have the same IP
233 address (e.g. computers behind NAT or someone sending requests
234 with a spoofed source address).
235
236 The xleave option can be combined with the presend option in
237 order to shorten the interval in which the server has to keep
238 the state to be able to respond in the interleaved mode.
239
240 polltarget target
241 Target number of measurements to use for the regression
242 algorithm which chronyd will try to maintain by adjusting the
243 polling interval between minpoll and maxpoll. A higher target
244 makes chronyd prefer shorter polling intervals. The default is
245 8 and a useful range is from 6 to 60.
246
247 port port
248 This option allows the UDP port on which the server understands
249 NTP requests to be specified. For normal servers this option
250 should not be required (the default is 123, the standard NTP
251 port).
252
253 presend poll
254 If the timing measurements being made by chronyd are the only
255 network data passing between two computers, you might find that
256 some measurements are badly skewed due to either the client or
257 the server having to do an ARP lookup on the other party prior
258 to transmitting a packet. This is more of a problem with long
259 sampling intervals, which might be similar in duration to the
260 lifetime of entries in the ARP caches of the machines.
261
262 In order to avoid this problem, the presend option can be used.
263 It takes a single integer argument, which is the smallest
264 polling interval for which an extra pair of NTP packets will be
265 exchanged between the client and the server prior to the actual
266 measurement. For example, with the following option included in
267 a server directive:
268
269 presend 9
270
271 when the polling interval is 512 seconds or more, an extra NTP
272 client packet will be sent to the server a short time (2
273 seconds) before making the actual measurement.
274
275 The presend option cannot be used in the peer directive. If it
276 is used with the xleave option, chronyd will send two extra
277 packets instead of one.
278
279 minstratum stratum
280 When the synchronisation source is selected from available
281 sources, sources with lower stratum are normally slightly
282 preferred. This option can be used to increase stratum of the
283 source to the specified minimum, so chronyd will avoid
284 selecting that source. This is useful with low stratum sources
285 that are known to be unreliable or inaccurate and which should
286 be used only when other sources are unreachable.
287
288 version version
289 This option sets the NTP version of packets sent to the server.
290 This can be useful when the server runs an old NTP
291 implementation that does not respond to requests using a newer
292 version. The default version depends on whether a key is
293 specified by the key option and which authentication hash
294 function the key is using. If the output size of the hash
295 function is longer than 160 bits, the default version is 3 for
296 compatibility with older chronyd servers. Otherwise, the
297 default version is 4.
298
299 pool name [option]...
300 The syntax of this directive is similar to that for the server
301 directive, except that it is used to specify a pool of NTP servers
302 rather than a single NTP server. The pool name is expected to
303 resolve to multiple addresses which might change over time.
304
305 All options valid in the server directive can be used in this
306 directive too. There is one option specific to the pool directive:
307 maxsources sets the maximum number of sources that can be used from
308 the pool, the default value is 4.
309
310 On start, when the pool name is resolved, chronyd will add up to 16
311 sources, one for each resolved address. When the number of sources
312 from which at least one valid reply was received reaches the number
313 specified by the maxsources option, the other sources will be
314 removed. When a pool source is unreachable, marked as a
315 falseticker, or has a distance larger than the limit set by the
316 maxdistance directive, chronyd will try to replace the source with
317 a newly resolved address from the pool.
318
319 An example of the pool directive is
320
321 pool pool.ntp.org iburst maxsources 3
322
323 peer hostname [option]...
324 The syntax of this directive is identical to that for the server
325 directive, except that it specifies a symmetric association with an
326 NTP peer instead of a client/server association with an NTP server.
327 A single symmetric association allows the peers to be both servers
328 and clients to each other. This is mainly useful when the NTP
329 implementation of the peer (e.g. ntpd) supports ephemeral symmetric
330 associations and does not need to be configured with an address of
331 this host. chronyd does not support ephemeral associations.
332
333 When a key is specified by the key option to enable authentication,
334 both peers must use the same key and the same key number.
335
336 Note that the symmetric mode is less secure than the client/server
337 mode. A denial-of-service attack is possible on unauthenticated
338 symmetric associations, i.e. when the peer was specified without
339 the key option. An attacker who does not see network traffic
340 between two hosts, but knows that they are peering with each other,
341 can periodically send them unauthenticated packets with spoofed
342 source addresses in order to disrupt their NTP state and prevent
343 them from synchronising to each other. When the association is
344 authenticated, an attacker who does see the network traffic, but
345 cannot prevent the packets from reaching the other host, can still
346 disrupt the state by replaying old packets. The attacker has
347 effectively the same power as a man-in-the-middle attacker. A
348 partial protection against this attack is implemented in chronyd,
349 which can protect the peers if they are using the same polling
350 interval and they never sent an authenticated packet with a
351 timestamp from future, but it should not be relied on as it is
352 difficult to ensure the conditions are met. If two hosts should be
353 able to synchronise to each other in both directions, it is
354 recommended to use two separate client/server associations
355 (specified by the server directive on both hosts) instead.
356
357 initstepslew step-threshold [hostname]...
358 In normal operation, chronyd slews the time when it needs to adjust
359 the system clock. For example, to correct a system clock which is 1
360 second slow, chronyd slightly increases the amount by which the
361 system clock is advanced on each clock interrupt, until the error
362 is removed. Note that at no time does time run backwards with this
363 method.
364
365 On most Unix systems it is not desirable to step the system clock,
366 because many programs rely on time advancing monotonically
367 forwards.
368
369 When the chronyd daemon is initially started, it is possible that
370 the system clock is considerably in error. Attempting to correct
371 such an error by slewing might not be sensible, since it might take
372 several hours to correct the error by this means.
373
374 The purpose of the initstepslew directive is to allow chronyd to
375 make a rapid measurement of the system clock error at boot time,
376 and to correct the system clock by stepping before normal operation
377 begins. Since this would normally be performed only at an
378 appropriate point in the system boot sequence, no other software
379 should be adversely affected by the step.
380
381 If the correction required is less than a specified threshold, a
382 slew is used instead. This makes it safer to restart chronyd whilst
383 the system is in normal operation.
384
385 The initstepslew directive takes a threshold and a list of NTP
386 servers as arguments. Each of the servers is rapidly polled several
387 times, and a majority voting mechanism used to find the most likely
388 range of system clock error that is present. A step or slew is
389 applied to the system clock to correct this error. chronyd then
390 enters its normal operating mode.
391
392 An example of the use of the directive is:
393
394 initstepslew 30 foo.example.net bar.example.net
395
396 where 2 NTP servers are used to make the measurement. The 30
397 indicates that if the system’s error is found to be 30 seconds or
398 less, a slew will be used to correct it; if the error is above 30
399 seconds, a step will be used.
400
401 The initstepslew directive can also be used in an isolated LAN
402 environment, where the clocks are set manually. The most stable
403 computer is chosen as the master, and the other computers are
404 slaved to it. If each of the slaves is configured with the local
405 directive, the master can be set up with an initstepslew directive
406 which references some or all of the slaves. Then, if the master
407 machine has to be rebooted, the slaves can be relied on to act
408 analogously to a flywheel and preserve the time for a short period
409 while the master completes its reboot.
410
411 The initstepslew directive is functionally similar to a combination
412 of the makestep and server directives with the iburst option. The
413 main difference is that the initstepslew servers are used only
414 before normal operation begins and that the foreground chronyd
415 process waits for initstepslew to finish before exiting. This is
416 useful to prevent programs started in the boot sequence after
417 chronyd from reading the clock before it has been stepped.
418
419 refclock driver parameter[:option,...] [option]...
420 The refclock directive specifies a hardware reference clock to be
421 used as a time source. It has two mandatory parameters, a driver
422 name and a driver-specific parameter. The two parameters are
423 followed by zero or more refclock options. Some drivers have
424 special options, which can be appended to the driver-specific
425 parameter (separated by the : and , characters).
426
427 There are four drivers included in chronyd:
428
429 PPS
430 Driver for the kernel PPS (pulse per second) API. The parameter
431 is the path to the PPS device (typically /dev/pps?). As PPS
432 refclocks do not supply full time, another time source (e.g.
433 NTP server or non-PPS refclock) is needed to complete samples
434 from the PPS refclock. An alternative is to enable the local
435 directive to allow synchronisation with some unknown but
436 constant offset. The driver supports the following option:
437
438 clear
439 By default, the PPS refclock uses assert events (rising
440 edge) for synchronisation. With this option, it will use
441 clear events (falling edge) instead.
442
443
444 Examples:
445
446 refclock PPS /dev/pps0 lock NMEA refid GPS
447 refclock SHM 0 offset 0.5 delay 0.2 refid NMEA noselect
448 refclock PPS /dev/pps1:clear refid GPS2
449
450 SHM
451 NTP shared memory driver. This driver uses a shared memory
452 segment to receive samples from another process (e.g. gpsd).
453 The parameter is the number of the shared memory segment,
454 typically a small number like 0, 1, 2, or 3. The driver
455 supports the following option:
456
457 perm=mode
458 This option specifies the permissions of the shared memory
459 segment created by chronyd. They are specified as a numeric
460 mode. The default value is 0600 (read-write access for
461 owner only).
462
463
464
465 Examples:
466
467 refclock SHM 0 poll 3 refid GPS1
468 refclock SHM 1:perm=0644 refid GPS2
469
470 SOCK
471 Unix domain socket driver. It is similar to the SHM driver, but
472 samples are received from a Unix domain socket instead of
473 shared memory and the messages have a different format. The
474 parameter is the path to the socket, which chronyd creates on
475 start. An advantage over the SHM driver is that SOCK does not
476 require polling and it can receive PPS samples with incomplete
477 time. The format of the messages is described in the
478 refclock_sock.c file in the chrony source code.
479
480 An application which supports the SOCK protocol is the gpsd
481 daemon. The path where gpsd expects the socket to be created is
482 described in the gpsd(8) man page. For example:
483
484 refclock SOCK /var/run/chrony.ttyS0.sock
485
486 PHC
487 PTP hardware clock (PHC) driver. The parameter is the path to
488 the device of the PTP clock which should be used as a time
489 source. If the clock is kept in TAI instead of UTC (e.g. it is
490 synchronised by a PTP daemon), the current UTC-TAI offset needs
491 to be specified by the offset option. Alternatively, the pps
492 refclock option can be enabled to treat the PHC as a PPS
493 refclock, using only the sub-second offset for synchronisation.
494 The driver supports the following options:
495
496 nocrossts
497 This option disables use of precise cross timestamping.
498
499 extpps
500 This option enables a PPS mode in which the PTP clock is
501 timestamping pulses of an external PPS signal connected to
502 the clock. The clock does not need to be synchronised, but
503 another time source is needed to complete the PPS samples.
504 Note that some PTP clocks cannot be configured to timestamp
505 only assert or clear events, and it is necessary to use the
506 width option to filter wrong PPS samples.
507
508 pin=index
509 This option specifies the index of the pin to which is
510 connected the PPS signal. The default value is 0.
511
512 channel=index
513 This option specifies the index of the channel for the PPS
514 mode. The default value is 0.
515
516 clear
517 This option enables timestamping of clear events (falling
518 edge) instead of assert events (rising edge) in the PPS
519 mode. This may not work with some clocks.
520
521
522
523 Examples:
524
525 refclock PHC /dev/ptp0 poll 0 dpoll -2 offset -37
526 refclock PHC /dev/ptp1:nocrossts poll 3 pps
527 refclock PHC /dev/ptp2:extpps,pin=1 width 0.2 poll 2
528
529
530 The refclock directive supports the following options:
531
532 poll poll
533 Timestamps produced by refclock drivers are not used
534 immediately, but they are stored and processed by a median
535 filter in the polling interval specified by this option. This
536 is defined as a power of 2 and can be negative to specify a
537 sub-second interval. The default is 4 (16 seconds). A shorter
538 interval allows chronyd to react faster to changes in the
539 frequency of the system clock, but it might have a negative
540 effect on its accuracy if the samples have a lot of jitter.
541
542 dpoll dpoll
543 Some drivers do not listen for external events and try to
544 produce samples in their own polling interval. This is defined
545 as a power of 2 and can be negative to specify a sub-second
546 interval. The default is 0 (1 second).
547
548 refid refid
549 This option is used to specify the reference ID of the
550 refclock, as up to four ASCII characters. The default reference
551 ID is composed from the first three characters of the driver
552 name and the number of the refclock. Each refclock must have a
553 unique reference ID.
554
555 lock refid
556 This option can be used to lock a PPS refclock to another
557 refclock, which is specified by its reference ID. In this mode
558 received PPS samples are paired directly with raw samples from
559 the specified refclock.
560
561 rate rate
562 This option sets the rate of the pulses in the PPS signal (in
563 Hz). This option controls how the pulses will be completed with
564 real time. To actually receive more than one pulse per second,
565 a negative dpoll has to be specified (-3 for a 5Hz signal). The
566 default is 1.
567
568 maxlockage pulses
569 This option specifies in number of pulses how old can be
570 samples from the refclock specified by the lock option to be
571 paired with the pulses. Increasing this value is useful when
572 the samples are produced at a lower rate than the pulses. The
573 default is 2.
574
575 width width
576 This option specifies the width of the pulses (in seconds). It
577 is used to filter PPS samples when the driver provides samples
578 for both rising and falling edges. Note that it reduces the
579 maximum allowed error of the time source which completes the
580 PPS samples. If the duty cycle is configurable, 50% should be
581 preferred in order to maximise the allowed error.
582
583 pps
584 This options forces chronyd to treat any refclock (e.g. SHM or
585 PHC) as a PPS refclock. This can be useful when the refclock
586 provides time with a variable offset of a whole number of
587 seconds (e.g. it uses TAI instead of UTC). Another time source
588 is needed to complete samples from the refclock.
589
590 offset offset
591 This option can be used to compensate for a constant error. The
592 specified offset (in seconds) is applied to all samples
593 produced by the reference clock. The default is 0.0.
594
595 delay delay
596 This option sets the NTP delay of the source (in seconds). Half
597 of this value is included in the maximum assumed error which is
598 used in the source selection algorithm. Increasing the delay is
599 useful to avoid having no majority in the source selection or
600 to make it prefer other sources. The default is 1e-9 (1
601 nanosecond).
602
603 stratum stratum
604 This option sets the NTP stratum of the refclock. This can be
605 useful when the refclock provides time with a stratum other
606 than 0. The default is 0.
607
608 precision precision
609 This option sets the precision of the reference clock (in
610 seconds). The default value is the estimated precision of the
611 system clock.
612
613 maxdispersion dispersion
614 Maximum allowed dispersion for filtered samples (in seconds).
615 Samples with larger estimated dispersion are ignored. By
616 default, this limit is disabled.
617
618 filter samples
619 This option sets the length of the median filter which is used
620 to reduce the noise in the measurements. With each poll about
621 40 percent of the stored samples are discarded and one final
622 sample is calculated as an average of the remaining samples. If
623 the length is 4 or more, at least 4 samples have to be
624 collected between polls. For lengths below 4, the filter has to
625 be full. The default is 64.
626
627 prefer
628 Prefer this source over sources without the prefer option.
629
630 noselect
631 Never select this source. This is useful for monitoring or with
632 sources which are not very accurate, but are locked with a PPS
633 refclock.
634
635 trust
636 Assume time from this source is always true. It can be rejected
637 as a falseticker in the source selection only if another source
638 with this option does not agree with it.
639
640 require
641 Require that at least one of the sources specified with this
642 option is selectable (i.e. recently reachable and not a
643 falseticker) before updating the clock. Together with the trust
644 option this can be useful to allow a trusted, but not very
645 precise, reference clock to be safely combined with
646 unauthenticated NTP sources in order to improve the accuracy of
647 the clock. They can be selected and used for synchronisation
648 only if they agree with the trusted and required source.
649
650 tai
651 This option indicates that the reference clock keeps time in
652 TAI instead of UTC and that chronyd should correct its offset
653 by the current TAI-UTC offset. The leapsectz directive must be
654 used with this option and the database must be kept up to date
655 in order for this correction to work as expected. This option
656 does not make sense with PPS refclocks.
657
658 minsamples samples
659 Set the minimum number of samples kept for this source. This
660 overrides the minsamples directive.
661
662 maxsamples samples
663 Set the maximum number of samples kept for this source. This
664 overrides the maxsamples directive.
665
666 manual
667 The manual directive enables support at run-time for the settime
668 command in chronyc. If no manual directive is included, any attempt
669 to use the settime command in chronyc will be met with an error
670 message.
671
672 Note that the settime command can be enabled at run-time using the
673 manual command in chronyc. (The idea of the two commands is that
674 the manual command controls the manual clock driver’s behaviour,
675 whereas the settime command allows samples of manually entered time
676 to be provided.)
677
678 acquisitionport port
679 By default, chronyd uses a separate client socket for each
680 configured server and their source port is chosen arbitrarily by
681 the operating system. However, you can use the acquisitionport
682 directive to explicitly specify a port and use only one socket (per
683 IPv4 or IPv6 address family) for all configured servers. This can
684 be useful for getting through some firewalls. If set to 0, the
685 source port of the socket will be chosen arbitrarily.
686
687 It can be set to the same port as is used by the NTP server (which
688 can be configured with the port directive) to use only one socket
689 for all NTP packets.
690
691 An example of the acquisitionport directive is:
692
693 acquisitionport 1123
694
695 This would change the source port used for client requests to UDP
696 port 1123. You could then persuade the firewall administrator to
697 open that port.
698
699 bindacqaddress address
700 The bindacqaddress directive sets the network interface to which
701 chronyd will bind its NTP client sockets. The syntax is similar to
702 the bindaddress and bindcmdaddress directives.
703
704 For each of the IPv4 and IPv6 protocols, only one bindacqaddress
705 directive can be specified.
706
707 dumpdir directory
708 To compute the rate of gain or loss of time, chronyd has to store a
709 measurement history for each of the time sources it uses.
710
711 All supported systems, with the exception of macOS 10.12 and
712 earlier, have operating system support for setting the rate of gain
713 or loss to compensate for known errors. (On macOS 10.12 and
714 earlier, chronyd must simulate such a capability by periodically
715 slewing the system clock forwards or backwards by a suitable amount
716 to compensate for the error built up since the previous slew.)
717
718 For such systems, it is possible to save the measurement history
719 across restarts of chronyd (assuming no changes are made to the
720 system clock behaviour whilst it is not running). The dumpdir
721 directive defines the directory where the measurement histories are
722 saved when chronyd exits, or the dump command in chronyc is issued.
723
724 An example of the directive is:
725
726 dumpdir /var/run/chrony
727
728 A source whose IP address is 1.2.3.4 would have its measurement
729 history saved in the file /var/run/chrony/1.2.3.4.dat. History of
730 reference clocks is saved to files named by their reference ID in
731 form of refid:XXXXXXXX.dat.
732
733 maxsamples samples
734 The maxsamples directive sets the default maximum number of samples
735 that chronyd should keep for each source. This setting can be
736 overridden for individual sources in the server and refclock
737 directives. The default value is 0, which disables the configurable
738 limit. The useful range is 4 to 64.
739
740 minsamples samples
741 The minsamples directive sets the default minimum number of samples
742 that chronyd should keep for each source. This setting can be
743 overridden for individual sources in the server and refclock
744 directives. The default value is 6. The useful range is 4 to 64.
745
746 Forcing chronyd to keep more samples than it would normally keep
747 reduces noise in the estimated frequency and offset, but slows down
748 the response to changes in the frequency and offset of the clock.
749 The offsets in the tracking and sourcestats reports (and the
750 tracking.log and statistics.log files) may be smaller than the
751 actual offsets.
752
753 Source selection
754 combinelimit limit
755 When chronyd has multiple sources available for synchronisation, it
756 has to select one source as the synchronisation source. The
757 measured offsets and frequencies of the system clock relative to
758 the other sources, however, can be combined with the selected
759 source to improve the accuracy of the system clock.
760
761 The combinelimit directive limits which sources are included in the
762 combining algorithm. Their synchronisation distance has to be
763 shorter than the distance of the selected source multiplied by the
764 value of the limit. Also, their measured frequencies have to be
765 close to the frequency of the selected source.
766
767 By default, the limit is 3. Setting the limit to 0 effectively
768 disables the source combining algorithm and only the selected
769 source will be used to control the system clock.
770
771 maxdistance distance
772 The maxdistance directive sets the maximum allowed root distance of
773 the sources to not be rejected by the source selection algorithm.
774 The distance includes the accumulated dispersion, which might be
775 large when the source is no longer synchronised, and half of the
776 total round-trip delay to the primary source.
777
778 By default, the maximum root distance is 3 seconds.
779
780 Setting maxdistance to a larger value can be useful to allow
781 synchronisation with a server that only has a very infrequent
782 connection to its sources and can accumulate a large dispersion
783 between updates of its clock.
784
785 maxjitter jitter
786 The maxjitter directive sets the maximum allowed jitter of the
787 sources to not be rejected by the source selection algorithm. This
788 prevents synchronisation with sources that have a small root
789 distance, but their time is too variable.
790
791 By default, the maximum jitter is 1 second.
792
793 minsources sources
794 The minsources directive sets the minimum number of sources that
795 need to be considered as selectable in the source selection
796 algorithm before the local clock is updated. The default value is
797 1.
798
799 Setting this option to a larger number can be used to improve the
800 reliability. More sources will have to agree with each other and
801 the clock will not be updated when only one source (which could be
802 serving incorrect time) is reachable.
803
804 reselectdist distance
805 When chronyd selects a synchronisation source from available
806 sources, it will prefer the one with the shortest synchronisation
807 distance. However, to avoid frequent reselecting when there are
808 sources with similar distance, a fixed distance is added to the
809 distance for sources that are currently not selected. This can be
810 set with the reselectdist directive. By default, the distance is
811 100 microseconds.
812
813 stratumweight distance
814 The stratumweight directive sets how much distance should be added
815 per stratum to the synchronisation distance when chronyd selects
816 the synchronisation source from available sources.
817
818 By default, the weight is 0.001 seconds. This means that the
819 stratum of the sources in the selection process matters only when
820 the differences between the distances are in milliseconds.
821
822 System clock
823 corrtimeratio ratio
824 When chronyd is slewing the system clock to correct an offset, the
825 rate at which it is slewing adds to the frequency error of the
826 clock. On all supported systems, with the exception of macOS 12 and
827 earlier, this rate can be controlled.
828
829 The corrtimeratio directive sets the ratio between the duration in
830 which the clock is slewed for an average correction according to
831 the source history and the interval in which the corrections are
832 done (usually the NTP polling interval). Corrections larger than
833 the average take less time and smaller corrections take more time,
834 the amount of the correction and the correction time are inversely
835 proportional.
836
837 Increasing corrtimeratio improves the overall frequency error of
838 the system clock, but increases the overall time error as the
839 corrections take longer.
840
841 By default, the ratio is set to 3, the time accuracy of the clock
842 is preferred over its frequency accuracy.
843
844 The maximum allowed slew rate can be set by the maxslewrate
845 directive. The current remaining correction is shown in the
846 tracking report as the System time value.
847
848 driftfile file
849 One of the main activities of the chronyd program is to work out
850 the rate at which the system clock gains or loses time relative to
851 real time.
852
853 Whenever chronyd computes a new value of the gain or loss rate, it
854 is desirable to record it somewhere. This allows chronyd to begin
855 compensating the system clock at that rate whenever it is
856 restarted, even before it has had a chance to obtain an equally
857 good estimate of the rate during the new run. (This process can
858 take many minutes, at least.)
859
860 The driftfile directive allows a file to be specified into which
861 chronyd can store the rate information. Two parameters are recorded
862 in the file. The first is the rate at which the system clock gains
863 or loses time, expressed in parts per million, with gains positive.
864 Therefore, a value of 100.0 indicates that when the system clock
865 has advanced by a second, it has gained 100 microseconds in reality
866 (so the true time has only advanced by 999900 microseconds). The
867 second is an estimate of the error bound around the first value in
868 which the true rate actually lies.
869
870 An example of the driftfile directive is:
871
872 driftfile /var/lib/chrony/drift
873
874 fallbackdrift min-interval max-interval
875 Fallback drifts are long-term averages of the system clock drift
876 calculated over exponentially increasing intervals. They are used
877 to avoid quickly drifting away from true time when the clock was
878 not updated for a longer period of time and there was a short-term
879 deviation in the drift before the updates stopped.
880
881 The directive specifies the minimum and maximum interval since the
882 last clock update to switch between fallback drifts. They are
883 defined as a power of 2 (in seconds). The syntax is as follows:
884
885 fallbackdrift 16 19
886
887 In this example, the minimum interval is 16 (18 hours) and the
888 maximum interval is 19 (6 days). The system clock frequency will be
889 set to the first fallback 18 hours after last clock update, to the
890 second after 36 hours, and so on. This might be a good setting to
891 cover frequency changes due to daily and weekly temperature
892 fluctuations. When the frequency is set to a fallback, the state of
893 the clock will change to ‘Not synchronised’.
894
895 By default (or if the specified maximum or minimum is 0), no
896 fallbacks are used and the clock frequency changes only with new
897 measurements from NTP sources, reference clocks, or manual input.
898
899 leapsecmode mode
900 A leap second is an adjustment that is occasionally applied to UTC
901 to keep it close to the mean solar time. When a leap second is
902 inserted, the last day of June or December has an extra second
903 23:59:60.
904
905 For computer clocks that is a problem. The Unix time is defined as
906 number of seconds since 00:00:00 UTC on 1 January 1970 without leap
907 seconds. The system clock cannot have time 23:59:60, every minute
908 has 60 seconds and every day has 86400 seconds by definition. The
909 inserted leap second is skipped and the clock is suddenly ahead of
910 UTC by one second. The leapsecmode directive selects how that error
911 is corrected. There are four options:
912
913 system
914 When inserting a leap second, the kernel steps the system clock
915 backwards by one second when the clock gets to 00:00:00 UTC.
916 When deleting a leap second, it steps forward by one second
917 when the clock gets to 23:59:59 UTC. This is the default mode
918 when the system driver supports leap seconds (i.e. all
919 supported systems with the exception of macOS 12 and earlier).
920
921 step
922 This is similar to the system mode, except the clock is stepped
923 by chronyd instead of the kernel. It can be useful to avoid
924 bugs in the kernel code that would be executed in the system
925 mode. This is the default mode when the system driver does not
926 support leap seconds.
927
928 slew
929 The clock is corrected by slewing started at 00:00:00 UTC when
930 a leap second is inserted or 23:59:59 UTC when a leap second is
931 deleted. This might be preferred over the system and step modes
932 when applications running on the system are sensitive to jumps
933 in the system time and it is acceptable that the clock will be
934 off for a longer time. On Linux with the default maxslewrate
935 value the correction takes 12 seconds.
936
937 ignore
938 No correction is applied to the clock for the leap second. The
939 clock will be corrected later in normal operation when new
940 measurements are made and the estimated offset includes the one
941 second error.
942
943
944
945 When serving time to NTP clients that cannot be configured to
946 correct their clocks for a leap second by slewing, or to clients
947 that would correct at slightly different rates when it is necessary
948 to keep them close together, the slew mode can be combined with the
949 smoothtime directive to enable a server leap smear.
950
951 When smearing a leap second, the leap status is suppressed on the
952 server and the served time is corrected slowly be slewing instead
953 of stepping. The clients do not need any special configuration as
954 they do not know there is any leap second and they follow the
955 server time which eventually brings them back to UTC. Care must be
956 taken to ensure they use only NTP servers which smear the leap
957 second in exactly the same way for synchronisation.
958
959 This feature must be used carefully, because the server is
960 intentionally not serving its best estimate of the true time.
961
962 A recommended configuration to enable a server leap smear is:
963
964 leapsecmode slew
965 maxslewrate 1000
966 smoothtime 400 0.001 leaponly
967
968 The first directive is necessary to disable the clock step which
969 would reset the smoothing process. The second directive limits the
970 slewing rate of the local clock to 1000 ppm, which improves the
971 stability of the smoothing process when the local correction starts
972 and ends. The third directive enables the server time smoothing
973 process. It will start when the clock gets to 00:00:00 UTC and it
974 will take 17 hours 34 minutes to finish. The frequency offset will
975 be changing by 0.001 ppm per second and will reach a maximum of
976 31.623 ppm. The leaponly option makes the duration of the leap
977 smear constant and allows the clients to safely synchronise with
978 multiple identically configured leap smearing servers.
979
980 leapsectz timezone
981 This directive specifies a timezone in the system tz database which
982 chronyd can use to determine when will the next leap second occur
983 and what is the current offset between TAI and UTC. It will
984 periodically check if 23:59:59 and 23:59:60 are valid times in the
985 timezone. This typically works with the right/UTC timezone.
986
987 When a leap second is announced, the timezone needs to be updated
988 at least 12 hours before the leap second. It is not necessary to
989 restart chronyd.
990
991 This directive is useful with reference clocks and other time
992 sources which do not announce leap seconds, or announce them too
993 late for an NTP server to forward them to its own clients. Clients
994 of leap smearing servers must not use this directive.
995
996 It is also useful when the system clock is required to have correct
997 TAI-UTC offset. Note that the offset is set only when leap seconds
998 are handled by the kernel, i.e. leapsecmode is set to system.
999
1000 The specified timezone is not used as an exclusive source of
1001 information about leap seconds. If a majority of time sources
1002 announce on the last day of June or December that a leap second
1003 should be inserted or deleted, it will be accepted even if it is
1004 not included in the timezone.
1005
1006 An example of the directive is:
1007
1008 leapsectz right/UTC
1009
1010 The following shell command verifies that the timezone contains
1011 leap seconds and can be used with this directive:
1012
1013 $ TZ=right/UTC date -d 'Dec 31 2008 23:59:60'
1014 Wed Dec 31 23:59:60 UTC 2008
1015
1016 makestep threshold limit
1017 Normally chronyd will cause the system to gradually correct any
1018 time offset, by slowing down or speeding up the clock as required.
1019 In certain situations, the system clock might be so far adrift that
1020 this slewing process would take a very long time to correct the
1021 system clock.
1022
1023 This directive forces chronyd to step the system clock if the
1024 adjustment is larger than a threshold value, but only if there were
1025 no more clock updates since chronyd was started than a specified
1026 limit (a negative value can be used to disable the limit).
1027
1028 This is particularly useful when using reference clocks, because
1029 the initstepslew directive works only with NTP sources.
1030
1031 An example of the use of this directive is:
1032
1033 makestep 0.1 3
1034
1035 This would step the system clock if the adjustment is larger than
1036 0.1 seconds, but only in the first three clock updates.
1037
1038 maxchange offset start ignore
1039 This directive sets the maximum allowed offset corrected on a clock
1040 update. The check is performed only after the specified number of
1041 updates to allow a large initial adjustment of the system clock.
1042 When an offset larger than the specified maximum occurs, it will be
1043 ignored for the specified number of times and then chronyd will
1044 give up and exit (a negative value can be used to never exit). In
1045 both cases a message is sent to syslog.
1046
1047 An example of the use of this directive is:
1048
1049 maxchange 1000 1 2
1050
1051 After the first clock update, chronyd will check the offset on
1052 every clock update, it will ignore two adjustments larger than 1000
1053 seconds and exit on another one.
1054
1055 maxclockerror error-in-ppm
1056 The maxclockerror directive sets the maximum assumed frequency
1057 error that the system clock can gain on its own between clock
1058 updates. It describes the stability of the clock.
1059
1060 By default, the maximum error is 1 ppm.
1061
1062 Typical values for error-in-ppm might be 10 for a low quality clock
1063 and 0.1 for a high quality clock using a temperature compensated
1064 crystal oscillator.
1065
1066 maxdrift drift-in-ppm
1067 This directive specifies the maximum assumed drift (frequency
1068 error) of the system clock. It limits the frequency adjustment that
1069 chronyd is allowed to use to correct the measured drift. It is an
1070 additional limit to the maximum adjustment that can be set by the
1071 system driver (100000 ppm on Linux, 500 ppm on FreeBSD, NetBSD, and
1072 macOS 10.13+, 32500 ppm on Solaris).
1073
1074 By default, the maximum assumed drift is 500000 ppm, i.e. the
1075 adjustment is limited by the system driver rather than this
1076 directive.
1077
1078 maxupdateskew skew-in-ppm
1079 One of chronyd’s tasks is to work out how fast or slow the
1080 computer’s clock runs relative to its reference sources. In
1081 addition, it computes an estimate of the error bounds around the
1082 estimated value.
1083
1084 If the range of error is too large, it probably indicates that the
1085 measurements have not settled down yet, and that the estimated gain
1086 or loss rate is not very reliable.
1087
1088 The maxupdateskew directive sets the threshold for determining
1089 whether an estimate might be so unreliable that it should not be
1090 used. By default, the threshold is 1000 ppm.
1091
1092 Typical values for skew-in-ppm might be 100 for a dial-up
1093 connection to servers over a phone line, and 5 or 10 for a computer
1094 on a LAN.
1095
1096 It should be noted that this is not the only means of protection
1097 against using unreliable estimates. At all times, chronyd keeps
1098 track of both the estimated gain or loss rate, and the error bound
1099 on the estimate. When a new estimate is generated following another
1100 measurement from one of the sources, a weighted combination
1101 algorithm is used to update the master estimate. So if chronyd has
1102 an existing highly-reliable master estimate and a new estimate is
1103 generated which has large error bounds, the existing master
1104 estimate will dominate in the new master estimate.
1105
1106 maxslewrate rate-in-ppm
1107 The maxslewrate directive sets the maximum rate at which chronyd is
1108 allowed to slew the time. It limits the slew rate controlled by the
1109 correction time ratio (which can be set by the corrtimeratio
1110 directive) and is effective only on systems where chronyd is able
1111 to control the rate (i.e. all supported systems with the exception
1112 of macOS 12 or earlier).
1113
1114 For each system there is a maximum frequency offset of the clock
1115 that can be set by the driver. On Linux it is 100000 ppm, on
1116 FreeBSD, NetBSD and macOS 10.13+ it is 5000 ppm, and on Solaris it
1117 is 32500 ppm. Also, due to a kernel limitation, setting maxslewrate
1118 on FreeBSD, NetBSD, macOS 10.13+ to a value between 500 ppm and
1119 5000 ppm will effectively set it to 500 ppm.
1120
1121 In early beta releases of macOS 13 this capability is disabled
1122 because of a system kernel bug. When the kernel bug is fixed,
1123 chronyd will detect this and re-enable the capability (see above
1124 limitations) with no recompilation required.
1125
1126 By default, the maximum slew rate is set to 83333.333 ppm (one
1127 twelfth).
1128
1129 tempcomp file interval T0 k0 k1 k2, tempcomp file interval points-file
1130 Normally, changes in the rate of drift of the system clock are
1131 caused mainly by changes in the temperature of the crystal
1132 oscillator on the motherboard.
1133
1134 If there are temperature measurements available from a sensor close
1135 to the oscillator, the tempcomp directive can be used to compensate
1136 for the changes in the temperature and improve the stability and
1137 accuracy of the clock.
1138
1139 The result depends on many factors, including the resolution of the
1140 sensor, the amount of noise in the measurements, the polling
1141 interval of the time source, the compensation update interval, how
1142 well the compensation is specified, and how close the sensor is to
1143 the oscillator. When it is working well, the frequency reported in
1144 the tracking.log file is more stable and the maximum reached offset
1145 is smaller.
1146
1147 There are two forms of the directive. The first one has six
1148 parameters: a path to the file containing the current temperature
1149 from the sensor (in text format), the compensation update interval
1150 (in seconds), and temperature coefficients T0, k0, k1, k2.
1151
1152 The frequency compensation is calculated (in ppm) as
1153
1154 k0 + (T - T0) * k1 + (T - T0)^2 * k2
1155
1156 The result has to be between -10 ppm and 10 ppm, otherwise the
1157 measurement is considered invalid and will be ignored. The k0
1158 coefficient can be adjusted to keep the compensation in that range.
1159
1160 An example of the use is:
1161
1162 tempcomp /sys/class/hwmon/hwmon0/temp2_input 30 26000 0.0 0.000183 0.0
1163
1164 The measured temperature will be read from the file in the Linux
1165 sysfs filesystem every 30 seconds. When the temperature is 26000
1166 (26 degrees Celsius), the frequency correction will be zero. When
1167 it is 27000 (27 degrees Celsius), the clock will be set to run
1168 faster by 0.183 ppm, etc.
1169
1170 The second form has three parameters: the path to the sensor file,
1171 the update interval, and a path to a file containing a list of
1172 (temperature, compensation) points, from which the compensation is
1173 linearly interpolated or extrapolated.
1174
1175 An example is:
1176
1177 tempcomp /sys/class/hwmon/hwmon0/temp2_input 30 /etc/chrony.tempcomp
1178
1179 where the /etc/chrony.tempcomp file could have
1180
1181 20000 1.0
1182 21000 0.64
1183 22000 0.36
1184 23000 0.16
1185 24000 0.04
1186 25000 0.0
1187 26000 0.04
1188 27000 0.16
1189 28000 0.36
1190 29000 0.64
1191 30000 1.0
1192
1193 Valid measurements with corresponding compensations are logged to
1194 the tempcomp.log file if enabled by the log tempcomp directive.
1195
1196 NTP server
1197 allow [all] [subnet]
1198 The allow directive is used to designate a particular subnet from
1199 which NTP clients are allowed to access the computer as an NTP
1200 server.
1201
1202 The default is that no clients are allowed access, i.e. chronyd
1203 operates purely as an NTP client. If the allow directive is used,
1204 chronyd will be both a client of its servers, and a server to other
1205 clients.
1206
1207 Examples of the use of the directive are as follows:
1208
1209 allow 1.2.3.4
1210 allow 1.2
1211 allow 3.4.5
1212 allow 6.7.8/22
1213 allow 6.7.8.9/22
1214 allow 2001:db8::/32
1215 allow 0/0
1216 allow ::/0
1217 allow
1218
1219 The first directive allows a node with IPv4 address 1.2.3.4 to be
1220 an NTP client of this computer. The second directive allows any
1221 node with an IPv4 address of the form 1.2.x.y (with x and y
1222 arbitrary) to be an NTP client of this computer. Likewise, the
1223 third directive allows any node with an IPv4 address of the form
1224 3.4.5.x to have client NTP access. The fourth and fifth forms allow
1225 access from any node with an IPv4 address of the form 6.7.8.x,
1226 6.7.9.x, 6.7.10.x or 6.7.11.x (with x arbitrary), i.e. the value 22
1227 is the number of bits defining the specified subnet. In the fifth
1228 form, the final byte is ignored. The sixth form is used for IPv6
1229 addresses. The seventh and eighth forms allow access by any IPv4
1230 and IPv6 node respectively. The ninth forms allows access by any
1231 node (IPv4 or IPv6).
1232
1233 A second form of the directive, allow all, has a greater effect,
1234 depending on the ordering of directives in the configuration file.
1235 To illustrate the effect, consider the two examples:
1236
1237 allow 1.2.3.4
1238 deny 1.2.3
1239 allow 1.2
1240
1241 and
1242
1243 allow 1.2.3.4
1244 deny 1.2.3
1245 allow all 1.2
1246
1247 In the first example, the effect is the same regardless of what
1248 order the three directives are given in. So the 1.2.x.y subnet is
1249 allowed access, except for the 1.2.3.x subnet, which is denied
1250 access, however the host 1.2.3.4 is allowed access.
1251
1252 In the second example, the allow all 1.2 directives overrides the
1253 effect of any previous directive relating to a subnet within the
1254 specified subnet. Within a configuration file this capability is
1255 probably rather moot; however, it is of greater use for
1256 reconfiguration at run-time via chronyc with the allow all command.
1257
1258 The directive allows a hostname to be specified instead of an IP
1259 address, but the name must be resolvable when chronyd is started
1260 (i.e. chronyd needs to be started when the network is already up
1261 and DNS is working).
1262
1263 Note, if the initstepslew directive is used in the configuration
1264 file, each of the computers listed in that directive must allow
1265 client access by this computer for it to work.
1266
1267 deny [all] [subnet]
1268 This is similar to the allow directive, except that it denies NTP
1269 client access to a particular subnet or host, rather than allowing
1270 it.
1271
1272 The syntax is identical.
1273
1274 There is also a deny all directive with similar behaviour to the
1275 allow all directive.
1276
1277 bindaddress address
1278 The bindaddress directive binds the socket on which chronyd listens
1279 for NTP requests to a local address of the computer. On systems
1280 other than Linux, the address of the computer needs to be already
1281 configured when chronyd is started.
1282
1283 An example of the use of the directive is:
1284
1285 bindaddress 192.168.1.1
1286
1287 Currently, for each of the IPv4 and IPv6 protocols, only one
1288 bindaddress directive can be specified. Therefore, it is not useful
1289 on computers which should serve NTP on multiple network interfaces.
1290
1291 broadcast interval address [port]
1292 The broadcast directive is used to declare a broadcast address to
1293 which chronyd should send packets in the NTP broadcast mode (i.e.
1294 make chronyd act as a broadcast server). Broadcast clients on that
1295 subnet will be able to synchronise.
1296
1297 The syntax is as follows:
1298
1299 broadcast 30 192.168.1.255
1300 broadcast 60 192.168.2.255 12123
1301 broadcast 60 ff02::101
1302
1303 In the first example, the destination port defaults to UDP port 123
1304 (the normal NTP port). In the second example, the destination port
1305 is specified as 12123. The first parameter in each case (30 or 60
1306 respectively) is the interval in seconds between broadcast packets
1307 being sent. The second parameter in each case is the broadcast
1308 address to send the packet to. This should correspond to the
1309 broadcast address of one of the network interfaces on the computer
1310 where chronyd is running.
1311
1312 You can have more than 1 broadcast directive if you have more than
1313 1 network interface onto which you want to send NTP broadcast
1314 packets.
1315
1316 chronyd itself cannot act as a broadcast client; it must always be
1317 configured as a point-to-point client by defining specific NTP
1318 servers and peers. This broadcast server feature is intended for
1319 providing a time source to other NTP implementations.
1320
1321 If ntpd is used as the broadcast client, it will try to measure the
1322 round-trip delay between the server and client with normal client
1323 mode packets. Thus, the broadcast subnet should also be the subject
1324 of an allow directive.
1325
1326 clientloglimit limit
1327 This directive specifies the maximum amount of memory that chronyd
1328 is allowed to allocate for logging of client accesses and the state
1329 that chronyd as an NTP server needs to support the interleaved mode
1330 for its clients. The default limit is 524288 bytes, which is
1331 sufficient for monitoring about four thousand clients at the same
1332 time.
1333
1334 In older chrony versions if the limit was set to 0, the memory
1335 allocation was unlimited.
1336
1337 An example of the use of this directive is:
1338
1339 clientloglimit 1048576
1340
1341 noclientlog
1342 This directive, which takes no arguments, specifies that client
1343 accesses are not to be logged. Normally they are logged, allowing
1344 statistics to be reported using the clients command in chronyc.
1345 This option also effectively disables server support for the NTP
1346 interleaved mode.
1347
1348 local [option]...
1349 The local directive enables a local reference mode, which allows
1350 chronyd operating as an NTP server to appear synchronised to real
1351 time (from the viewpoint of clients polling it), even when it was
1352 never synchronised or the last update of the clock happened a long
1353 time ago.
1354
1355 This directive is normally used in an isolated network, where
1356 computers are required to be synchronised to one another, but not
1357 necessarily to real time. The server can be kept vaguely in line
1358 with real time by manual input.
1359
1360 The local directive has the following options:
1361
1362 stratum stratum
1363 This option sets the stratum of the server which will be
1364 reported to clients when the local reference is active. The
1365 specified value is in the range 1 through 15, and the default
1366 value is 10. It should be larger than the maximum expected
1367 stratum in the network when external NTP servers are
1368 accessible.
1369
1370 Stratum 1 indicates a computer that has a true real-time
1371 reference directly connected to it (e.g. GPS, atomic clock,
1372 etc.), such computers are expected to be very close to real
1373 time. Stratum 2 computers are those which have a stratum 1
1374 server; stratum 3 computers have a stratum 2 server and so on.
1375 A value of 10 indicates that the clock is so many hops away
1376 from a reference clock that its time is fairly unreliable.
1377
1378 distance distance
1379 This option sets the threshold for the root distance which will
1380 activate the local reference. If chronyd was synchronised to
1381 some source, the local reference will not be activated until
1382 its root distance reaches the specified value (the rate at
1383 which the distance is increasing depends on how well the clock
1384 was tracking the source). The default value is 1 second.
1385
1386 The current root distance can be calculated from root delay and
1387 root dispersion (reported by the tracking command in chronyc)
1388 as:
1389
1390 distance = delay / 2 + dispersion
1391
1392 orphan
1393 This option enables a special ‘orphan’ mode, where sources with
1394 stratum equal to the local stratum are assumed to not serve
1395 real time. They are ignored unless no other source is
1396 selectable and their reference IDs are smaller than the local
1397 reference ID.
1398
1399 This allows multiple servers in the network to use the same
1400 local configuration and to be synchronised to one another,
1401 without confusing clients that poll more than one server. Each
1402 server needs to be configured to poll all other servers with
1403 the local directive. This ensures only the server with the
1404 smallest reference ID has the local reference active and others
1405 are synchronised to it. When that server fails, another will
1406 take over.
1407
1408 The orphan mode is compatible with the ntpd’s orphan mode
1409 (enabled by the tos orphan command).
1410
1411
1412
1413 An example of the directive is:
1414
1415 local stratum 10 orphan
1416
1417 ntpsigndsocket directory
1418 This directive specifies the location of the Samba ntp_signd socket
1419 when it is running as a Domain Controller (DC). If chronyd is
1420 compiled with this feature, responses to MS-SNTP clients will be
1421 signed by the smbd daemon.
1422
1423 Note that MS-SNTP requests are not authenticated and any client
1424 that is allowed to access the server by the allow directive, or the
1425 allow command in chronyc, can get an MS-SNTP response signed with a
1426 trust account’s password and try to crack the password in a
1427 brute-force attack. Access to the server should be carefully
1428 controlled.
1429
1430 An example of the directive is:
1431
1432 ntpsigndsocket /var/lib/samba/ntp_signd
1433
1434 port port
1435 This option allows you to configure the port on which chronyd will
1436 listen for NTP requests. The port will be open only when an address
1437 is allowed by the allow directive or the allow command in chronyc,
1438 an NTP peer is configured, or the broadcast server mode is enabled.
1439
1440 The default value is 123, the standard NTP port. If set to 0,
1441 chronyd will never open the server port and will operate strictly
1442 in a client-only mode. The source port used in NTP client requests
1443 can be set by the acquisitionport directive.
1444
1445 ratelimit [option]...
1446 This directive enables response rate limiting for NTP packets. Its
1447 purpose is to reduce network traffic with misconfigured or broken
1448 NTP clients that are polling the server too frequently. The limits
1449 are applied to individual IP addresses. If multiple clients share
1450 one IP address (e.g. multiple hosts behind NAT), the sum of their
1451 traffic will be limited. If a client that increases its polling
1452 rate when it does not receive a reply is detected, its rate
1453 limiting will be temporarily suspended to avoid increasing the
1454 overall amount of traffic. The maximum number of IP addresses which
1455 can be monitored at the same time depends on the memory limit set
1456 by the clientloglimit directive.
1457
1458 The ratelimit directive supports a number of options (which can be
1459 defined in any order):
1460
1461 interval
1462 This option sets the minimum interval between responses. It is
1463 defined as a power of 2 in seconds. The default value is 3 (8
1464 seconds). The minimum value is -19 (524288 packets per second)
1465 and the maximum value is 12 (one packet per 4096 seconds). Note
1466 that with values below -4 the rate limiting is coarse
1467 (responses are allowed in bursts, even if the interval between
1468 them is shorter than the specified interval).
1469
1470 burst
1471 This option sets the maximum number of responses that can be
1472 sent in a burst, temporarily exceeding the limit specified by
1473 the interval option. This is useful for clients that make rapid
1474 measurements on start (e.g. chronyd with the iburst option).
1475 The default value is 8. The minimum value is 1 and the maximum
1476 value is 255.
1477
1478 leak
1479 This option sets the rate at which responses are randomly
1480 allowed even if the limits specified by the interval and burst
1481 options are exceeded. This is necessary to prevent an attacker
1482 who is sending requests with a spoofed source address from
1483 completely blocking responses to that address. The leak rate is
1484 defined as a power of 1/2 and it is 2 by default, i.e. on
1485 average at least every fourth request has a response. The
1486 minimum value is 1 and the maximum value is 4.
1487
1488
1489
1490 An example use of the directive is:
1491
1492 ratelimit interval 1 burst 16
1493
1494 This would reduce the response rate for IP addresses sending
1495 packets on average more than once per 2 seconds, or sending packets
1496 in bursts of more than 16 packets, by up to 75% (with default leak
1497 of 2).
1498
1499 smoothtime max-freq max-wander [leaponly]
1500 The smoothtime directive can be used to enable smoothing of the
1501 time that chronyd serves to its clients to make it easier for them
1502 to track it and keep their clocks close together even when large
1503 offset or frequency corrections are applied to the server’s clock,
1504 for example after being offline for a longer time.
1505
1506 BE WARNED: The server is intentionally not serving its best
1507 estimate of the true time. If a large offset has been accumulated,
1508 it can take a very long time to smooth it out. This directive
1509 should be used only when the clients are not configured to also
1510 poll another NTP server, because they could reject this server as a
1511 falseticker or fail to select a source completely.
1512
1513 The smoothing process is implemented with a quadratic spline
1514 function with two or three pieces. It is independent from any
1515 slewing applied to the local system clock, but the accumulated
1516 offset and frequency will be reset when the clock is corrected by
1517 stepping, e.g. by the makestep directive or the makestep command in
1518 chronyc. The process can be reset without stepping the clock by the
1519 smoothtime reset command.
1520
1521 The first two arguments of the directive are the maximum frequency
1522 offset of the smoothed time to the tracked NTP time (in ppm) and
1523 the maximum rate at which the frequency offset is allowed to change
1524 (in ppm per second). leaponly is an optional third argument which
1525 enables a mode where only leap seconds are smoothed out and normal
1526 offset and frequency changes are ignored. The leaponly option is
1527 useful in a combination with the leapsecmode slew directive to
1528 allow the clients to use multiple time smoothing servers safely.
1529
1530 The smoothing process is activated automatically when 1/10000 of
1531 the estimated skew of the local clock falls below the maximum rate
1532 of frequency change. It can be also activated manually by the
1533 smoothtime activate command, which is particularly useful when the
1534 clock is synchronised only with manual input and the skew is always
1535 larger than the threshold. The smoothing command can be used to
1536 monitor the process.
1537
1538 An example suitable for clients using ntpd and 1024 second polling
1539 interval could be:
1540
1541 smoothtime 400 0.001
1542
1543 An example suitable for clients using chronyd on Linux could be:
1544
1545 smoothtime 50000 0.01
1546
1547 Command and monitoring access
1548 bindcmdaddress address
1549 The bindcmdaddress directive allows you to specify an IP address of
1550 an interface on which chronyd will listen for monitoring command
1551 packets (issued by chronyc). On systems other than Linux, the
1552 address of the interface needs to be already configured when
1553 chronyd is started.
1554
1555 This directive can also change the path of the Unix domain command
1556 socket, which is used by chronyc to send configuration commands.
1557 The socket must be in a directory that is accessible only by the
1558 root or chrony user. The directory will be created on start if it
1559 does not exist. The compiled-in default path of the socket is
1560 /var/run/chrony/chronyd.sock. The socket can be disabled by setting
1561 the path to /.
1562
1563 By default, chronyd binds to the loopback interface (with addresses
1564 127.0.0.1 and ::1). This blocks all access except from localhost.
1565 To listen for command packets on all interfaces, you can add the
1566 lines:
1567
1568 bindcmdaddress 0.0.0.0
1569 bindcmdaddress ::
1570
1571 to the configuration file.
1572
1573 For each of the IPv4, IPv6, and Unix domain protocols, only one
1574 bindcmdaddress directive can be specified.
1575
1576 An example that sets the path of the Unix domain command socket is:
1577
1578 bindcmdaddress /var/run/chrony/chronyd.sock
1579
1580 cmdallow [all] [subnet]
1581 This is similar to the allow directive, except that it allows
1582 monitoring access (rather than NTP client access) to a particular
1583 subnet or host. (By ‘monitoring access’ is meant that chronyc can
1584 be run on those hosts and retrieve monitoring data from chronyd on
1585 this computer.)
1586
1587 The syntax is identical to the allow directive.
1588
1589 There is also a cmdallow all directive with similar behaviour to
1590 the allow all directive (but applying to monitoring access in this
1591 case, of course).
1592
1593 Note that chronyd has to be configured with the bindcmdaddress
1594 directive to not listen only on the loopback interface to actually
1595 allow remote access.
1596
1597 cmddeny [all] [subnet]
1598 This is similar to the cmdallow directive, except that it denies
1599 monitoring access to a particular subnet or host, rather than
1600 allowing it.
1601
1602 The syntax is identical.
1603
1604 There is also a cmddeny all directive with similar behaviour to the
1605 cmdallow all directive.
1606
1607 cmdport port
1608 The cmdport directive allows the port that is used for run-time
1609 monitoring (via the chronyc program) to be altered from its default
1610 (323). If set to 0, chronyd will not open the port, this is useful
1611 to disable chronyc access from the Internet. (It does not disable
1612 the Unix domain command socket.)
1613
1614 An example shows the syntax:
1615
1616 cmdport 257
1617
1618 This would make chronyd use UDP 257 as its command port. (chronyc
1619 would need to be run with the -p 257 switch to inter-operate
1620 correctly.)
1621
1622 cmdratelimit [option]...
1623 This directive enables response rate limiting for command packets.
1624 It is similar to the ratelimit directive, except responses to
1625 localhost are never limited and the default interval is -4 (16
1626 packets per second).
1627
1628 An example of the use of the directive is:
1629
1630 cmdratelimit interval 2
1631
1632 Real-time clock (RTC)
1633 hwclockfile file
1634 The hwclockfile directive sets the location of the adjtime file
1635 which is used by the hwclock program on Linux. chronyd parses the
1636 file to find out if the RTC keeps local time or UTC. It overrides
1637 the rtconutc directive.
1638
1639 The compiled-in default value is '/etc/adjtime'.
1640
1641 An example of the directive is:
1642
1643 hwclockfile /etc/adjtime
1644
1645 rtcautotrim threshold
1646 The rtcautotrim directive is used to keep the RTC close to the
1647 system clock automatically. When the system clock is synchronised
1648 and the estimated error between the two clocks is larger than the
1649 specified threshold, chronyd will trim the RTC as if the trimrtc
1650 command in chronyc was issued.
1651
1652 This directive is effective only with the rtcfile directive.
1653
1654 An example of the use of this directive is:
1655
1656 rtcautotrim 30
1657
1658 This would set the threshold error to 30 seconds.
1659
1660 rtcdevice device
1661 The rtcdevice directive sets the path to the device file for
1662 accessing the RTC. The default path is /dev/rtc.
1663
1664 rtcfile file
1665 The rtcfile directive defines the name of the file in which chronyd
1666 can save parameters associated with tracking the accuracy of the
1667 RTC.
1668
1669 An example of the directive is:
1670
1671 rtcfile /var/lib/chrony/rtc
1672
1673 chronyd saves information in this file when it exits and when the
1674 writertc command is issued in chronyc. The information saved is the
1675 RTC’s error at some epoch, that epoch (in seconds since January 1
1676 1970), and the rate at which the RTC gains or loses time.
1677
1678 So far, the support for real-time clocks is limited; their code is
1679 even more system-specific than the rest of the software. You can
1680 only use the RTC facilities (the rtcfile directive and the -s
1681 command-line option to chronyd) if the following three conditions
1682 apply:
1683
1684 1. You are running Linux.
1685
1686 2. The kernel is compiled with extended real-time clock support
1687 (i.e. the /dev/rtc device is capable of doing useful things).
1688
1689 3. You do not have other applications that need to make use of
1690 /dev/rtc at all.
1691
1692 rtconutc
1693 chronyd assumes by default that the RTC keeps local time (including
1694 any daylight saving changes). This is convenient on PCs running
1695 Linux which are dual-booted with Windows.
1696
1697 If you keep the RTC on local time and your computer is off when
1698 daylight saving (summer time) starts or ends, the computer’s system
1699 time will be one hour in error when you next boot and start
1700 chronyd.
1701
1702 An alternative is for the RTC to keep Universal Coordinated Time
1703 (UTC). This does not suffer from the 1 hour problem when daylight
1704 saving starts or ends.
1705
1706 If the rtconutc directive appears, it means the RTC is required to
1707 keep UTC. The directive takes no arguments. It is equivalent to
1708 specifying the -u switch to the Linux hwclock program.
1709
1710 Note that this setting is overridden when the hwclockfile directive
1711 is specified.
1712
1713 rtcsync
1714 The rtcsync directive enables a mode where the system time is
1715 periodically copied to the RTC and chronyd does not try to track
1716 its drift. This directive cannot be used with the rtcfile
1717 directive.
1718
1719 On Linux, the RTC copy is performed by the kernel every 11 minutes.
1720
1721 On macOS, chronyd will perform the RTC copy every 60 minutes when
1722 the system clock is in a synchronised state.
1723
1724 On other systems this directive does nothing.
1725
1726 Logging
1727 log [option]...
1728 The log directive indicates that certain information is to be
1729 logged. The log files are written to the directory specified by the
1730 logdir directive. A banner is periodically written to the files to
1731 indicate the meanings of the columns.
1732
1733 rawmeasurements
1734 This option logs the raw NTP measurements and related
1735 information to a file called measurements.log. An entry is made
1736 for each packet received from the source. This can be useful
1737 when debugging a problem. An example line (which actually
1738 appears as a single line in the file) from the log file is
1739 shown below.
1740
1741 2016-11-09 05:40:50 203.0.113.15 N 2 111 111 1111 10 10 1.0 \
1742 -4.966e-03 2.296e-01 1.577e-05 1.615e-01 7.446e-03 CB00717B 4B D K
1743
1744 The columns are as follows (the quantities in square brackets
1745 are the values from the example line above):
1746
1747 1. Date [2015-10-13]
1748
1749 2. Hour:Minute:Second. Note that the date-time pair is
1750 expressed in UTC, not the local time zone. [05:40:50]
1751
1752 3. IP address of server or peer from which measurement came
1753 [203.0.113.15]
1754
1755 4. Leap status (N means normal, + means that the last minute
1756 of the current month has 61 seconds, - means that the last
1757 minute of the month has 59 seconds, ? means the remote
1758 computer is not currently synchronised.) [N]
1759
1760 5. Stratum of remote computer. [2]
1761
1762 6. RFC 5905 tests 1 through 3 (1=pass, 0=fail) [111]
1763
1764 7. RFC 5905 tests 5 through 7 (1=pass, 0=fail) [111]
1765
1766 8. Tests for maximum delay, maximum delay ratio and maximum
1767 delay dev ratio, against defined parameters, and a test for
1768 synchronisation loop (1=pass, 0=fail) [1111]
1769
1770 9. Local poll [10]
1771
1772 10. Remote poll [10]
1773
1774 11. ‘Score’ (an internal score within each polling level used
1775 to decide when to increase or decrease the polling level.
1776 This is adjusted based on number of measurements currently
1777 being used for the regression algorithm). [1.0]
1778
1779 12. The estimated local clock error (theta in RFC 5905).
1780 Positive indicates that the local clock is slow of the
1781 remote source. [-4.966e-03]
1782
1783 13. The peer delay (delta in RFC 5905). [2.296e-01]
1784
1785 14. The peer dispersion (epsilon in RFC 5905). [1.577e-05]
1786
1787 15. The root delay (DELTA in RFC 5905). [1.615e-01]
1788
1789 16. The root dispersion (EPSILON in RFC 5905). [7.446e-03]
1790
1791 17. Reference ID of the server’s source as a hexadecimal
1792 number. [CB00717B]
1793
1794 18. NTP mode of the received packet (1=active peer, 2=passive
1795 peer, 4=server, B=basic, I=interleaved). [4B]
1796
1797 19. Source of the local transmit timestamp (D=daemon,
1798 K=kernel, H=hardware). [D]
1799
1800 20. Source of the local receive timestamp (D=daemon, K=kernel,
1801 H=hardware). [K]
1802
1803 measurements
1804 This option is identical to the rawmeasurements option, except
1805 it logs only valid measurements from synchronised sources, i.e.
1806 measurements which passed the RFC 5905 tests 1 through 7. This
1807 can be useful for producing graphs of the source’s performance.
1808
1809 statistics
1810 This option logs information about the regression processing to
1811 a file called statistics.log. An example line (which actually
1812 appears as a single line in the file) from the log file is
1813 shown below.
1814
1815 2016-08-10 05:40:50 203.0.113.15 6.261e-03 -3.247e-03 \
1816 2.220e-03 1.874e-06 1.080e-06 7.8e-02 16 0 8 0.00
1817
1818 The columns are as follows (the quantities in square brackets
1819 are the values from the example line above):
1820
1821 1. Date [2015-07-22]
1822
1823 2. Hour:Minute:Second. Note that the date-time pair is
1824 expressed in UTC, not the local time zone. [05:40:50]
1825
1826 3. IP address of server or peer from which measurement comes
1827 [203.0.113.15]
1828
1829 4. The estimated standard deviation of the measurements from
1830 the source (in seconds). [6.261e-03]
1831
1832 5. The estimated offset of the source (in seconds, positive
1833 means the local clock is estimated to be fast, in this
1834 case). [-3.247e-03]
1835
1836 6. The estimated standard deviation of the offset estimate (in
1837 seconds). [2.220e-03]
1838
1839 7. The estimated rate at which the local clock is gaining or
1840 losing time relative to the source (in seconds per second,
1841 positive means the local clock is gaining). This is
1842 relative to the compensation currently being applied to the
1843 local clock, not to the local clock without any
1844 compensation. [1.874e-06]
1845
1846 8. The estimated error in the rate value (in seconds per
1847 second). [1.080e-06].
1848
1849 9. The ratio of |old_rate - new_rate| / old_rate_error. Large
1850 values indicate the statistics are not modelling the source
1851 very well. [7.8e-02]
1852
1853 10. The number of measurements currently being used for the
1854 regression algorithm. [16]
1855
1856 11. The new starting index (the oldest sample has index 0;
1857 this is the method used to prune old samples when it no
1858 longer looks like the measurements fit a linear model). [0,
1859 i.e. no samples discarded this time]
1860
1861 12. The number of runs. The number of runs of regression
1862 residuals with the same sign is computed. If this is too
1863 small it indicates that the measurements are no longer
1864 represented well by a linear model and that some older
1865 samples need to be discarded. The number of runs for the
1866 data that is being retained is tabulated. Values of
1867 approximately half the number of samples are expected. [8]
1868
1869 13. The estimated or configured asymmetry of network jitter on
1870 the path to the source which was used to correct the
1871 measured offsets. The asymmetry can be between -0.5 and
1872 +0.5. A negative value means the delay of packets sent to
1873 the source is more variable than the delay of packets sent
1874 from the source back. [0.00, i.e. no correction for
1875 asymmetry]
1876
1877 tracking
1878 This option logs changes to the estimate of the system’s gain
1879 or loss rate, and any slews made, to a file called
1880 tracking.log. An example line (which actually appears as a
1881 single line in the file) from the log file is shown below.
1882
1883 2017-08-22 13:22:36 203.0.113.15 2 -3.541 0.075 -8.621e-06 N \
1884 2 2.940e-03 -2.084e-04 1.534e-02 3.472e-04 8.304e-03
1885
1886 The columns are as follows (the quantities in square brackets
1887 are the values from the example line above) :
1888
1889 1. Date [2017-08-22]
1890
1891 2. Hour:Minute:Second. Note that the date-time pair is
1892 expressed in UTC, not the local time zone. [13:22:36]
1893
1894 3. The IP address of the server or peer to which the local
1895 system is synchronised. [203.0.113.15]
1896
1897 4. The stratum of the local system. [2]
1898
1899 5. The local system frequency (in ppm, positive means the
1900 local system runs fast of UTC). [-3.541]
1901
1902 6. The error bounds on the frequency (in ppm). [0.075]
1903
1904 7. The estimated local offset at the epoch, which is normally
1905 corrected by slewing the local clock (in seconds, positive
1906 indicates the clock is fast of UTC). [-8.621e-06]
1907
1908 8. Leap status (N means normal, + means that the last minute
1909 of this month has 61 seconds, - means that the last minute
1910 of the month has 59 seconds, ? means the clock is not
1911 currently synchronised.) [N]
1912
1913 9. The number of combined sources. [2]
1914
1915 10. The estimated standard deviation of the combined offset
1916 (in seconds). [2.940e-03]
1917
1918 11. The remaining offset correction from the previous update
1919 (in seconds, positive means the system clock is slow of
1920 UTC). [-2.084e-04]
1921
1922 12. The total of the network path delays to the reference
1923 clock to which the local clock is ultimately synchronised
1924 (in seconds). [1.534e-02]
1925
1926 13. The total dispersion accumulated through all the servers
1927 back to the reference clock to which the local clock is
1928 ultimately synchronised (in seconds). [3.472e-04]
1929
1930 14. The maximum estimated error of the system clock in the
1931 interval since the previous update (in seconds). It
1932 includes the offset, remaining offset correction, root
1933 delay, and dispersion from the previous update with the
1934 dispersion which accumulated in the interval. [8.304e-03]
1935
1936 rtc
1937 This option logs information about the system’s real-time
1938 clock. An example line (which actually appears as a single line
1939 in the file) from the rtc.log file is shown below.
1940
1941 2015-07-22 05:40:50 -0.037360 1 -0.037434\
1942 -37.948 12 5 120
1943
1944 The columns are as follows (the quantities in square brackets
1945 are the values from the example line above):
1946
1947 1. Date [2015-07-22]
1948
1949 2. Hour:Minute:Second. Note that the date-time pair is
1950 expressed in UTC, not the local time zone. [05:40:50]
1951
1952 3. The measured offset between the RTC and the system clock in
1953 seconds. Positive indicates that the RTC is fast of the
1954 system time [-0.037360].
1955
1956 4. Flag indicating whether the regression has produced valid
1957 coefficients. (1 for yes, 0 for no). [1]
1958
1959 5. Offset at the current time predicted by the regression
1960 process. A large difference between this value and the
1961 measured offset tends to indicate that the measurement is
1962 an outlier with a serious measurement error. [-0.037434]
1963
1964 6. The rate at which the RTC is losing or gaining time
1965 relative to the system clock. In ppm, with positive
1966 indicating that the RTC is gaining time. [-37.948]
1967
1968 7. The number of measurements used in the regression. [12]
1969
1970 8. The number of runs of regression residuals of the same
1971 sign. Low values indicate that a straight line is no longer
1972 a good model of the measured data and that older
1973 measurements should be discarded. [5]
1974
1975 9. The measurement interval used prior to the measurement
1976 being made (in seconds). [120]
1977
1978 refclocks
1979 This option logs the raw and filtered reference clock
1980 measurements to a file called refclocks.log. An example line
1981 (which actually appears as a single line in the file) from the
1982 log file is shown below.
1983
1984 2009-11-30 14:33:27.000000 PPS2 7 N 1 4.900000e-07 -6.741777e-07 1.000e-06
1985
1986 The columns are as follows (the quantities in square brackets
1987 are the values from the example line above):
1988
1989 1. Date [2009-11-30]
1990
1991 2. Hour:Minute:Second.Microsecond. Note that the date-time
1992 pair is expressed in UTC, not the local time zone.
1993 [14:33:27.000000]
1994
1995 3. Reference ID of the reference clock from which the
1996 measurement came. [PPS2]
1997
1998 4. Sequence number of driver poll within one polling interval
1999 for raw samples, or - for filtered samples. [7]
2000
2001 5. Leap status (N means normal, + means that the last minute
2002 of the current month has 61 seconds, - means that the last
2003 minute of the month has 59 seconds). [N]
2004
2005 6. Flag indicating whether the sample comes from PPS source.
2006 (1 for yes, 0 for no, or - for filtered sample). [1]
2007
2008 7. Local clock error measured by reference clock driver, or -
2009 for filtered sample. [4.900000e-07]
2010
2011 8. Local clock error with applied corrections. Positive
2012 indicates that the local clock is slow. [-6.741777e-07]
2013
2014 9. Assumed dispersion of the sample. [1.000e-06]
2015
2016 tempcomp
2017 This option logs the temperature measurements and system rate
2018 compensations to a file called tempcomp.log. An example line
2019 (which actually appears as a single line in the file) from the
2020 log file is shown below.
2021
2022 2015-04-19 10:39:48 2.8000e+04 3.6600e-01
2023
2024 The columns are as follows (the quantities in square brackets
2025 are the values from the example line above):
2026
2027 1. Date [2015-04-19]
2028
2029 2. Hour:Minute:Second. Note that the date-time pair is
2030 expressed in UTC, not the local time zone. [10:39:48]
2031
2032 3. Temperature read from the sensor. [2.8000e+04]
2033
2034 4. Applied compensation in ppm, positive means the system
2035 clock is running faster than it would be without the
2036 compensation. [3.6600e-01]
2037
2038
2039 An example of the directive is:
2040
2041 log measurements statistics tracking
2042
2043 logbanner entries
2044 A banner is periodically written to the log files enabled by the
2045 log directive to indicate the meanings of the columns.
2046
2047 The logbanner directive specifies after how many entries in the log
2048 file should be the banner written. The default is 32, and 0 can be
2049 used to disable it entirely.
2050
2051 logchange threshold
2052 This directive sets the threshold for the adjustment of the system
2053 clock that will generate a syslog message. Clock errors detected
2054 via NTP packets, reference clocks, or timestamps entered via the
2055 settime command of chronyc are logged.
2056
2057 By default, the threshold is 1 second.
2058
2059 An example of the use is:
2060
2061 logchange 0.1
2062
2063 which would cause a syslog message to be generated if a system
2064 clock error of over 0.1 seconds starts to be compensated.
2065
2066 logdir directory
2067 This directive allows the directory where log files are written to
2068 be specified.
2069
2070 An example of the use of this directive is:
2071
2072 logdir /var/log/chrony
2073
2074 mailonchange email threshold
2075 This directive defines an email address to which mail should be
2076 sent if chronyd applies a correction exceeding a particular
2077 threshold to the system clock.
2078
2079 An example of the use of this directive is:
2080
2081 mailonchange root@localhost 0.5
2082
2083 This would send a mail message to root if a change of more than 0.5
2084 seconds were applied to the system clock.
2085
2086 This directive cannot be used when a system call filter is enabled
2087 by the -F option as the chronyd process will not be allowed to fork
2088 and execute the sendmail binary.
2089
2090 Miscellaneous
2091 hwtimestamp interface [option]...
2092 This directive enables hardware timestamping of NTP packets sent to
2093 and received from the specified network interface. The network
2094 interface controller (NIC) uses its own clock to accurately
2095 timestamp the actual transmissions and receptions, avoiding
2096 processing and queueing delays in the kernel, network driver, and
2097 hardware. This can significantly improve the accuracy of the
2098 timestamps and the measured offset, which is used for
2099 synchronisation of the system clock. In order to get the best
2100 results, both sides receiving and sending NTP packets (i.e. server
2101 and client, or two peers) need to use HW timestamping. If the
2102 server or peer supports the interleaved mode, it needs to be
2103 enabled by the xleave option in the server or the peer directive.
2104
2105 This directive is supported on Linux 3.19 and newer. The NIC must
2106 support HW timestamping, which can be verified with the ethtool -T
2107 command. The list of capabilities should include
2108 SOF_TIMESTAMPING_RAW_HARDWARE, SOF_TIMESTAMPING_TX_HARDWARE, and
2109 SOF_TIMESTAMPING_RX_HARDWARE. Receive filter HWTSTAMP_FILTER_ALL,
2110 or HWTSTAMP_FILTER_NTP_ALL, is necessary for timestamping of
2111 received packets. Timestamping of packets received from bridged and
2112 bonded interfaces is supported on Linux 4.13 and newer. When
2113 chronyd is running, no other process (e.g. a PTP daemon) should be
2114 working with the NIC clock.
2115
2116 If the kernel supports software timestamping, it will be enabled
2117 for all interfaces. The source of timestamps (i.e. hardware,
2118 kernel, or daemon) is indicated in the measurements.log file if
2119 enabled by the log measurements directive, and the ntpdata report
2120 in chronyc.
2121
2122 If the specified interface is *, chronyd will try to enable HW
2123 timestamping on all available interfaces.
2124
2125 The hwtimestamp directive has the following options:
2126
2127 minpoll poll
2128 This option specifies the minimum interval between readings of
2129 the NIC clock. It’s defined as a power of two. It should
2130 correspond to the minimum polling interval of all NTP sources
2131 and the minimum expected polling interval of NTP clients. The
2132 default value is 0 (1 second) and the minimum value is -6
2133 (1/64th of a second).
2134
2135 minsamples samples
2136 This option specifies the minimum number of readings kept for
2137 tracking of the NIC clock. The default value is 2.
2138
2139 maxsamples samples
2140 This option specifies the maximum number of readings kept for
2141 tracking of the NIC clock. The default value is 16.
2142
2143 precision precision
2144 This option specifies the assumed precision of reading of the
2145 NIC clock. The default value is 100e-9 (100 nanoseconds).
2146
2147 txcomp compensation
2148 This option specifies the difference in seconds between the
2149 actual transmission time at the physical layer and the reported
2150 transmit timestamp. This value will be added to transmit
2151 timestamps obtained from the NIC. The default value is 0.
2152
2153 rxcomp compensation
2154 This option specifies the difference in seconds between the
2155 reported receive timestamp and the actual reception time at the
2156 physical layer. This value will be subtracted from receive
2157 timestamps obtained from the NIC. The default value is 0.
2158
2159 nocrossts
2160 Some hardware can precisely cross timestamp the NIC clock with
2161 the system clock. This option disables the use of the cross
2162 timestamping.
2163
2164 rxfilter filter
2165 This option selects the receive timestamping filter. The filter
2166 can be one of the following:
2167
2168 all
2169 Enables timestamping of all received packets.
2170
2171 ntp
2172 Enables timestamping of received NTP packets.
2173
2174 none
2175 Disables timestamping of received packets.
2176
2177
2178 The most specific filter for timestamping NTP packets which is
2179 supported by the NIC is selected by default. Some NICs can
2180 timestamp only PTP packets, which limits the selection to the
2181 none filter. Forcing timestamping of all packets with the all
2182 filter when the NIC supports both all and ntp filters can be
2183 useful when packets are received from or on a non-standard UDP
2184 port (e.g. specified by the port directive).
2185
2186
2187
2188 Examples of the directive are:
2189
2190 hwtimestamp eth0
2191 hwtimestamp eth1 txcomp 300e-9 rxcomp 645e-9
2192 hwtimestamp *
2193
2194 include pattern
2195 The include directive includes a configuration file or multiple
2196 configuration files if a wildcard pattern is specified. This can be
2197 useful when maintaining configuration on multiple hosts to keep the
2198 differences in separate files.
2199
2200 An example of the directive is:
2201
2202 include /etc/chrony.d/*.conf
2203
2204 keyfile file
2205 This directive is used to specify the location of the file
2206 containing ID-key pairs for authentication of NTP packets.
2207
2208 The format of the directive is shown in the example below:
2209
2210 keyfile /etc/chrony.keys
2211
2212 The argument is simply the name of the file containing the ID-key
2213 pairs. The format of the file is shown below:
2214
2215 10 tulip
2216 11 hyacinth
2217 20 MD5 ASCII:crocus
2218 25 SHA1 HEX:1dc764e0791b11fa67efc7ecbc4b0d73f68a070c
2219 ...
2220
2221 Each line consists of an ID, name of an authentication hash
2222 function (optional), and a password. The ID can be any unsigned
2223 integer in the range 1 through 2^32-1. The default hash function is
2224 MD5, which is always supported.
2225
2226 If chronyd was built with enabled support for hashing using a
2227 crypto library (nettle, nss, or libtomcrypt), the following
2228 functions are available: MD5, SHA1, SHA256, SHA384, SHA512.
2229 Depending on which library and version is chronyd using, some or
2230 all of the following functions may also be available: SHA3-224,
2231 SHA3-256, SHA3-384, SHA3-512, RMD128, RMD160, RMD256, RMD320,
2232 TIGER, WHIRLPOOL.
2233
2234 The password can be specified as a string of characters not
2235 containing white space with an optional ASCII: prefix, or as a
2236 hexadecimal number with the HEX: prefix. The maximum length of the
2237 line is 2047 characters.
2238
2239 The password is used with the hash function to generate and verify
2240 a message authentication code (MAC) in NTP packets. It is
2241 recommended to use SHA1, or stronger, hash function with random
2242 passwords specified in the hexadecimal format that have at least
2243 128 bits. chronyd will log a warning to syslog on start if a source
2244 is specified in the configuration file with a key that has password
2245 shorter than 80 bits.
2246
2247 The keygen command of chronyc can be used to generate random keys
2248 for the key file. By default, it generates 160-bit MD5 or SHA1
2249 keys.
2250
2251 For security reasons, the file should be readable only by root and
2252 the user under which chronyd is normally running (to allow chronyd
2253 to re-read the file when the rekey command is issued by chronyc).
2254
2255 lock_all
2256 The lock_all directive will lock chronyd into RAM so that it will
2257 never be paged out. This mode is only supported on Linux. This
2258 directive uses the Linux mlockall() system call to prevent chronyd
2259 from ever being swapped out. This should result in lower and more
2260 consistent latency. It should not have significant impact on
2261 performance as chronyd’s memory usage is modest. The mlockall(2)
2262 man page has more details.
2263
2264 pidfile file
2265 Unless chronyd is started with the -Q option, it writes its process
2266 ID (PID) to a file, and checks this file on startup to see if
2267 another chronyd might already be running on the system. By default,
2268 the file used is /var/run/chrony/chronyd.pid. The pidfile directive
2269 allows the name to be changed, e.g.:
2270
2271 pidfile /run/chronyd.pid
2272
2273 sched_priority priority
2274 On Linux, the sched_priority directive will select the SCHED_FIFO
2275 real-time scheduler at the specified priority (which must be
2276 between 0 and 100). On macOS, this option must have either a value
2277 of 0 (the default) to disable the thread time constraint policy or
2278 1 for the policy to be enabled. Other systems do not support this
2279 option.
2280
2281 On Linux, this directive uses the sched_setscheduler() system call
2282 to instruct the kernel to use the SCHED_FIFO first-in, first-out
2283 real-time scheduling policy for chronyd with the specified
2284 priority. This means that whenever chronyd is ready to run it will
2285 run, interrupting whatever else is running unless it is a higher
2286 priority real-time process. This should not impact performance as
2287 chronyd resource requirements are modest, but it should result in
2288 lower and more consistent latency since chronyd will not need to
2289 wait for the scheduler to get around to running it. You should not
2290 use this unless you really need it. The sched_setscheduler(2) man
2291 page has more details.
2292
2293 On macOS, this directive uses the thread_policy_set() kernel call
2294 to specify real-time scheduling. As noted for Linux, you should not
2295 use this directive unless you really need it.
2296
2297 user user
2298 The user directive sets the name of the system user to which
2299 chronyd will switch after start in order to drop root privileges.
2300
2301 On Linux, chronyd needs to be compiled with support for the libcap
2302 library. On macOS, FreeBSD, NetBSD and Solaris chronyd forks into
2303 two processes. The child process retains root privileges, but can
2304 only perform a very limited range of privileged system calls on
2305 behalf of the parent.
2306
2307 The compiled-in default value is chrony.
2308
2310 NTP client with permanent connection to NTP servers
2311 This section shows how to configure chronyd for computers that are
2312 connected to the Internet (or to any network containing true NTP
2313 servers which ultimately derive their time from a reference clock)
2314 permanently or most of the time.
2315
2316 To operate in this mode, you will need to know the names of the NTP
2317 servers you want to use. You might be able to find names of suitable
2318 servers by one of the following methods:
2319
2320 · Your institution might already operate servers on its network.
2321 Contact your system administrator to find out.
2322
2323 · Your ISP probably has one or more NTP servers available for its
2324 customers.
2325
2326 · Somewhere under the NTP homepage there is a list of public stratum
2327 1 and stratum 2 servers. You should find one or more servers that
2328 are near to you. Check that their access policy allows you to use
2329 their facilities.
2330
2331 · Use public servers from the pool.ntp.org <http://www.pool.ntp.org/>
2332 project.
2333
2334 Assuming that your NTP servers are called foo.example.net,
2335 bar.example.net and baz.example.net, your chrony.conf file could
2336 contain as a minimum:
2337
2338 server foo.example.net
2339 server bar.example.net
2340 server baz.example.net
2341
2342 However, you will probably want to include some of the other
2343 directives. The driftfile, makestep and rtcsync might be particularly
2344 useful. Also, the iburst option of the server directive is useful to
2345 speed up the initial synchronisation. The smallest useful configuration
2346 file would look something like:
2347
2348 server foo.example.net iburst
2349 server bar.example.net iburst
2350 server baz.example.net iburst
2351 driftfile /var/lib/chrony/drift
2352 makestep 1.0 3
2353 rtcsync
2354
2355 When using a pool of NTP servers (one name is used for multiple servers
2356 which might change over time), it is better to specify them with the
2357 pool directive instead of multiple server directives. The configuration
2358 file could in this case look like:
2359
2360 pool pool.ntp.org iburst
2361 driftfile /var/lib/chrony/drift
2362 makestep 1.0 3
2363 rtcsync
2364
2365 NTP client with infrequent connection to NTP servers
2366 This section shows how to configure chronyd for computers that have
2367 occasional connections to NTP servers. In this case, you will need some
2368 additional configuration to tell chronyd when the connection goes up
2369 and down. This saves the program from continuously trying to poll the
2370 servers when they are inaccessible.
2371
2372 Again, assuming that your NTP servers are called foo.example.net,
2373 bar.example.net and baz.example.net, your chrony.conf file would now
2374 contain:
2375
2376 server foo.example.net offline
2377 server bar.example.net offline
2378 server baz.example.net offline
2379 driftfile /var/lib/chrony/drift
2380 makestep 1.0 3
2381 rtcsync
2382
2383 The offline keyword indicates that the servers start in an offline
2384 state, and that they should not be contacted until chronyd receives
2385 notification from chronyc that the link to the Internet is present. To
2386 tell chronyd when to start and finish sampling the servers, the online
2387 and offline commands of chronyc need to be used.
2388
2389 To give an example of their use, assuming that pppd is the program
2390 being used to connect to the Internet and that chronyc has been
2391 installed at /usr/bin/chronyc, the script /etc/ppp/ip-up would include:
2392
2393 /usr/bin/chronyc online
2394
2395 and the script /etc/ppp/ip-down would include:
2396
2397 /usr/bin/chronyc offline
2398
2399 chronyd’s polling of the servers would now only occur whilst the
2400 machine is actually connected to the Internet.
2401
2402 Isolated networks
2403 This section shows how to configure chronyd for computers that never
2404 have network conectivity to any computer which ultimately derives its
2405 time from a reference clock.
2406
2407 In this situation, one computer is selected to be the master
2408 timeserver. The other computers are either direct clients of the
2409 master, or clients of clients.
2410
2411 The local directive enables a local reference mode, which allows
2412 chronyd to appear synchronised even when it is not.
2413
2414 The rate value in the master’s drift file needs to be set to the
2415 average rate at which the master gains or loses time. chronyd includes
2416 support for this, in the form of the manual directive and the settime
2417 command in the chronyc program.
2418
2419 If the master is rebooted, chronyd can re-read the drift rate from the
2420 drift file. However, the master has no accurate estimate of the current
2421 time. To get around this, the system can be configured so that the
2422 master can initially set itself to a ‘majority-vote’ of selected
2423 clients' times; this allows the clients to ‘flywheel’ the master while
2424 it is rebooting.
2425
2426 The smoothtime directive is useful when the clocks of the clients need
2427 to stay close together when the local time is adjusted by the settime
2428 command. The smoothing process needs to be activated by the smoothtime
2429 activate command when the local time is ready to be served. After that
2430 point, any adjustments will be smoothed out.
2431
2432 A typical configuration file for the master (called master) might be
2433 (assuming the clients and the master are in the 192.168.165.x subnet):
2434
2435 initstepslew 1 client1 client3 client6
2436 driftfile /var/lib/chrony/drift
2437 local stratum 8
2438 manual
2439 allow 192.168.165.0/24
2440 smoothtime 400 0.01
2441 rtcsync
2442
2443 For the clients that have to resynchronise the master when it restarts,
2444 the configuration file might be:
2445
2446 server master iburst
2447 driftfile /var/lib/chrony/drift
2448 allow 192.168.165.0/24
2449 makestep 1.0 3
2450 rtcsync
2451
2452 The rest of the clients would be the same, except that the allow
2453 directive is not required.
2454
2455 If there is no suitable computer to be designated as the master, or
2456 there is a requirement to keep the clients synchronised even when it
2457 fails, the orphan option of the local directive enables a special mode
2458 where the master is selected from multiple computers automatically.
2459 They all need to use the same local configuration and poll one another.
2460 The server with the smallest reference ID (which is based on its IP
2461 address) will take the role of the master and others will be
2462 synchronised to it. When it fails, the server with the second smallest
2463 reference ID will take over and so on.
2464
2465 A configuration file for the first server might be (assuming there are
2466 three servers called master1, master2, and master3):
2467
2468 initstepslew 1 master2 master3
2469 server master2
2470 server master3
2471 driftfile /var/lib/chrony/drift
2472 local stratum 8 orphan
2473 manual
2474 allow 192.168.165.0/24
2475 rtcsync
2476
2477 The other servers would be the same, except the hostnames in the
2478 initstepslew and server directives would be modified to specify the
2479 other servers. Their clients might be configured to poll all three
2480 servers.
2481
2482 RTC tracking
2483 This section considers a computer which has occasional connections to
2484 the Internet and is turned off between ‘sessions’. In this case,
2485 chronyd relies on the computer’s RTC to maintain the time between the
2486 periods when it is powered up. It assumes that Linux is run exclusively
2487 on the computer. Dual-boot systems might work; it depends what (if
2488 anything) the other system does to the RTC. On 2.6 and later kernels,
2489 if your motherboard has a HPET, you will need to enable the
2490 HPET_EMULATE_RTC option in your kernel configuration. Otherwise,
2491 chronyd will not be able to interact with the RTC device and will give
2492 up using it.
2493
2494 When the computer is connected to the Internet, chronyd has access to
2495 external NTP servers which it makes measurements from. These
2496 measurements are saved, and straight-line fits are performed on them to
2497 provide an estimate of the computer’s time error and rate of gaining or
2498 losing time.
2499
2500 When the computer is taken offline from the Internet, the best estimate
2501 of the gain or loss rate is used to free-run the computer until it next
2502 goes online.
2503
2504 Whilst the computer is running, chronyd makes measurements of the RTC
2505 (via the /dev/rtc interface, which must be compiled into the kernel).
2506 An estimate is made of the RTC error at a particular RTC second, and
2507 the rate at which the RTC gains or loses time relative to true time.
2508
2509 When the computer is powered down, the measurement histories for all
2510 the NTP servers are saved to files, and the RTC tracking information is
2511 also saved to a file (if the rtcfile directive has been specified).
2512 These pieces of information are also saved if the dump and writertc
2513 commands respectively are issued through chronyc.
2514
2515 When the computer is rebooted, chronyd reads the current RTC time and
2516 the RTC information saved at the last shutdown. This information is
2517 used to set the system clock to the best estimate of what its time
2518 would have been now, had it been left running continuously. The
2519 measurement histories for the servers are then reloaded.
2520
2521 The next time the computer goes online, the previous sessions'
2522 measurements can contribute to the line-fitting process, which gives a
2523 much better estimate of the computer’s gain or loss rate.
2524
2525 One problem with saving the measurements and RTC data when the machine
2526 is shut down is what happens if there is a power failure; the most
2527 recent data will not be saved. Although chronyd is robust enough to
2528 cope with this, some performance might be lost. (The main danger arises
2529 if the RTC has been changed during the session, with the trimrtc
2530 command in chronyc. Because of this, trimrtc will make sure that a
2531 meaningful RTC file is saved after the change is completed).
2532
2533 The easiest protection against power failure is to put the dump and
2534 writertc commands in the same place as the offline command is issued to
2535 take chronyd offline; because chronyd free-runs between online
2536 sessions, no parameters will change significantly between going offline
2537 from the Internet and any power failure.
2538
2539 A final point regards computers which are left running for extended
2540 periods and where it is desired to spin down the hard disc when it is
2541 not in use (e.g. when not accessed for 15 minutes). chronyd has been
2542 planned so it supports such operation; this is the reason why the RTC
2543 tracking parameters are not saved to disc after every update, but only
2544 when the user requests such a write, or during the shutdown sequence.
2545 The only other facility that will generate periodic writes to the disc
2546 is the log rtc facility in the configuration file; this option should
2547 not be used if you want your disc to spin down.
2548
2549 To illustrate how a computer might be configured for this case, example
2550 configuration files are shown.
2551
2552 For the chrony.conf file, the following can be used as an example.
2553
2554 server foo.example.net maxdelay 0.4 offline
2555 server bar.example.net maxdelay 0.4 offline
2556 server baz.example.net maxdelay 0.4 offline
2557 logdir /var/log/chrony
2558 log statistics measurements tracking
2559 driftfile /var/lib/chrony/drift
2560 makestep 1.0 3
2561 maxupdateskew 100.0
2562 dumpdir /var/lib/chrony
2563 rtcfile /var/lib/chrony/rtc
2564
2565 pppd is used for connecting to the Internet. This runs two scripts
2566 /etc/ppp/ip-up and /etc/ppp/ip-down when the link goes online and
2567 offline respectively.
2568
2569 The relevant part of the /etc/ppp/ip-up file is:
2570
2571 /usr/bin/chronyc online
2572
2573 and the relevant part of the /etc/ppp/ip-down script is:
2574
2575 /usr/bin/chronyc -m offline dump writertc
2576
2577 chronyd is started during the boot sequence with the -r and -s options.
2578 It might need to be started before any software that depends on the
2579 system clock not jumping or moving backwards, depending on the
2580 directives in chronyd’s configuration file.
2581
2582 For the system shutdown, chronyd should receive a SIGTERM several
2583 seconds before the final SIGKILL; the SIGTERM causes the measurement
2584 histories and RTC information to be saved.
2585
2586 Public NTP server
2587 chronyd can be configured to operate as a public NTP server, e.g. to
2588 join the pool.ntp.org <http://www.pool.ntp.org/en/join.html> project.
2589 The configuration is similar to the NTP client with permanent
2590 connection, except it needs to allow client access from all addresses.
2591 It is recommended to find at least four good servers (e.g. from the
2592 pool, or on the NTP homepage). If the server has a hardware reference
2593 clock (e.g. a GPS receiver), it can be specified by the refclock
2594 directive.
2595
2596 The amount of memory used for logging client accesses can be increased
2597 in order to enable clients to use the interleaved mode even when the
2598 server has a large number of clients, and better support rate limiting
2599 if it is enabled by the ratelimit directive. The system timezone
2600 database, if it is kept up to date and includes the right/UTC timezone,
2601 can be used as a reliable source to determine when a leap second will
2602 be applied to UTC. The -r option with the dumpdir directive shortens
2603 the time in which chronyd will not be able to serve time to its clients
2604 when it needs to be restarted (e.g. after upgrading to a newer version,
2605 or a change in the configuration).
2606
2607 The configuration file could look like:
2608
2609 server foo.example.net iburst
2610 server bar.example.net iburst
2611 server baz.example.net iburst
2612 server qux.example.net iburst
2613 makestep 1.0 3
2614 rtcsync
2615 allow
2616 clientloglimit 100000000
2617 leapsectz right/UTC
2618 driftfile /var/lib/chrony/drift
2619 dumpdir /var/run/chrony
2620
2622 chronyc(1), chronyd(8)
2623
2625 For instructions on how to report bugs, please visit <https://
2626 chrony.tuxfamily.org/>.
2627
2629 chrony was written by Richard Curnow, Miroslav Lichvar, and others.
2630
2631
2632
2633chrony 3.4 2018-09-19 CHRONY.CONF(5)