Installing NTP (time synchronisation)

Set timezone (optional)
create symbolical link from /usr/share/zoneinfo/... to /etc/localtime:
ln -sf /usr/share/zoneinfo/Europe/Brussels /etc/localtime
Set UTC mode (optional)
if your hardware clock runs in UTC (Universal Coordinated Time) mode, add
to the /etc/sysconfig/clock file
Make sure ntpd is not running
Use service ntpd stop to stop it.
Choose the NTP server you will get your time from
it can be an internal server that has the NTP service open for clients, or an public NTP server. To be sure, use 2 servers. To check if you can access it, run ntpdate
Edit the /etc/ntp.conf file
Rename the current file to ntp.bak.conf and make a small new one:
restrict default ignore<br /> server # Swiss time<br /> server # Univ of California, San Diego<br /> restrict mask nomodify notrap noquery<br /> restrict mask nomodify notrap noquery<br /> server # local clock<br /> fudge stratum 10 #so it only takes over if the rest fails<br /> restrict driftfile /etc/ntp/drift broadcastdelay 0.008 authenticate no
Set your system clock right
Run the following command a couple of times:
ntpdate -u # or whatever server you want to use
You will see the initial diffence in time go away afer the 2nd or 3rd time.
Set hardware clock
/sbin/hwclock --systohc
Run the ntpd daemon
service ntpd start
Add ntpd to the services started at boot time
chkconfig ntpd on
Check the NTP results
ntpd -p
will show you what the difference is between your clock and that of the servers you added. You are looking for lines like
<br /> remote refid st t when poll reach delay offset jitter<br /> ==========================================================================<br /> LOCAL LOCAL 10 l 30 64 377 0.000 0.000 0.004 *<br /> 3 u 41 128 177 0.313 5.598 0.345
and not lines like
<br /> remote refid st t when poll reach delay offset jitter<br /> ==========================================================================<br /> LOCAL 11 u 37 128 375 0.204 6082.02 6069.84
Jitter is too high!
💬 Linux 🏷 Linux 🏷 ntp 🏷 synchronisation 🏷 time