Installing NTP on Linux

Installing and configuring the NTP service on your computer will allow it to keep time accurately; typically with an accuracy measured in milliseconds. The main benefits in doing this are (1) you can be certain of the timestamps recorded in your log files and (2) your copy of xclock will always be accurate.

Installation

Most distributions of Linux should come an xntpd package. You should install this in the usual way.

Configuration

To configure it, edit (or create) /etc/ntp.conf so it contains (only) the following three lines:

server <gateway IP address>
driftfile /etc/ntp/drift
authenticate no

Replace the entry for <gateway IP address> with the IP address of your gateway. For most subnets, this is your system's IP address with the last part changed to 250, that is, for 137.222.12.22, the gateway is 137.222.12.250. However, users on subnets 26, 62, 63, 133, 136, 154 and 168 should use 137.222.18.1 as their server.

Please note: These settings are specific to the University of Bristol.

Ensure that you have a directory /etc/ntp and in it, a file /etc/ntp/step-tickers containing the single line:

ntp0 ntp1 ntp2 ntp3

Starting xntpd at boot

RedHat

My favoured way of doing this is to use the ntsysv command: scroll down to the entry for xntpd, hit space until an asterisk (*) shows against it, tab to the OK button and hit enter.

SuSE

On SuSE (tested with SuSE 6.4), close down any running copies of YaST and edit the entries for START_XNTPD and XNTPD_INITIAL_NTPDATE in /etc/rc.config to read as follows:

START_XNTPD=yes
XNTPD_INITIAL_NTPDATE="ntp0 ntp1 ntp2 ntp3"

Starting xntpd immediately

RedHat

/etc/rc.d/init.d/xntpd start

SuSE

/sbin/init.d/xntpd start