Contact for queries :


  UpComing Live WebEx Workshop Series

Configruing NTP Services in Linux ( RHEL5/6)

The NTP service is responsible for maintaining the system time, which is highly important in any  environment because so many things rely on time (logs, error messages, applications, and so on). There are
a few different roles that your system can have when using NTP. They include

  • Primary NTP Server Provides time to secondary NTP servers or clients
  • Secondary NTP Server Provides time to clients; helps load balance primary NTP servers
  • NTP Peer Provides and receives time
  • NTP Client Receives time from primary or secondary NTP servers

According to the Red Hat Exam Prep Guide, you need to be able to synchronize clients with a higher-stratum server. The term stratum is used to define different levels, from 1 to 15, of time servers that are available to sync with. A stratum 1 time server is the most accurate. For load balancing and redundancy, you would probably want to configure a primary NTP server and a secondary NTP server to sync with a stratum 1 time server (which is located off your network). Now let’s look more closely at both the server and client side of NTP.

Task 1 : Installing a Time Server

Usually, the NTP package comes installed as part of your Red Hat system, but it is always good to know how to install it should you ever need to.

Step 1. If you need to, install the package:

# yum install -y ntp

Step 2. Verify that the package has been installed:

# rpm -qa | grep ntp

Step 3. Make sure that the service will start when the system boots up:

# chkconfig ntpd on

Step 4. Verify the service starts on boot:

# chkconfig ntpd –list
ntpd 0:off 1:off 2:on 3:on 4:on 5:on 6:off

Before starting the service, let’s configure the system first.

Task 2: Configuring NTP Server

To configure the primary NTP server, let’s look at part of the config file that comes with the system:

# cat /etc/ntp.conf


#fudge stratum 10

The first three lines shown here are the Internet (public) NTP servers that you sync with for the correct time. The fourth server option, which is commented out, defines a local clock driver that you can use to update the time. This is usually based on the BIOS click if used.

The final option, fudge, defines the stratum level to which your server is set. The server here is set at a stratum level of 10; a local system clock is also defined, and there are three public Internet servers you can sync with for accurate time.

For now, just let the system sync with the public Internet time servers.

Step 1. Start the NTP service:

# service ntpd start
Starting ntpd: [ OK ]

With the server configured, you can turn your attention over to one of the client systems. For this example,  use the Client01 system to sync  with the RHEL01 primary NTP server.On Client01, you need to verify
that the NTP package is already installed:

# rpm -qa | grep ntp

With the client installed, again look at the config file. Instead of public servers, you can set the RHEL01 system as the primary server to sync with.

Step 2. Define RHEL01 as the primary time server and make sure the driftfile line is uncommented:

# cat /etc/ntp.conf

driftfile /var/lib/ntp/drift

Now the client is looking at RHEL01 to sync its time. The additional option, driftfile, is a scratch place for the NTP service to calculate time checks and errors for accuracy. It is recommended for better results
but not required.

Step 3. Now that the client is configured, you just need to start the service:

# service ntpd start
Starting ntpd: [ OK ]

Please refer below links to know about:

November 16, 2015

0 responses on "Configruing NTP Services in Linux ( RHEL5/6)"

Leave a Message

Your email address will not be published. Required fields are marked *


IGURKUL I.T. Training Hub offering various Career Certification courses in Computer Networking, Unix, Linux, Cloud Computing and DevOps Technologies. With its rich experience in IT training service sector, iGURKUL has been able to set Industry best practices in IT Training for the past five years.

In Past five years, more than 5000 professionals have been trained by iGURKUL for System administration, Cloud Computing and DevOps Skill set through our Online Training portal And , each day , more than 10000 working professionals from all over the globe visiting our knowledge base for the best practices and Knowledge learning.

copyright protected - 2011 © igurkul I.T. solutions. All rights reserved.