FreeKB - Install and setup an NTPd server in Linux
NTPd - Install and setup an NTPd server in Linux

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

 

The ps command can be used to determine if your system is using init or systemd. If PID 1 is init, then you will use the service command. If PID 1 is systemd, then you will use the systemctl command.

If your system is using systemd, use the systemctl command to start and enable ntpd.

systemctl enable ntpd
systemctl start ntpd
systemctl status ntpd

 

If your system is using init, use the chkconfig and service commands to start and enable ntpd.

chkconfig ntpd on
service ntpd start
service ntpd status

 

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 c49fb in the box below so that we can be sure you are a human.




Comments

Web design by yours truely - me, myself, and I   |   jeremy.canfield@freekb.net   |