pantz.org banner
Configuration of NTP (Network Time Protocol)
Posted on 01-12-2006 20:13:00 EST | Updated on 01-12-2006 20:13:00 EST
Section: /software/ntp/ | Permanent Link

Network Time Protocol (NTP) is a protocol used to help synchronize your computer systems clocks with an accurate time source. "Stratum 1" (NTP sites that use an atomic clock for timing) and "Stratum 2" (NTP sites that have slightly less accurate time sources) sites that allow the general public to synchronize with them. You should have at least one server on your network be the local time server for all your other devices (routers, computers, etc), this makes the correlation of system events on different systems much easier. You should also use 3 or more external time servers for your local NTP server.

NTP version 3 is an internet draft standard, formalized in RFC 1305. NTP version 4 is a significant revision of the NTP standard, and is the current development version, but has not been formalized in an RFC. Simple NTP (SNTP) version 4 is described in RFC 2030.

To learn more about NTP and how to configure and use it check out ntp.org.

Don't confuse the above or below with OpenNTPD from the OpenBSD group. Both are an implementation of the Network Time Protocol. They do many of the same things. But they use different looking config files and command options.

Useful programs that work with NTP

* ntpd - Network Time Protocol (NTP) daemon
* ntpq - standard NTP query program
* ntpdc - special NTP query program
* ntpdate - set the date and time via NTP
* ntptrace - trace a chain of NTP servers back to the primary source
* tickadj - set time-related kernel variables
* ntptime - read kernel time variables
* ntp-keygen - generate public and private keys
* ntpdsim - Network Time Protocol (NTP) simulator

The configuration file below is an example of an NTP configuraiton file. Don't confuse this with an OpenNTPD config file. This config file is usually located in the file /etc/ntp.conf.

# ntpd will use syslog() if logfile is not defined
#logfile /var/log/ntpd

driftfile /var/lib/ntp/ntp.drift
statsdir /var/log/ntpstats/

# Extra stats (not needed if you dont want stats)
statistics loopstats peerstats clockstats
filegen loopstats file loopstats type day enable
filegen peerstats file peerstats type day enable
filegen clockstats file clockstats type day enable

## Allow internel network
restrict 127.0.0.1
restrict 192.168.0.0 mask 255.255.255.0 notrust nomodify notrap

## Example of local time server to query
#server 10.0.10.10
#restrict 10.0.10.10 mask 255.255.255.255 nomodify notrap noquery

## Example of external servers to query
server ntp0.cornell.edu
server ntp-1.ece.cmu.edu
server ntp-2.ece.cmu.edu
server clock-1.cs.cmu.edu
server cuckoo.nevada.edu
server sundial.columbia.edu
server time-b.nist.gov
server time-c.timefreq.bldrdoc.gov
server tock.usno.navy.mil

## Restrict the outsite servers we are quering
restrict ntp0.cornell.edu             mask 255.255.255.255 nomodify notrap noquery
restrict ntp-1.ece.cmu.edu            mask 255.255.255.255 nomodify notrap noquery
restrict ntp-2.ece.cmu.edu            mask 255.255.255.255 nomodify notrap noquery
restrict clock-1.cs.cmu.edu           mask 255.255.255.255 nomodify notrap noquery
restrict cuckoo.nevada.edu            mask 255.255.255.255 nomodify notrap noquery
restrict sundial.columbia.edu         mask 255.255.255.255 nomodify notrap noquery
restrict time-b.nist.gov              mask 255.255.255.255 nomodify notrap noquery
restrict time-c.timefreq.bldrdoc.gov  mask 255.255.255.255 nomodify notrap noquery
restrict tock.usno.navy.mil           mask 255.255.255.255 nomodify notrap noquery

Del.icio.us! | Digg Me! | Reddit!

Related stories


RSS Feed RSS feed logo
About


3com
alsa
alsactl
alsamixer
amd
apache
areca
ati
auditd
awk
badblocks
bind
bios
bonnie
cable
carp
cat5
cdrom
centos
chart
cifs
cisco
comcast
commands
comodo
compiz-fusion
cron
crontab
crossover
cups
cvs
database
dd
dd_rescue
debian
decimal
dhclient
dhcp
diagnostic
diskexplorer
disks
dns
dos
dovecot
dsniff
dvdauthor
e-mail
editor
emerald
ethernet
ext3
fat32
fedora
fetchmail
fiber
filesystems
firefox
firewall
flexlm
floppy
flowtools
format
ftp
gdm
gnome
greylisting
growisofs
grub
harddrive
hba
hex
hfsc
html
http
idl
ie
intel
ios
ipmi
iptables
irix
javascript
kde
kernel
kmail
kprinter
krecord
kubuntu
linux
logfile
maradns
matlab
memory
mencoder
mhdd
mkinitrd
mkisofs
motherboard
mouse
movemail
mplayer
multitail
mutt
myodbc
mysql
mythtv
nagios
nameserver
netflow
nic
ntfs
ntp
nvidia
odbc
openbsd
openntpd
openoffice
openssl
opteron
parted
partimage
patch
perl
pf
pfflowd
pfsync
photorec
php
pop3
pop3s
ports
postfix
power
procmail
proftpd
proxy
pxe
qemu
r-studio
raid
recovery
router
rpc
rsync
samba
schedule
scsi
seatools
sendmail
sgi
shell
siw
smtp
snort
solaris
soundcard
spam
spamd
sql
sqlite
squid
ssh
ssl
subnet
sun
supermicro
switches
symbols
systemrescuecd
t1
tcpip
telnet
terminal
testdisk
tftp
thttpd
thunderbird
timezone
tools
tr
tuning
tunnel
vi
wget
windows
windowsxp
wireless
wpa_supplicant
x
xauth
xfree86
xfs
xinearama
xmms
zdump
zic
zlib