Ntp Service

Linux

Documentation

Server

  • with the same service "ntpd" in linux you can do client and server
  • you need to have the ntp service installed and running and inside the ntp server and client
  • the main difference (not the only one) is that in the server it points to an external one in the client instead point to the server private dns/ip
  • in the servers firewall don't forget to open the port udp/123 to receive the call

Verification

client machine with a NEVER working ntp server

~> ntpq -p
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
 ip-172-29-1-209 .INIT.          16 u    -   64    0    0.000    0.000   0.000

the same machine after that you fixed the problem

~> ntpq -p
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
*ip-172-29-1-209 52.17.30.119     3 u   39   64    3    0.687   -9.021   4.911

if the server doesn't respond anymore you will notice that the when number is higher than the poll number

~> ntpq -p
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
*ip-172-29-1-209 193.104.228.123  3 u   96   64  376    0.627    4.330   1.301

information about the ntpq -p command

peers
Obtains a list of in-spec peers of the server, along with a summary of each peer's state. Summary information includes:
the address of the remote peer
the reference ID (0.0.0.0 if the reference ID is unknown)
the stratum of the remote peer
the type of the peer (local, unicast, multicast or broadcast)
when the last packet was received
the polling interval, in seconds
the reachability register, in octal
the current estimated delay, offset and dispersion of the peer, all in seconds
The character in the left margin indicates the fate of this peer in the clock selection process. The codes mean:

<sp>
discarded due to high stratum and/or failed sanity checks

x
designated falsticker by the intersection algorithm

.
culled from the end of the candidate list

-
discarded by the clustering algorithm

+
included in the final selection set

#
selected for synchronization but distance exceeds maximum

*
selected for synchronization

o
selected for synchronization, PPS signal in use
Note that since the peers command depends on the ability to parse the values in the responses it gets, it may fail to work from time to time with servers which poorly control the data formats.

The contents of the host field may be one of four forms:

a host name
an IP address
a reference clock implementation name with its parameter
REFCLK(implementation_number, parameter)
On hostnames no only IP addresses will be displayed.

Multiple servers

in this example you can see after a while the not working server ip-172-29-1-169 is not anymore the selected one

~> ntpq -p
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
 ip-172-29-1-209 .INIT.          16 u    -  256    0    0.000    0.000   0.000
+ip-172-29-1-226 52.209.118.149   3 u   17   64  377    0.596  -12.311   3.963
*ip-172-29-1-169 193.1.219.116    2 u   86   64  376    0.660   -6.848   7.641

 ~> ntpq -p
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
 ip-172-29-1-209 .INIT.          16 u    - 1024    0    0.000    0.000   0.000
*ip-172-29-1-226 52.209.118.149   3 u   74  128  377    0.644    3.143   2.923
 ip-172-29-1-169 193.1.219.116    2 u 1512   64    0    1.052  -10.690   0.000

Windows 7

Utilissima pagina con tool per windows 7 e xp che non hanno la possibilità impostare il server ntp propriamente
http://www.inrim.it/ntp/howtosync_i.shtml

pool.ntp.org è sempre un servizio accettabile

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License