NTP (Network Time Protocol) is a networking protocol for clock synchronization between computer systems. Read the WikiPedia page for a full run down on it: http://en.wikipedia.org/wiki/Network_Time_Protocol
It’s very important to keep clocks synchronized on servers and also important to keep workstations in check. To configure NTP on Linux and Windows based servers follow these steps.
Linux:
Ubuntu/Debian:
Install and configure on a Ubuntu or Debian based server.
sudo apt-get install ntp
Edit /etc/ntp.conf
sudo vim /etc/ntp.conf
By default these servers are configured:
server 0.ubuntu.pool.ntp.org
server 1.ubuntu.pool.ntp.org
server 2.ubuntu.pool.ntp.org
server 3.ubuntu.pool.ntp.org
Let’s change these to our local NTP servers from the NTP Pool Project for the Oceania area as we are in Australia:
server 0.oceania.pool.ntp.org
server 1.oceania.pool.ntp.org
server 2.oceania.pool.ntp.org
server 3.oceania.pool.ntp.org
Now reload the NTPD service with:
sudo service ntp restart
Now use the ntpq view status command to see that your server is using the NTP servers in your area:
sudo ntpq -p remote refid st t when poll reach delay offset jitter ============================================================================== warrane.connect 130.95.179.80 2 u 9 64 1 27.561 -137.11 0.008 resolver02.as24 130.234.255.83 2 u 8 64 1 16.657 -134.96 0.008 ns1.syrahost.co 218.100.43.70 2 u 7 64 1 64.652 -131.77 0.008 ns2.deakin.edu. 169.254.0.1 4 u 6 64 1 43.090 -136.24 0.008 europium.canoni 193.79.237.14 2 u 5 64 1 312.695 -142.51 0.008
Configuration for Ubuntu Desktop – Refer to this post:
https://help.ubuntu.com/community/UbuntuTime
CentOS/Redhat/Fedora:
yum install ntp
Turn the service on for reboots.
chkconfig ntpd on
Edit /etc/ntp.conf
vim /etc/ntp.conf
Like Ubuntu CentOS has these ntp servers set.
server 0.centos.pool.ntp.org
server 1.centos.pool.ntp.org
server 2.centos.pool.ntp.org
Again, let’s change these to our local NTP servers from the NTP Pool Project for the Oceania area as we are in Australia:
server 0.oceania.pool.ntp.org
server 1.oceania.pool.ntp.org
server 2.oceania.pool.ntp.org
server 3.oceania.pool.ntp.org
Now reload the NTPD service with:
service ntpd restart
Windows Server 2008(R2):
With Windows Server 2008 and onwards a tool called W32tm.exe is used, older servers had the net time tool. For more details and a full command syntax reference see this Technet page: http://technet.microsoft.com/en-us/library/cc773263(WS.10).aspx
Run a query status command to see what the current server’s time configuration is set to:
w32tm.exe /query /status Leap Indicator: 0(no warning) Stratum: 3 (secondary reference - syncd by (S)NTP) Precision: -6 (15.625ms per tick) Root Delay: 0.0940224s Root Dispersion: 0.0829412s ReferenceId: 0xCBAA5703 (source IP: 203.170.87.3) Last Successful Sync Time: 12/10/2012 18:12:26 Source: au.pool.ntp.org Poll Interval: 10 (1024s)
To set an external time source use the /config syntax and like the Linux time sources we will use a few Oceania servers.
0.oceania.pool.ntp.org
1.oceania.pool.ntp.org
w32tm /config /syncfromflags:manual /manualpeerlist:0.oceania.pool.ntp.org,1.oceania.pool.ntp.org
Stop and start the Windows Time service:
C:Windowssystem32>net stop w32time The Windows Time service is stopping. The Windows Time service was stopped successfully. C:Windowssystem32>net start w32time The Windows Time service is starting. The Windows Time service was started successfully. Check the current status w32tm.exe /query /status Leap Indicator: 0(no warning) Stratum: 2 (secondary reference - syncd by (S)NTP) Precision: -6 (15.625ms per tick) Root Delay: 0.0623753s Root Dispersion: 7.7761198s ReferenceId: 0xCA15890A (source IP: 202.21.137.10) Last Successful Sync Time: 12/10/2012 18:34:38 Source: 0.oceania.pool.ntp.org,1.oceania.pool.ntp.org Poll Interval: 6 (64s)
That’s it!!