Xntp
Contents
XNTP is a timeserver that makes it possible to synchronize your local computer-time with
an external time-server. Additionally, you can run your own time-server and let other
hosts contact you to synchronize your LAN-time.
First of all, what is NTP?
I quote http://www.eecis.udel.edu/~ntp/ntp_spool/html/index.htm
The Network Time Protocol (NTP) is used to synchronize the time of a computer client or server
to another server or reference time source, such as a radio or satellite receiver or modem.
It provides accuracies typically within a millisecond on LANs and up to a few tens of milliseconds
on WANs relative to Coordinated Universal Time (UTC) via a Global Positioning Service (GPS) receiver,
for example. Typical NTP configurations utilize multiple redundant servers and diverse network
paths in order to achieve high accuracy and reliability. Some configurations include cryptographic
authentication to prevent accidental or malicious protocol attacks and some provide automatic server
discovery using IP multicast.
The Network Time Protocol (NTP) Distribution
http://www.eecis.udel.edu/~ntp/ntp_spool/html/index.htm
Configuration of NTP
http://www.eecis.udel.edu/~ntp/ntpfaq/NTP-s-config.htm
I've searched for the latest package on
http://rpmfind.net. There you can search for the latest RPM for your distribution.
When you're using Red-Hat installation is easy.
rpm -Uvh xntp.rpm
I'm only going to cover a 'basic' installation. More information is provided on the
NTP-configuration webpage.
NTP uses one config file /etc/ntp.conf in which all settings are contained.
Open your favorite editor and edit this file so that it looks somewhat like this :
extract of /etc/ntp.conf
server ntp.myexternalserver.com
restrict default notrust lowpriotrap nopeer nomodify
restrict 123.122.12.1 mask 255.255.255.0 nopeer nomodify
restrict 192.168.1.0 mask 255.255.255.0 # local hosts
restrict 127.0.0.1 mask 255.255.255.255 # local config
That's all there is for a simple, working configuration.
In this config file, I connect for the update to ntp.myexternalserver.com.
The restrict settings make sure that I only get an update from my default server
(ntp.myexternalserver.com has ip 123.122.12.1) and that only hosts on my LAN can contact
my timeserver.
You can stop the xntp-daemon with the initialisation-scripts located in your inetd.d directory.
Just use xntp start to start the daemon and xntp stop to start the daemon.
One special remark. When I first started the daemon, even when all my regional settings were correct,
it gave me the following error-message :
time error 2069.757571 is way too large (set clock manually)
To resolve this, you need to edit the initialisation script and change the line where the
daemon gets started.
extract of /etc/inet.d/xntp
case "$1" in
start)
# Adjust time to make life easy for xntpd
if [ -f /etc/ntp/step-tickers ]; then
echo -n "Syncing time for xntpd. "
/usr/sbin/ntpdate -s -b -p 8 -u `cat /etc/ntp/step-tickers`
fi
# Start daemons.
echo -n "Starting xntpd: "
daemon xntpd -A -g
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/xntpd
I have added the -g option to start the daemon. This way, the daemon starts and will synchronize
the clock, no matter what time it receives from the external server. Even when the difference
between external time and local time is to big (offset to high) the update will take place.
This can only happen once. When a second instance occurs, the daemon will exit with an error-code.
Windows
You can't use your GNU/Linux-timeserver to configure the time-settings on a Windows-machine.
Allthough there are some free tools available that do the trick, I advice you to use
the SMB-time protocol with Samba. More information can be found on another page on my site :
Tweaky Weaky : Using Samba as a timeserver
GNU/Linux
Easy...just install ntp of xntp and add one line to the configuration file :
server ntp.mytimeserver.com
In this case, mytimeserver.com is the local timeserver on your LAN.
|