Install and Configure Chrony server(NTP) for time adjustment in RHEL/Centos

### Install Chrony.

[root@testos ~]# yum -y install chrony

### Edit/Update Chrony Configuration file

[root@testos ~]# vi /etc/chrony.conf

### line 3: change servers for synchronization
#server 0.centos.pool.ntp.org iburst
#server 1.centos.pool.ntp.org iburst
#server 2.centos.pool.ntp.org iburst
#server 3.centos.pool.ntp.org iburst
server <NTP1 SERVER ADDRESS> iburst
server <NTP2 SERVER ADDRESS> iburst
server <NTP3 SERVER ADDRESS> iburst
### line 25: add the network range you allow to receive requests

allow 10.0.0.0/24

### Start&Enable Chrony service

[root@testos ~]# systemctl start chronyd
[root@testos ~]# systemctl enable chronyd

### If Firewalld is running, allow NTP service. NTP uses 123/UDP.

[root@testos ~]# firewall-cmd –add-service=ntp –permanent
success
[root@testos ~]# firewall-cmd –reload
success

### Verify it works normally like follows.
[root@testos ~]# chronyc sources
170 Number of sources = 3
MS Name/IP address         Stratum Poll Reach LastRx Last sample
===============================================================================
^+ ntp1.ntp.unixtest.com          2   6    17     8  -1028us[-1261us] +/-   14ms
^* ntp2.ntp.unixtest.com          2   6    17     8  -1241us[-1474us] +/-   15ms
^? ntp3.ntp.unixtest.com          0   6     0   10y     +0ns[   +0ns] +/-    0ns

Leave a Comment