Recetas/ntp

De FESOL. Proyectos de Software Libre ULS
Saltar a: navegación, buscar

Resumen de la receta

El propósito de esta receta es configurar un servidor de hora en un red de computadoras. Un servidor NTP es para que los clientes puedan tener una hora de referencia con la cual actualizarse en caso de que esten desfasada la hora.

En esta guia se configurará un servidor NTP y un cliente que sincronice su hora desde el servidor.


Diagrama-ntp.png

Requisitos


Instalación de programas

La instalación de los programas se hace tanto en el cliente como en el servidor.

apt-get install ntp ntpupdate

Configuración

Servidor NTP

La configuración será:

root@servidor-ntp:/home/uls# cat /etc/ntp.conf 
driftfile /var/lib/ntp/ntp.drift
statsdir /var/log/ntpstats/
statistics loopstats peerstats clockstats
filegen loopstats file loopstats type day enable
filegen peerstats file peerstats type day enable
filegen clockstats file clockstats type day enable
pool 0.debian.pool.ntp.org iburst
pool 1.debian.pool.ntp.org iburst
pool 2.debian.pool.ntp.org iburst
pool 3.debian.pool.ntp.org iburst
restrict -4 default kod notrap nomodify nopeer noquery limited
restrict -6 default kod notrap nomodify nopeer noquery limited
restrict 127.0.0.1
restrict ::1
restrict 192.168.0.0 mask 255.255.255.0 nomodify
restrict source notrap nomodify noquery
broadcast 192.168.0.255
disable auth

Reiniciamos el servidor NTP

/etc/init.d/ntp restart


Cliente NTP

La configuración será:

root@servidor-ntp:/home/uls# cat /etc/ntp.conf 
statistics loopstats peerstats clockstats
filegen loopstats file loopstats type day enable
filegen peerstats file peerstats type day enable
filegen clockstats file clockstats type day enable
server 192.168.0.100 
restrict -4 default kod notrap nomodify nopeer noquery limited
restrict -6 default kod notrap nomodify nopeer noquery limited
restrict 127.0.0.1
restrict ::1
restrict source notrap nomodify noquery

Reiniciamos el servidor NTP

/etc/init.d/ntp restart

Prueba

Referencias