Chrony
From Leo's Notes
Last edited on 14 June 2020, at 23:32.
Chrony is the default NTP client for CentOS 8 or higher.
Installation
# yum install chrony
# systemctl enable chronyd
If using Chrony as a NTP server, adjust the firewall rules to allow incoming NTP traffic.
# firewall-cmd --permanent --add-service=ntp
# firewall-cmd --reload
Configuration
The main configuration file is at /etc/chrony.conf
.
NTP servers can be defined with Server
or pool
. Eg:
server 136.159.2.1
pool 2.centos.pool.ntp.org iburst
If using Chrony as a NTP server, define which subnets have access with the Allow x.x.x.x/yy
directive.
Restart the chronyd service to apply.
# systemctl restart chronyd
Usage
Check the status of the NTP sources and peers:
# chronyc sources
210 Number of sources = 4
MS Name/IP address Stratum Poll Reach LastRx Last sample
===============================================================================
^+ 173.0.48.220.reverse.wow> 2 6 177 54 -19ms[ -19ms] +/- 79ms
^+ time.cloudflare.com 3 6 177 54 +11ms[ +11ms] +/- 44ms
^* voipmonitor.wci.com 2 6 177 55 +7058us[+1670us] +/- 29ms
^+ 144.172.126.201 2 6 177 54 +6575us[+6575us] +/- 22ms
# chronyc clients
Hostname NTP Drop Int IntL Last Cmd Drop Int Last
===============================================================================
localhost 0 0 - - - 1 0 - 229
localhost 0 0 - - - 1 0 - 229