LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   LinuxQuestions.org Member Success Stories (http://www.linuxquestions.org/questions/linuxquestions-org-member-success-stories-23/)
-   -   Network Time Protocol (NTP): Are you sure it's working? (http://www.linuxquestions.org/questions/linuxquestions-org-member-success-stories-23/network-time-protocol-ntp-are-you-sure-its-working-192808/)

mchirico 06-12-2004 06:00 PM

Network Time Protocol (NTP): Are you sure it's working?
 
A few Quick Steps for Getting NTP Up and Running

The latest version of this and other tips can be found at
http://prdownloads.sourceforge.net/s...e.txt?download
(A tip is added each day to the above link)

TIP 1:

Getting NTP Working

STEP 1 (Is the current server working?):

Try issuing the following command:

$ ntpq -pn

remote refid st t when poll reach delay offset jitter
===================================================
tock.usno.navy 0.0.0.0 16 u - 64 0 0.000 0.000 4000.00

The above is an example of a problem.
Compare it to a working configuration.

$ ntpq -pn

remote refid st t when poll reach delay offset jitter
========================================================
+128.4.40.12 128.4.40.10 2 u 107 128 377 25.642 3.350 1.012
127.127.1.0 127.127.1.0 10 l 40 64 377 0.000 0.000 0.008
+128.91.2.13 128.4.40.12 3 u 34 128 377 21.138 6.118 0.398
*192.5.41.41 .USNO. 1 u 110 128 377 33.694 9.533 3.534

STEP 2 (Configure the /etc/ntp.conf):

$ cat /etc/ntp.conf

# My simple client-only ntp configuration.
server timeserver1.upenn.edu
# ping -a timeserver1.upenn.edu shows the IP address 128.91.2.13
# which is used in the restrict below
restrict 128.91.2.13
server tock.usno.navy.mil
restrict 192.5.41.41
server 128.4.40.12
restrict 128.4.40.12
server 127.127.1.0 # local clock
fudge 127.127.1.0 stratum 10
driftfile /etc/ntp/drift
restrict default ignore
restrict 127.0.0.0 mask 255.0.0.0
authenticate no

STEP 3 (Configure /etc/ntp/step-tickers):

The values for server above are placed in the "/etc/ntp/step-tickers" file

cat /etc/ntp/step-tickers

timeserver1.upenn.edu
tock.usno.navy.mil
128.4.40.12

STEP 4 (Restart the service and check):

Issue the restart command

/etc/init.d/ntpd restart

check the values for "ntpq -pn",
which should match step 1.

ntpq -pn

I hope this helps.

Regards,

Mike Chirico


All times are GMT -5. The time now is 05:19 AM.