Difference between revisions of "NTP Network Time Protocol How To"

From RidgeRun Developer Connection
Jump to: navigation, search
m (Client / Server Configuration)
m (Client / Server Configuration)
Line 38: Line 38:
echo "ntp            123/udp >> /etc/services
echo "ntp            123/udp >> /etc/services
== Client Configuration==
A target device is configured in client mode as follows
using the server (sic) command and specifying the server DNS name or IPv4 or IPv6 address; the server requires no prior configuration. The iburst option described later on this page is recommended for clients, as this speeds up initial synchronization from several minutes to several seconds. The burst option described later on this page can be useful to reduce jitter on very noisy dial-up or ISDN network links.
Ordinarily, the program automatically manages the poll interval between the default minimum and maximum values. The minpoll and maxpoll options can be used to bracket the range. Unless noted otherwise, these options should not be used with reference clock drivers.

Revision as of 11:40, 8 September 2010

Most of the text in this How to is taken from the massively documented NTP package.


The Network Time Protocol (NTP) is widely used to synchronize a computer to Internet time servers. It can also be used as a server for dependent clients. It provides accuracies typically less than a millisecond on LANs and up to a few milliseconds on WANs.

Client / Server Configuration

Client/server mode is the most common configuration in the Internet today. It operates in the classic remote-procedure-call (RPC) paradigm with stateless servers and stateful clients. In this mode a host sends a client (mode 3) request to the specified server and expects a server (mode 4) reply at some future time. In some contexts this would be described as a "pull" operation, in that the host pulls the time and related values from the server.

Server Configuration

For a Ubuntu host acting as an NTP server, typically nothing needs to be done, beyond grabbing the IP address.

Do verify ntpd is running:

pgrep ntpd

If a number is returned (the PID for the ntpd daemon), then your configuration is correct.

Client Configuration

A target device is configured in client mode as follows


echo "server $NTP_SERVER" > /etc/ntp.conf
echo "statsdir /tmp/ntp_statistics" >> /etc/ntp.conf
echo "driftfile /tmp/ntp_drift" >> /etc/ntp.conf
echo "iburst" >> /etc/ntp.conf
chmod ugo+r /etc/ntp.conf

echo "ntp             123/tcp" >> /etc/services
echo "ntp             123/udp >> /etc/services