Setting up an OpenBSD NTP server (and time synchronizing Windows clients) |
(Last modified: 04/09/01)
If you have any questions or comments, feel free to drop me a note.
Note that I've written most of this document from memory. It appears to be correct; if I've missed something, let me know.
(( Internet )) | ------------------ | OpenBSD firewall | ------------------ | ( various windows and unix hosts )I will describe the setup on the OpenBSD firewall, and my main desktop machine (which is a Windows based box).
Also, make sure your /etc/localtime file is linked to the correct time zone file for your region. For example, if you were in the Canadian Atlantic time zone, your /etc/localtime file should be linked as follows (from afterboot(8)):
ln -fs /usr/share/zoneinfo/Canada/Atlantic /etc/localtimeThis will designate Atlantic Standard Time as your system's time zone.
server 165.227.1.1 prefer server 140.162.1.3 restrict default ignore restrict 165.227.1.1 noquery nomodify notrap nopeer restrict 140.162.1.3 noquery nomodify notrap nopeer restrict 127.0.0.1 nomodifySee the references section for information on where to find public NTP servers.
If you would like the OpenBSD machine's system time to be synchronized on boot, modify the ntpdate_flags variable in /etc/rc.conf to equal one of the servers specified in your ntp.conf file.
Running this command is a good idea, as any significant deviation of your system's time from the actual time (as reported by the configured servers) will cause NTPD to exit (and therefore leave your system time desynched from the rest of the world).
To monitor the status of the NTP daemon, use the utility /usr/local/sbin/ntpq. This is an interactive client to the NTP daemon running on your machine. The two commands I find most helpful in debugging the NTP daemon are "pe" and "rv", which allow you to see a peer list and read the current NTP variables, respectively. See the NTPD documentation for more details.
If you would like NTPD to run automatically the next time your system is re- started, modify the ntpd variable in /etc/rc.conf to equal "YES".
restrict 10.0.0.0 mask 255.255.255.0 nomodify nopeerUse your network address and mask if applicable.
To configure AboutTime to poll your local NTP server (i.e. the OpenBSD box), start the application and remove all hosts under the Time Hosts tab.
Next, add an entry for your local (OpenBSD) NTP server. Set the protocol to SNTP.
Next (optional), disable all protocols under Time Servers, except SNTP.
Under Options, make sure it is polling at a reasonable interval.
Finally, have AboutTime set the time at startup.
I also suggest making a shortcut to the AboutTime executable in the Startup folder for the system. Under Windows NT, this directory is (usually) located at:
C:\WINNT\Profiles\All Users\Start Menu\Programs\StartupWhen the machine boots, AboutTime will now be started automatically. If the Set Time When Starting option was set, it will also sync with your local time server.
Test your setup: under the Control/Time Client tab, click Set Time, and make sure the Windows machine synchronizes properly. If not, recheck your configuration on both the OpenBSD and Windows machines.
To get a fairly accurate reading of the current time from the US Naval Observatory, check out: http://tycho.usno.navy.mil/cgi-bin/timer.pl.
http://www.eecis.udel.edu/~mills/ntp/html/notes.htm
A List of public NTP servers can be found at:
http://www.eecis.udel.edu/~mills/ntp/servers.html
Complete documentation can be found at:
http://www.eecis.udel.edu/~mills/ntp/html/index.htm
The Time Synchronization homepage:
http://www.eecis.udel.edu/~ntp/
Copyright (c) 2000,2001 Robert Mooney, All rights reserved.
This document may be freely distributed and modified, so long as the original author is credited.
If you are inclined, you can leave me a tip with PayPal. Sign up for it.
Return to the Main index |