How to configure NTP server and client in CentOS / RHEL 7?

The example discussed below is for a basic NTP server and client. NTP stands for Network Transport Protocol and it is used to keep the time on the servers synced with each other using a common reliable source to get the time.

 

NTP Server Configuration

 

1. Install the required ntp package on the server.

# yum install ntp

 

2. Ensure the following entries are in ntp configuration file /etc/ntp.conf.

As per the configuration file the NTP servers servers only to the NTP clients in the subnet 10.10.10.0/24. You can get the public NTP servers specific to your region from pool.ntp.org.

 

In the /etc/ntp.conf file you will have to mention the NTP server(s) in your environment.

 

3. Now you can start the ntpd service.

 

For RHEL 5,6:

# service ntpd start

 

For RHEL 7:

# systemctl start ntpd.service

 

NTP Client Configuration

 

1. For client NTP configuration, add the below configuration in the /etc/ntp.conf file.

 

Here, ntp.server.com is the server you configured as NTP server in the example shown at the start of the post. There can be multiple NTP servers for redundancy purpose. Add a new line for each of the NTP servers in the /etc/ntp.conf file.

 

2. Start the ntpd service on the ntp client server.

 

For RHEL 5,6:

# service ntpd start

 

For RHEL 7:

# systemctl start ntpd.service

 

Was this answer helpful? 0 Users Found This Useful (0 Votes)