Jonathan's Contribution

Linux Configuration

Gateway Time Serving


[Home] [Up] [Prev] [Next]

Time Server

We use xntp3 as our time server from David Mills. It is a comprehensive implementation ntp protocol. xntp3 is a Redhat stock item. Although it's documentation appears daunting, its setup is quite simple. Once the package is installed, edit /etc/ntp.conf.
 
>>>>>>>>>>>>>>>>>>>/etc/ntp.conf
server time.nrc.ca
server timelord.uregina.ca
server ntp1.mainecoon.com

broadcast 192.168.0.255

driftfile /etc/ntp/drift
<<<<<<<<<<<<<<<<<</etc/ntp.conf
 
Basically this file tells xntpd to synchronize with the best time base of the three selected servers. The broadcast instruction specifies the address to send the broadcast tick on. To achive precision in the order of micro-secs we need a drift file which xntpd needs to store drift info.
 
A selection of servers to choose from can be found at: http://www.eecis.udel.edu/~mills/ntp/clock2.htm
 
It is considered good form to send an email of thanks to the time server sysops from which you are sync'ing.
 
xntpd will attempt to sync with the specified servers. If the time difference between the time servers and this host is greater than 1000 seconds, xntpd quits silently with a message to /var/log/messages. This is a bit of a problem for my non-y2k PC that I use as the ntp server. (gateway is a 1993 vintage dx2-66). There is a RedHat sysconfig special where it is possible to sync to servers prior to starting xntpd. This requires the servers to be specified on a single line in a file /etc/ntp/step-tickers
 
>>>>>>>>>>>>>>>>>>>>step-tickers
time.nrc.ca timelord.uregina.ca ntp1.mainecoon.com
<<<<<<<<<<<<<<<<<<<<step-tickers
 
To check that xntpd is working open 3 xterm windows, and run each command in separate windows:
tail -f /var/log/messages # watch xntpd system messages
tcpdump -i eth0 port 123  # to watch comms with servers on ext internet
tcpdump -i eth1 port 123  # to watch broadcasts on internal network
Now after editing the file ntp.conf, restart the xntpd daemon in a fourth
 
/etc/rc.d/init.d/xntpd restart
 
and watch the xterms

Setting up ntp Time Clients

Setting up Time clients is covered in the common configuration section.

Enabling Time and Daytime Services

Now that we have an "accurate" time source on our timeserver, we can open up the time and daytime services by uncommenting their lines in /etc/inet.conf, and then 'killall -HUP inetd'.
 
To check that this is working, 'telnet gateway daytime' and you should see the following:
Trying 24.113.94.87...
Connected to novatek.co.nz.
Escape character is '^]'.
Sat Aug  7 14:38:33 1999
Connection closed by foreign host.
 

[Home] [Up] [Prev] [Next]

Last modified: Tue Feb 8 22:00:00 PST 2000
Copyright © Jonathan Marks, 1999, 2000. All rights reserved.
http://jon.novatek.co.nz/linux/config/gateway-time.html.