The software described in this documentation is either in Extended Support or Sustaining Support. See https://www.oracle.com/us/support/library/enterprise-linux-support-policies-069172.pdf for more information.
Oracle recommends that you upgrade the software described by this documentation as soon as possible.

14.1.1 Configuring the ntpd Service

To configure the ntpd service on a system:

  1. Install the ntp package.

    # yum install ntp
  2. Edit /etc/ntp.conf to set up the configuration for ntpd.

    Note

    The default configuration assumes that the system has network access to public NTP servers with which it can synchronise. The firewall rules for your internal networks might well prevent access to these servers but instead allow access to local NTP servers.

    The following example shows a sample NTP configuration for a system that can access three NTP servers:

    server NTP_server_1
    server NTP_server_2
    server NTP_server_3
    server  127.127.1.0
    fudge   127.127.1.0 stratum 10
    driftfile /var/lib/ntp/drift
    restrict default nomodify notrap nopeer noquery

    The server and fudge entries for 127.127.1.0 cause ntpd to use the local system clock if the remote NTP servers are not available. The restrict entry allows remote systems only to synchronise their time with the local NTP service.

    For more information about configuring ntpd, see http://doc.ntp.org/4.2.6p5/manyopt.html.

  3. Create the drift file.

    # touch /var/lib/ntp/drift
  4. If remote access to the local NTP service is required, configure the system firewall to allow access to the NTP service on UDP port 123, for example:

    # iptables -I INPUT -p udp -m udp --dport 123 -j ACCEPT
    # service iptables save
  5. Start the ntpd service and configure it to start following a system reboot.

    # service ntpd start
    # chkconfig ntpd on

You can use the ntpq and ntpstat commands to display information about the operation of ntpd, for example:

# ntpq -p
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
*ns1.proserve.nl 193.67.79.202    2 u   21   64  377   31.420   10.742   3.689
-pomaz.hu        84.2.46.19       3 u   22   64  377   59.133   13.719   5.958
+server.104media 193.67.79.202    2 u   24   64  377   32.110   13.436   5.222
+public-timehost 193.11.166.20    2 u   28   64  377   57.214    9.304   6.311
# ntpstat
synchronised to NTP server (80.84.224.85) at stratum 3 
   time correct to within 76 ms
   polling server every 64 

For more information, see the ntpd(8), ntpd.conf(5), ntpq(8), and ntpstat(8) manual pages and http://doc.ntp.org/4.2.6p5/.