User Tools

Site Tools


wiki:centos_ntp_server

This is an old revision of the document!


CentOS NTP Server

Oct 2019


Overview


This was created and tested using CentOS 7.6


Using NTP so sync CentOS is fairly straightforward, and all you need is an NTP source, of which there are many. However occasionally, it is advantageous to have your NTP source and clients all local.

NTP is more about ensuring the correct operation of a system, rather than just having the correct time (with exceptions of course, scheduling, SCTE really require accurate time).

In this example, I have three CentOS systems, and the first will be the NTP server, with the second two being NTP clients. I did this for a Split ABR Encoding system, so I did not have to rely on any external NTP servers.

NTP Server


If the OS was installed using a MediKind .iso, you may have to remove ChronyD:

  systemctl stop chronyd
  systemctl disable chronyd

Now install NTP:

  yum install ntp

The NTP settings will have to be modified, you will need to edit the following file.

  vim /etc/ntp.conf
  

Find the list of public servers:

# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.ntp.org/join.html).
server 0.centos.pool.ntp.org iburst
server 1.centos.pool.ntp.org iburst
server 2.centos.pool.ntp.org iburst
server 3.centos.pool.ntp.org iburst

restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap

# Hosts on local network are less restricted. restrict 10.43.30.0 mask 255.255.255.0 nomodify notrap

systemctl start ntpd systemctl enable ntpd

at this point, the server should have the correct time (if using UTC, depending on the time of year it could look 1 hour off).

NTP Clients


Remove ChronyD systemctl stop chronyd systemctl disable chronyd

yum install ntp

vim /etc/ntp.conf

server 10.43.30.11 iburst

# systemctl start ntpd # systemctl enable ntpd # systemctl status ntpd

date

wiki/centos_ntp_server.1570195764.txt.gz · Last modified: 2023/03/09 22:35 (external edit)