1ntpstat # see which NTP server we synchronise with, and whether the sync is good.
1synchronised to NTP server (192.168.1.12) at stratum 4
2 time correct to within 68 ms
3 polling server every 1024 s
1ntpq -p # see the state of the peers.
2ntpq -c peers
remote refid st t when poll reach delay offset jitter
==============================================================================
+192.168.1.11 192.168.2.4 4 u 259 1024 373 0.731 -0.980 0.557
*192.168.1.12 192.168.3.21 3 u 385 1024 377 0.773 0.146 0.365
192.168.4.255 .BCST. 16 u - 64 0 0.000 0.000 0.000
*) is the one being used.- are currently discarded by the server-selection algorithm.+ are possible synchronisation candidates.remote — the server name.refid — the parent server’s identifier.st — the server’s stratum.t — the server type.when — seconds elapsed since the last contact.poll — seconds between each contact.reach — bitmask of successful contacts (octal): the server considers itself synchronised when reach reaches 177; a quality, stable connection shows 377.delay — estimated round-trip time (ms) of the UDP packet.offset — estimated difference between the peer’s clock and the internal clock.jitter — dispersion of the reference values obtained from this peer.1service ntpd restart # or: systemctl restart ntpd
1cat /etc/ntp.conf # "server example.com" + restart ntpd + enable
2/var/log/ntpstats
Old service that synchronises NTP at boot (install the package first).
1ntpdate 192.168.1.12 # + enable the ntpdate service
2ntpdate -ubd 192.168.1.12 # -b sync immediately, -u unprivileged port, -d debug mode to see all the steps
3/etc/ntp/step-tickers
1ntpdc -c monlist # normally used on an NTP server to list its clients.
1ntptrace
2ntp-server: stratum 3, offset 0.000791, synch distance 0.069005
3192.168.5.33: stratum 2, offset -0.000125, synch distance 0.016285
1timedatectl # = ntpdate + ntp combined.
2timedatectl status
3timedatectl set-ntp true
4
5timedatectl list-timezones | grep Paris
6sudo timedatectl set-timezone Europe/Paris
7
8/etc/systemd/timesyncd.conf # timesyncd = ntpd
1chronyc sources -v
[root@server ~]# chronyc tracking
Reference ID : 00000000 ()
Stratum : 0
Ref time (UTC) : Thu Jan 01 00:00:00 1970
System time : 0.000000000 seconds fast of NTP time
Last offset : +0.000000000 seconds
...
Leap status : Not synchronised
1chronyc sourcestats
2210 Number of sources = 2
3Name/IP Address NP NR Span Frequency Freq Skew Offset Std Dev
4==============================================================================
5ntp1.example.com 0 0 0 +0.000 2000.000 +0ns 4000ms
6ntp2.example.com 0 0 0 +0.000 2000.000 +0ns 4000ms
1systemctl restart chronyd
2watch chronyc tracking