Published by exdone
Posted on March 07, 2019
Network Time Service.
setting up a time server is pretty straight forward once you have some understanding. Being a linux user , it pretty hard to find a reliable public time server. Most of them are slow and hard to reach. I decided to setup a private time server for my internal and external servers.
There are two time clients you can use on Linux ,Chronyd and NTPD. There configuration is similar but i am sure there are some differences between the two.
Client setup :: Chronyd
systemctl enable chronyd
systemctl start chronyd
systemctl status chronyd
chronyc -a ‘burst 4/4’
if your system time is super behind. it can take some time for Chronyd to catch up. Use the command below to force it to update.
chronyc -a makestep
Other good commands.
chronyc -a ‘burst 4/4’
chronyc tracking
chronyc sources
Client setup :: NTPD
systemctl enable ntpd
systemctl start ntpd
systemctl status ntpd
ntpq -p
ntpdate -q
Allowing time queries from remote machines
Set the restriction
restrict 192.168.1.0 netmask 255.255.255.0 nomodify notrap
We developed a python/C program that forces the hwclock to be in sync with the SW Clock. The tool will also query the time server and ensure the sw clock is in sync. We wanted to make sure the time was in sync for application logging. I will post the code to our public github soon