This document provides instructions for configuring a CentOS 8 system as an NTP server or client using the Chrony NTP daemon. It describes installing the Chrony package, enabling it to start on boot, configuring it as a server to serve local networks by modifying /etc/chrony.conf, restarting Chrony, and opening firewall ports. It also provides instructions for configuring a system as a Chrony client by pointing it to the local NTP server.
1 of 4
Download to read offline
More Related Content
Configuration of NTP Server on CentOS 8
1. 1
CONFIGURATION OF NTP SERVER ON CENTOS 8
Chrony is a default NTP client as well as an NTP server on RHEL 8 / CentOS 8. This article will
provide you with an information on how to perform an installation and basic configuration of an NTP
server or client on RHEL 8.
Install package Chrony NTP:
dnf install chrony
Enable chrony to start after boot:
systemctl enable chronyd
Set Chrony to act as an NTP server for a local network.
As already mentioned before the Chrony NTP daemon can act as both, NTP server or as NTP client. To
turn Chrony into an NTP server add the following line into the main Chrony
/etc/chrony.conf configuration file: allow 10.30.30.0/24 ; allow 192.168.70.0/24
2. 2
Restart Chrony NTP daemon to apply the changes:
systemctl restart chronyd
Open firewall port to allow for incoming NTP requests:
1) Firewalld
firewall-cmd –zone=privatekaan --add-service=ntp --permanent
firewall-cmd –reload
firewall-cmd –runtime-to-permanent
firewall-cmd –zone=privatekaan --list-all
We have configured and see ntp service in our Firewalld. Now let’s do it via “IPTables” which we
are using actively.
3. 3
2) IPTables
iptables -A INPUT -s 10.30.30.254 -d 10.30.30.5 -p udp --dport ntp -j ACCEPT
iptables-save > /etc/sysconfig/iptables
iptables -L
To turn Chrony into the NTP cleint add the following line into the main Chrony /etc/chrony.conf
configuration file. Change the IP address accordingly to point to your local Chrony NTP server:
Server 10.30.30.5
4. 4
Restart Chrony NTP daemon to apply the changes:
systemctl restart chronyd
Check for NTP server sources. Your local NTP server should be listed:
chronyc sources
Check NTP client list on the NTP server:
chronyc clients
1/16/2022
X
Kaan Aslandag
Signed by: www.kaan1.com