I am trying to install an external clock to synchronize my network. I am
using a Spectracom GPS Netclock.
To /etc/ntp.conf I have added the line:
server 127.127.4.1 minpoll 3 maxpoll 4
I have also created a symbolic link:
/dev/wwvb1 -> /dev/ttyd2b8
These can not be the only two steps. I have to be missing something.
I tried to use xntpdc to addrefclock 127.127.4.1 3 4. It then asked for a
keyid. What is this? The only explanation for keyid is that it is a keyid.
Great. Where do I get this? Do I assign it? Do I need to configure it
into the Netclock?
Re: Configuring NTP
"Dave Anderson" <firstname.lastname@example.org> writes:
> I am trying to install an external clock to synchronize my network. I am
> using a Spectracom GPS Netclock.
> To /etc/ntp.conf I have added the line:
> server 127.127.4.1 minpoll 3 maxpoll 4
> I have also created a symbolic link:
> /dev/wwvb1 -> /dev/ttyd2b8[/color]
> These can not be the only two steps. I have to be missing something.[/color]
Well, according to ntpd documentation your ntpd settings are mainly
done. Things that might need to be done are related to the serial port
communication and the clock's DIP switch settings.
You should set the serial port to 9600 bps, 8 data bits and no parity.
That can be accomplished using the "stty" command.
stty -a < /dev/ttyd2b8 (or /dev/wwvb1)
will report the current settings of the port, and
stty 9600 cs8 -istrip -parenb < /dev/ttyd2b8
should set the serial port communication parameters to the correct
values, if I'm not mistaken. (Yes, the "<" sign seems nonsensical
here. Short explanation: it's a small piece of UNIX history,
live with it. In a certain angle, it does make some sense.)
If you need to change the stty settings for the serial port, you might
want to write a small script to be included among the boot scripts of
The clock's DIP switches should be set to 24-hour display, AUTO DST
off, and data format can be either 0 or 2. The clock driver in xntpd
can figure out which format is being used. To me, it looks that format
2 provides a bit more information about the clock's state, so it might
be preferable to format 0.
When you get the basic setup working, there is two more things you can
add to your ntp.conf file, if you feel the need:
fudge 127.127.4.1 time1 <calibration_constant>
fudge 127.127.4.1 flag4 <verbose_clockstats>
Here <calibration_constant> is a number of seconds to add to the
received value to compensate for the delays in the serial cable and
the server's serial port hardware. The default value is 0.0.
Obviously, you would need a way to compare your server's time to a
known-good time to find the correct value here. If you can live with
the fact that your computer might be <a constant number of
milliseconds> late from The True And Absolute Universal Time(tm), the
easiest way is not to bother with it.
<verbose_clockstats> is either 1 or 0, depending on whether you want
the xntpd to get a table of time quality data from the clock once
every day or not. The data would be written into the "clockstats"
file(s) if you choose to use it.
> I tried to use xntpdc to addrefclock 127.127.4.1 3 4. It then asked for a
> keyid. What is this? The only explanation for keyid is that it is a keyid.
> Great. Where do I get this? Do I assign it? Do I need to configure it
> into the Netclock?[/color]
The "keyid" is not related to the Netclock at all. It's related to the
authentication mechanism between xntpd and xntpdc. It's there to
prevent anyone and his/her dog on your network from fiddling with your
The access control system of xntpd is a bit rudimentary and uses
(IMHO) slightly confusing terminology.
To put it in more familiar terms, the "keyid" is more like an
username, except that it is a number in the range 1 to 65534
The "key" is essentially the password assigned to the keyid.
If I recall correctly, if you don't have any keys set up, xntpdc can
work only in "view-only" mode, which means you can see the statistics
collected by xntpd but all configuration changes must be made by
editing the ntp.conf file and re-starting xntpd.
To control xntpd remotely (or even locally) using xntpdc, you must:
- pick a password (whatever you like) and place it into a
A keyfile can contain several passwords; the keyid will be a number
assigned to the password in the keyfile.
The keyfile consists of lines of the form
(M means MD5 hash of the password will be used over the network)
- define where the keyfile is located (in ntp.conf, using "keyfile"
- define which key in the keyfile is required for changing settings
(in ntp.conf, using "requestkey" command)
After this, you can use the xntpdc command to control xntpd. When
making changes, xntpd will ask the keyid ("userid") and password
unless you explicitly give them beforehand using the "keyid" and
If you don't need to configure xntpd while it's running, you can
choose not to bother with the keys.
The xntpd (now known as ntpd) documentation is available at
Unfortunately, it seems to be the kind of documentation that you must
first read all through once, or you won't know where to look for the
things you end up needing to know.