Using ntp with Red Hat Linux/Fedora Core

Here are the steps to configure Network Time Protocol (ntp) with Red Hat Linux/Fedora Core.

1. Select time servers. I recommend using three ntp servers from pool.ntp.org; you may specify your country code when selecting servers from the ntp pool for the most accurate results. Please see http://www.pool.ntp.org/ for more information.

2. Edit /etc/ntp.conf and add the time servers in the "OUR TIMESERVERS" section. In this example, I am using the three timeservers 0.us.pool.ntp.org, 1.us.pool.ntp.org, and 2.us.pool.ntp.org.

vi /etc/ntp.conf
/OUR TIMESERVERS

Add:
restrict 0.us.pool.ntp.org mask 255.255.255.255 nomodify notrap noquery
restrict 1.us.pool.ntp.org mask 255.255.255.255 nomodify notrap noquery
restrict 2.us.pool.ntp.org mask 255.255.255.255 nomodify notrap noquery
server 0.us.pool.ntp.org
server 1.us.pool.ntp.org
server 2.us.pool.ntp.org

3. Before starting the ntpd daemon, run ntpdate to synchronize your clock with a time server. ntpd will not synchronize your clock with a time server if your system clock is significantly off NTP time.
ntpdate -u 0.us.pool.ntp.org

As an alternative, you can add your time servers to /etc/ntp/step-tickers. You do not need to manually run ntpdate to synchronize your clock as ntpd will query these time servers if your clock is significantly off NTP time.

4. Configure ntpd to start with the next system boot.
/sbin/chkconfig ntpd on

5. Start the ntpd daemon immediately.
/sbin/service ntpd start

The graphical user interface utility redhat-config-date (Red Hat Linux) or system-config-date (Fedora Core) may also be used to administer NTP.

Back to brandonhutchinson.com.

Last modified: 07/18/2005