This document explains how to keep your Elemental Linux Server (ELS) system's clock in sync using the Network Time Protocol (NTP).
You will need to obtain the IP address of an NTP time source on your network or on the Internet. If you choose to use an Internet-based time server, you should obtain permission to use the server before proceeding.
The OpenNTPD package is included as part of the ELS base installation. No installation is required.
The following steps demonstrate how to configure OpenNTPD.
The following example shows portions of /etc/openntpd/ntpd.conf and /etc/firewall set up to use a time server provided by your ISP.
cp /usr/share/doc/openntpd/config/ntpd.conf /etc/openntpd vi /etc/openntpd/ntpd.conf # sync to a single server server 10.10.10.123 # use a random selection of 8 public stratum 2 servers # see http://twiki.ntp.org/bin/view/Servers/NTPPoolServers #servers pool.ntp.org vi /etc/firewall # Allow NTP replies from time server. Be sure to change the IP address # to that of your NTP source. -A INPUT -p udp -s 10.10.10.123 --sport 123 -j ACCEPT /etc/init.d/network restart chmod +x /etc/init.d/ntpd
When configuration is finished you can check it by following these steps.
Here is an example of a successful test for a machine with a clock that was off by a few minutes and is slowly being brought back into sync with the network time source.
login: root password: # /etc/init.d/ntpd start Time synchronization service is starting. # tail /var/log/syslog ntpd: ntp engine ready ntpd: peer 10.10.10.123 now valid ntpd: adjusting local clock by 167.683291s ntpd: adjusting local clock by 167.609554s ntpd: adjusting local clock by 167.483246s
Here are some troubleshooting steps you can try if things are not working right.