Within this post you will find out briefly about NTP server installation, work process, configuration and testing on different operating systems. Improve your networking skill by knowing about NTP server.
NTP Server Introduction
Briefly to describe, NTP server (Network Time Protocol Server) is a facility that owned by the Debian server to synchronize time in a network, so that every computer connected to the network will automatically receive the same time update with the Debian server. The essence of the NTP server is to equate time from any computer that is connected to the network with a server computer in the network.
How NTP Server Works
In brief, NTP works by using Marzullo algorithm with UTC time scale reference. An NTP network usually gets the timing process from trusted source such as a radio clock or atomic clock that is connected to a time server, and then the NTP network it will distribute the accurate time calculation into other network.
An NTP client will synchronize with an NTP server in a polling interval that typically ranges from 64 to 1024 seconds. However, this synchronization time is regularly changes dramatically depending on the condition and situation of the network that will be used.
NTP uses a hierarchical system to work and perform synchronization. This hierarchical system uses the term Clock stratum or strata to describe level tiers. In where the first level of clock strata is a computer device that is synchronized with an external timer, such as a GPS clock, atomic clock or radio clock that is very accurate. Furthermore, a device with stratum 2 status is a device that sent time calculation by the stratum 1 directly using NTP protocol, henceforth a hierarchical system run.
The second parameter, NTP will do the comparison against some time calculation from multiple servers. In addition, an NTP device that has a most different recording time to the others most definitely be avoided by other devices, although the stratum value is lower than other machines.
NTP Server Installation on Debian 6 Squeeze
NTP server installation process is quite easy by simply inserting the DVD 1 of Debian Squeeze into the CD ROM, then type:
# apt-get install ntp ntpdate
NTP Server Configuration on Debian 6 Squeeze
After installing the NTP on 6 Debian Squeeze, then edit the configuration file.
# Nano /etc/ntp.conf
Press ctrl + w, then type the keyword: iburst.
After that, on server 0.debian.ntp.org iburst dynamic, change/edit to server id.pool.ntp.org iburst dynamic. Then give # before server 1 server, server2, Server3. For example:
#server 1.debian.pool.ntp.org iburst dynamic
#server 2.debian.pool.ntp.org iburst dynamic
Then press the ctrl + w and search for keyword: 123.0.
You will find restrict 192.168.123.0 mask 255.255.255 notrust. Add a formula below the line: restrict a.b.c.d mask e.f.g.h nomodify notrap. In which a.b.c.d. is your network IP (e.g.: 192.168.7.0)a nd e.f.g.h. is the broadcast address of your network. Its aims to allow any IP or network that are allowed to access the NTP server.
To make it simple, simply just add restrict 0.0.0.0 mask 0.0.0.0 nomodify notrap to allow all IPs.
Then save and close the file.
Now firstly you need to stop the NTP service:
# /etc/init.d/ntp stop
Synchronize you computer to the host server, by typing a command :
# ntpdate id.pool.ntp.org
Rerun the NTP service:
# /etc/init.d/ntp start
After that, you need to rerun NTP service.Image: Rerun NTP Service
Testing NTP Server on Linux, Windows and Ubuntu Operating Systems
Testing NTP Server on Linux via Local Server
Check whether the local NTP server is working properly or not. If in the “jitter” has no value (0.000), means that it is correct, and if not, check the ntp.conf. file.
To make sure, test the server you have with ntpdate command. Take into note that if in this section there is a message “no server suitable for synchronization found”, then wait about 5-10 minutes.
Testing NTP Server on Windows
Firstly, for Windows clients, just click on the clock symbol in the panel, and set the time with the internet time. Fill in you Ip server, e.g. 192.168.7.1, no longer need to fill id.pool.ntp.org, because the time of the parent server has synchronized to the local server in your network.
Click your Windows Start button > Control Panel > Date, Time, language > Date & Time > Internet Time
Testing on Ubuntu
For Ubuntu clients, just type on the command terminal:
$ sudo ntpdate 192.168.7.1