How to install and setup an NTPd server in Linux

Home > Search > How-to
  by

Use apt-get or yum to install the NTP daemon.

[root@server1 ~]# yum install ntp

 

Ensure the /etc/ntp.conf file contains 4 NTP servers. Instead of "distro" being listed, the name of the distribution should be listed, such as ubuntu, redhat, or centos. Your NTPd server will get time from these 4 NTP servers.

[root@server1 ~]# cat /etc/ntp.conf
. . .
server 0.distro.pool.ntp.org iburst
server 1.distro.pool.ntp.org iburst
server 2.distro.pool.ntp.org iburst
server 3.distro.pool.ntp.org iburst
. . .

 

To confiure your local NTP server to allow other computers in your network to use the machine as the NTP server, enter your network address and prefix.

broadcast 192.168.0.0/24

 

Start the NTP daemon, and ensure the daemon is active and running.

[root@server1 ~]# systemctl start ntpd
[root@server1 ~]# systemctl status ntpd

 

Configure the NTP daemon to automatically start if the OS is rebooted.

[root@server1 ~]# systemctl enable ntpd

 

Use the date command to verify the NTP server is getting the correct date and time from the NTP pool.

[root@server1 ~]# date
Mon Jan 01 00:01:01 CDT 2016

 


Client PCs in your network can now be configured to use your NTP server.

  • Click here to configure a Linux PC to use your NTP server

 

 


STRATUM

NTP uses a term stratum to describe how far a device is from the reference clock. 

  • Stratum 0 is the reference clock.
  • Stratum 1 are the ntp.pool servers.
  • Stratum 2 is typically an internal NTP server.
  • Stratum 3 and below are devices in the LAN that are configured to use the internal NTP server.

Stratum can be 16 layers deep maximum.



Add a Comment




We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.




Please enter in the box below so that we can be sure you are a human.




Comments