Skip to main content

Configure Network Time Protocol (NTP)

Install NTP Daemon

  1. Install NTPd with the following command
yum -y install ntp

Configure Firewall

  1. Add NTP service to the 'allow' rules and reload the firewall to apply changes
firewall-cmd --add-service=ntp --permanent

firewall-cmd --reload

Edit ntp.conf File

  1. Change/add the /etc/ntp.conf by removing current time servers and adding new time servers
Change from

# hetzner ntp servers
server ntp1.hetzner.de iburst
server ntp2.hetzner.com iburst
server ntp3.hetzner.net iburst

to

# hetzner ntp servers
# server ntp1.hetzner.de iburst
# server ntp2.hetzner.com iburst
# server ntp3.hetzner.net iburst

Add the following time servers
==============================

server 0.pool.ntp.org
server 1.za.pool.ntp.org
server 2.africa.pool.ntp.org

Start And Check NTP service

  1. Start NTP service and check to see if it is active
Start and enable NTPd
=====================

systemctl start ntpd
systemctl enable ntpd

Check to see if service is enabled
==================================

ntpq -p