Synchronizing time with other servers can benefit an organization, allowing for better coordination of log files and helping with time-sensitive services like authentication. In this hands-on lab, we will be deploying a Network Time Protocol (NTP) server to use both an Internet NTP server and a peer NTP server on a subnet.
Learning Objectives
Successfully complete this lab by achieving the following learning objectives:
- Install the ntp Software Package
Start an interactive root shell with
sudo -i
. Using theyum
command, install thentp
software package.sudo -i yum -y install ntp
- Configure the ntpd.service by Updating /etc/ntp.conf
Use an editor to add the following lines to
/etc/ntp.conf
:restrict 10.0.5.20 peer 10.0.5.20 server 169.254.169.123 iburst
Remove or comment out any other lines that start with "server".
- Enable and Start the ntpd.service
Using
systemctl
, enable and start thentpd.service
immediately:systemctl enable ntpd.service --now
- Verify NTP Is Working Correctly
Check the status of the
ntpd.service
to make sure it is running. Using thentpq
command, view the current state of synchronization:systemctl status ntpd.service ntpq -c peers