NTP: Time Service in our network
Sep 21, 07 by Juan Lebrijo about blog, NTP
Network Time Protocol, is a protocol to synchronize the time clocks of every operating system over TCP(UDP)/IP. Here I am going to explain shortly how it is installed in a server and clients, over Debian Etch operating system. installation:
elite:~# apt-get install ntp ntpdate ntp-server ntp-simple
Leyendo lista de paquetes... Hecho
Creando árbol de dependencias... Hecho
Paquetes sugeridos:
  ntp-doc
Se instalarán los siguientes paquetes NUEVOS:
  ntp ntp-server ntp-simple ntpdate
0 actualizados, 4 se instalarán, 0 para eliminar y 3 no actualizados.
Necesito descargar 449kB de archivos.
Se utilizarán 1098kB de espacio de disco adicional después de desempaquetar.
Let modyfy following aspects in config file, /etc/ntp.conf:
  • Uncomment the line: logfile /var/log/ntpd. If we want to log the service.
  • Add root our root server. It is optional, the pool configured is totally operative:
server chronos.bulma.net
server es.pool.ntp.org
server ntp.obspm.fr
server ntp.cs.strath.ac.uk
server europe.pool.ntp.org
server pool.ntp.org
We can manage the NTP daemon with the script: /etc/init.d/ntp restart I want to warn you in follow three points, when you first getting up the service:
  • It takes log time to sinchronize (~30min in my server), during this time not runs.
  • If we want the service as server, it do not serve the time until its synchrnization.
  • Maybe we must open our firewall in 123 TCP/UDP port. Or making NAT in output server, it depends on our network configuration.
We can test it with the following tools:
  • ntpq –pn: Show what servers it synchronioze with.
  • ntptrace –n: Show which serves the time to our server, our server stratum etc.
  • tail -f /var/log/ntpd: NTP log.
Evaluating the service in a client, with Windows XP Service Pack 2, we could doit in "Time and date properties", her we can set our favorite server:
ntp.PNG 5.74 KB
If you want to study in depth about NTP, you can learn more in the links on the table: Origin http://www.ntp.org/ Repository http://www.ntp.org/downloads.html Package apt - 4.2.0a Documentation (Spanish) http://weblog.benetjoandarder.cat/descarregues/NTPv1.0.pdf http://bulma.net/body.phtml?nIdNoticia=1947 http://bulma.net/impresión.phtml?nIdNoticia=1778 Documentation (English) http://www.ntp.org/documentation.html Files Configuration: /etc/ntp.conf Daemon: /etc/init.d/ntp-server Log: /var/log/ntpd Port 123 TCP/UDP