The Network Time Server maintains the system time in synchronization with time servers using the Network Time Protocol to provide accurate timing for server log records and other security-sensitive functions.  NTPd is best used on systems that are permanently powered or uses broadcast or multicast IP, such as virtual or bare metal machines.

 

Install NTP and configure time server.

yum -y install ntp

Edit the NTP configuration file.  Disable CentOS NTP pools by remarking existing lines with # and configure to NTP server of your choice.  I've configured this to the NIST National Institute of Standards and Technology.

nano /etc/ntp.conf 

#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 time.nist.gov iburst

Configure NTP server to automatically start on server reboot.

systemctl enable ntpd
systemctl start ntpd

Configure the firewall.  The time server protocol NTP uses 123/UDP.

firewall-cmd --add-service=ntp --permanent
firewall-cmd --reload

 


Loading Conversation