pantz.org banner
Configuration of NTP (Network Time Protocol)
Posted on 01-13-2006 01:13:00 UTC | Updated on 01-13-2006 01:13:00 UTC
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
3ware
alsa
alsactl
alsamixer
amd
android
apache
areca
arm
ati
auditd
awk
badblocks
bash
bind
bios
bonnie
cable
carp
cat5
cdrom
cellphone
centos
chart
chrome
cifs
cisco
cloudera
comcast
commands
comodo
compiz-fusion
corsair
cpufreq
cpufrequtils
cpuspeed
cron
crontab
crossover
cu
cups
cvs
database
dbus
dd
dd_rescue
ddclient
debian
decimal
dhclient
dhcp
diagnostic
diskexplorer
disks
dkim
dns
dos
dovecot
drac
dsniff
dvdauthor
e-mail
echo
editor
emerald
ethernet
expect
ext3
ext4
fat32
fedora
fetchmail
fiber
filesystems
firefox
firewall
flac
flexlm
floppy
flowtools
fonts
format
freebsd
ftp
gdm
gmail
gnome
greasemonkey
greylisting
growisofs
grub
hacking
hadoop
harddrive
hba
hex
hfsc
html
html5
http
https
idl
ie
ilo
intel
ios
iperf
ipmi
iptables
ipv6
irix
javascript
kde
kernel
kickstart
kmail
kprinter
krecord
kubuntu
kvm
lame
ldap
linux
logfile
lp
lpq
lpr
maradns
matlab
memory
mencoder
mhdd
mkinitrd
mkisofs
moinmoin
motherboard
mouse
movemail
mplayer
multitail
mutt
myodbc
mysql
mythtv
nagios
nameserver
netflix
netflow
nginx
nic
ntfs
ntp
nvidia
odbc
openbsd
openntpd
openoffice
openssh
openssl
opteron
parted
partimage
patch
perl
pf
pfflowd
pfsync
photorec
php
pop3
pop3s
ports
postfix
power
procmail
proftpd
proxy
pulseaudio
putty
pxe
python
qemu
r-studio
raid
recovery
redhat
router
rpc
rsync
ruby
saltstack
samba
schedule
screen
scsi
seagate
seatools
sed
sendmail
sgi
shell
siw
smtp
snort
solaris
soundcard
sox
spam
spamd
spf
sql
sqlite
squid
srs
ssh
ssh.com
ssl
su
subnet
subversion
sudo
sun
supermicro
switches
symbols
syslinux
syslog
systemrescuecd
t1
tcpip
tcpwrappers
telnet
terminal
testdisk
tftp
thttpd
thunderbird
timezone
ting
tls
tools
tr
trac
tuning
tunnel
ubuntu
unbound
vi
vpn
wget
wiki
windows
windowsxp
wireless
wpa_supplicant
x
xauth
xfree86
xfs
xinearama
xmms
youtube
zdump
zeromq
zic
zlib