ntp

Charles Steinkuehler charles at steinkuehler.net
Thu Apr 11 21:50:11 CDT 2002


> Thanks Hal...I looked, but didn't find much.
> Anyway, I have ntp-4.1.1 downloaded and installed.  The docs say the
> ntp.conf file is provided, but there is not an ntp.conf file in /etc.
>
> Can I just create this file myself, and set it up to basically match the
> example presented?  From the docs I've perused in the last hour, this
> looks way over my poor head.  I tried this a few months ago and had to
> give up....thought I might be a little better prepared now...foolish me.

First: Run ntpdate to set your current time/date to something rational...ntp
will die if your clock's too far out of wack.

I'm attaching a (hopefully) helpful file I currently use for my local NTP
server.  Just stick it in /etc/ntp.conf and you should be OK...only do this
with *one* server on your network.  Point all other systems to your local
master NTP system (it's considered impolite to slave more than one server
off a publicly available ntp server).  Lists of public servers can be found
at various locations around the 'net.

Run "ntpq -p" to see if your local ntp service is synced to a remote ntp
server, or if it's running "unlocked".

Warning:  ntp does not seem to deal with aliased IP's gracefully, although
it binds to the 0.0.0.0 (all IP's) address.  I have had trouble getting
clients to see an ntp server if they were not pointed to the "primary" IP of
the ntp box...secondary IP's didn't work :<  YMMV

If you're runnign RedHat, there are pre-built hooks to copy the (presumably
correct via ntp updates) system clock to the hardware clock when shutting
down, and support for the file /etc/ntp/step-tickers, which will enable
running ntpdate prior to launching ntpd on startup (see /etc/init.d/ntpd).

Charles Steinkuehler
charles at steinkuehler.net

Example ntp.conf...replace/comment the various server lines as desired...

For all systems but your local ntp server, only keep the server 127.127.1.0
line, and a server line referring to your local NTP server (ie
tick.yourdomain.com, or whatever you call it).

[charles at auburn charles]$ cat /etc/ntp.conf

#
# Undisciplined Local Clock. This is a fake driver intended for backup
# and when no outside source of synchronized time is available. The
# default stratum is usually 3, but in this case we elect to use stratum
# 0. Since the server line does not have the prefer keyword, this driver
# is never used for synchronization, unless no other other
# synchronization source is available. In case the local host is
# controlled by some external source, such as an external oscillator or
# another protocol, the prefer keyword would cause the local host to
# disregard all other synchronization sources, unless the kernel
# modifications are in use and declare an unsynchronized condition.
#
server  127.127.1.0     # local clock
fudge   127.127.1.0 stratum 10

#
# Drift file.  Put this in a directory which the daemon can write to.
# No symbolic links allowed, either, since the daemon updates the file
# by creating a temporary in the same directory and then rename()'ing
# it to the file.
#
driftfile /etc/ntp/drift

# Stratum 1 servers
server clock.isc.org                    # Internet Software Consortium, Palo
Alto, CA
#server clock.via.net                   # ViaNet Communications, Palo Alto,
CA, USA
#server ntp-cup.external.hp.com         # Cupertino CA (SF Bay area)
37:20N/122:00W
#server timekeeper.isi.edu              # USC Information Sciences
Institute, Marina del Rey, CA
server  usno.pa-x.dec.com               # Systems Research Center, Compaq
Computer Corp. Palo Alto, CA
server  navobs1.usnogps.navy.mil        # Falcon AFB, Colorado
server  tick.usno.navy.mil              # U.S. Naval Observatory,
Washington, DC
server  navobs1.wustl.edu               # Washington University, St. Louis,
MO
#server terrapin.csc.ncsu.edu           # North Carolina State University,
Raleigh, NC
#server lerc-dns.lerc.nasa.gov          # NASA Lewis Research Center,
Cleveland, OH
server  now.okstate.edu                 # Oklahoma State University,
Stillwater, OK
server otc1.psu.edu                     # Penn State University, University
Park, PA

# Stratum 2 servers
server  ntp-2.cso.uiuc.edu              # University of Illinois,
Urbana-Champaign, IL
server  gilbreth.ecn.purdue.edu         # Purdue University Engineering
Computer Network, West Lafayette, IN
#server ntp1.kansas.net                 # KansasNet OnLine Services,
Manhattan, KS
#server clock.linuxshell.net            # LinuxShell Hosting, New York, NY,
US
server  ntp.ctr.columbia.edu            # Columbia University Center for
Telecommunications Research; NY, NY
server  ntp0.cornell.edu                # Cornell University, Ithaca, NY
server  ntp.tmc.edu                     # Baylor College of Medicine,
Houston, Tx
server  ntp.css.gov
server  ntp.ucsd.edu

#
# Authentication delay.  If you use, or plan to use someday, the
# authentication facility you should make the programs in the auth_stuff
# directory and figure out what this number should be on your machine.
#
#authenticate no
disable auth

#
# Keys file.  If you want to diddle your server at run time, make a
# keys file (mode 600 for sure) and define the key number to be
# used for making requests.
# PLEASE DO NOT USE THE DEFAULT VALUES HERE. Pick your own, or remote
# systems might be able to reset your clock at will.
#
#keys           /etc/ntp/keys
#trustedkey     65535
#requestkey     65535
#controlkey     65535




More information about the Kclug mailing list