Hi,

It’s not a big task, just install the service and change the config file a little bit.

apt-get install ntp

Then open the /etc/ntp.conf and paste the following:

# Global settings
driftfile /var/lib/ntp/ntp.drift
statistics loopstats peerstats clockstats
filegen loopstats file loopstats type day enable
filegen peerstats file peerstats type day enable
filegen clockstats file clockstats type day enable

# Serverlist
server 0.debian.pool.ntp.org iburst
server 1.debian.pool.ntp.org iburst
server 2.debian.pool.ntp.org iburst
server 3.debian.pool.ntp.org iburst

# Use myself as a server as well
server 127.127.1.0

# Lie to devices that we are stratum 5
fudge 127.127.1.0 stratum 5


# By default, exchange time with everybody, but don't allow configuration.
restrict -4 default kod notrap nomodify nopeer noquery
restrict -6 default kod notrap nomodify nopeer noquery

# Local users may interrogate the ntp server more closely.
restrict 127.0.0.1
restrict ::1

Then you will see, the first server will be the local, until the associations will be complete. To verify the connection use the following command:

ntpq -p
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
 209.118.204.201 128.9.176.30     2 u    -   64    1  189.288   41.093   2.411
 services.quadra 96.44.142.5      3 u    1   64    1  180.550   43.824   0.408
 host2.kingrst.c 129.6.15.29      2 u    -   64    1  139.681   41.910   3.217
 quirk.faceprint 200.98.196.212   2 u    1   64    1  110.541   40.208   0.292
*LOCAL(0)        .LOCL.           5 l    5   64    1    0.000    0.000   0.001
ntpq -p
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
+209.118.204.201 128.9.176.30     2 u    5   64    1  189.288   41.093   2.161
-services.quadra 96.44.142.5      3 u    4   64    1  180.550   43.824   1.011
+host2.kingrst.c 129.6.15.29      2 u    3   64    1  139.681   41.910   2.517
*quirk.faceprint 200.98.196.212   2 u    2   64    1  109.673   38.858   1.191
 LOCAL(0)        .LOCL.           5 l   11   64    1    0.000    0.000   0.001

That’ all!

Advertisements