HOWTO: Configure a Local NTP Server on Ubuntu 9.10

Setting up a Network Time Protocol (NTP) server and configuring NTP clients on a LAN with Ubuntu 9.10. These instructions should also work for Ubuntu 10.x but may require slight tweaking for use with upstart.

# File:	HOWTO Configure a Local NTP server on Ubuntu.notes
# Date:	2010/03/16
# Refs: http://www.ubuntugeek.com/network-time-protocol-ntp-server-and-clients-setup-in-ubuntu.html
#       http://www.cameratim.com/computing/linux/time-serving
#       http://en.gentoo-wiki.com/wiki/NTP#Be_a_Time_Server
# Desc:	Setting up an NTP server and configuring NTP clients
#       on a LAN with Ubuntu 9.10

# -------------------------------------
#           Configure the Server
# -------------------------------------
# We can't uninstall ntpdate like the ubuntugeek reference 
# suggest because it will remove ubuntu-minimal along with it,
# which has a bunch of stuff we want. So, we just have to
# disable the ntpdate service
sudo update-rc.d -f ntpdate remove

# Install NTP
sudo apt-get install ntp

# Edit the ntp configuration file: /etc/ntp.conf
# Change the server lines to point to the pool servers
# you want to use. 
# In my case, we are on a LAN with no Internet access, 
# so I will be the master time keeper, so I commented
# out all server lines and added the following:
server 127.127.1.0

# Fudge your local server's local clock to a lowish stratum 
# so that other local computers will still use it as a time 
# source, but will resync to a better time source when
# they're able to.
# Using a stratum of 9 means it's considered better than the
# computer's own time (usually stratum 16 for unsynced, often 
# stratum 12 for stand-alone time servers), but will be
# considered a poor source of time compared to most other 
# servers (usually stratums ranging from 1 to 4), and will 
# be ignored in those cases (when better sources are available).
fudge 127.127.1.0 stratum 9

# Restart the ntp service
sudo service ntp restart

# -------------------------------------
#           Configure the Clients
# -------------------------------------
# Install NTP
sudo apt-get install ntp

# Edit the ntp configuration file: /etc/ntp.conf
# Change the server lines to point to the IP (or DNS record
# if you created one) of the LAN server created above
# Bonus Points if you have a DNS entry for the NTP server
server ns.test.com

# Restart the ntp service
sudo service ntp restart

Comments

One response to “HOWTO: Configure a Local NTP Server on Ubuntu 9.10”

  1. Phil Avatar
    Phil

    Hi,
    thanks for that, it works fine!
    I’ve configured it with Ubuntu Server 12.04 LTS
    cheers

Leave a Reply

Your email address will not be published. Required fields are marked *

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.