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

### Install NTPd.

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

### Edit/Update NTP Configuration file

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

### line 18: add the network range you allow to receive requests

restrict 10.0.0.0 mask 255.255.255.0 nomodify notrap

### change servers for synchronization
### 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
### Start&Enable NTPD service

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

### 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 & Check NTP
[root@testos ~]# ntpq -p
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
+ntp1.ntp.test. 10.229.20.120     2 u   29   64    1   18.826   -0.126   0.000
+ntp2.ntp.test. 10.210.10.55      2 u   28   64    1   21.592    0.018   0.000
*ntp3.ntp.test. 10.133.20.20   2 u   28   64    1   22.666   -1.033   0.000

Leave a Comment