El servidor de tiempo, funciona usando el servicio NTP (Network Time Protocol) y escucha en el puerto 123 udp y la utilidad del mismo no es otra que mantener una misma hora para todos los ordenadores de una RED lo más exacta posible.

1- Primeramente instalar el paquete: ntp (aptitude install ntp ó apt-get install ntp en caso de Debian)

Este seria el fichero de configuración /etc/ntp.conf

#####################Comienza aquí###############################
# /etc/ntp.conf, configuration for ntpd
driftfile /var/lib/ntp/ntp.drift
statsdir /var/log/ntpstats/
logfile /var/log/ntpd.log
broadcastdelay 0.008
logconfig = syncstatus + sysevents
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
# You do need to talk to an NTP server or two (or three).
#server ntp.your-provider.example
server 127.127.1.0
fudge 127.127.1.0 stratum 15
# pool.ntp.org maps to more than 300 low-stratum NTP servers.
# Your server will pick a different set every time it starts up.
# *** Please consider joining the pool! ***
# *** <http://www.pool.ntp.org/join.html> ***
#server 0.debian.pool.ntp.org iburst
#server 1.debian.pool.ntp.org iburst
#server 2.debian.pool.ntp.org iburst
#server 3.debian.pool.ntp.org iburst

# Server que te va a servir de referencia para actualizar el tuyo
server time.pri.jovenclub.cu iburst

# By default, exchange time with everybody, but don't allow configuration.
# See /usr/share/doc/ntp-doc/html/accopt.html for details.
restrict -4 default kod notrap nomodify nopeer noquery
restrict -6 default kod notrap nomodify nopeer noquery
# Local users may interrogate the ntp server more closely.
restrict 127.0.0.1
restrict ::1
# Clients from this (example!) subnet have unlimited access,
# but only if cryptographically authenticated
#restrict 192.168.123.0 mask 255.255.255.0 notrust
restrict default noquery nomodify notrap
restrict 127.0.0.1
# Cambiar los datos de la red, en cuanto a las mascara y la subnet
restrict 192.168.0.0 mask 255.255.255.0 nomodify notrap
# If you want to provide time to your local subnet, change the next line.
# (Again, the address is an example only.)
#broadcast 192.168.123.255
# If you want to listen to time broadcasts on your local subnet,
# de-comment the next lines. Please do this only if you trust everybody
# on the network!
#disable auth
#broadcastclient
#####################Termina aquí#################################

Ojo! En este fichero solo es necesario modificar la línea: restrict 192.168.0.0 mask 255.255.255.0 nomodify notrap Una vez hecho esto, verificar que la zona horaria esta bien configurada /etc/timezone

#
America/Havana

Si esto está bien, solo queda reiniciar el servicio ntp:

ns:/etc/squid/reglas# invoke-rc.d ntp restart
Stopping NTP server: ntpd.
Starting NTP server: ntpd.

Y en el fichero /var/log/ntpd.log debes obtener algo parecido a esto:

ntpd[7737]: synchronized to server.al.cual.sincronizaste, stratum 11

Para saber si funciona bien, pueden alterarle la hora al servidor con el comando:

date –s 02:30:00

Ese comando le pondría las 2:30 de la madrugada al servidor y al reiniciar NTP nuevamente, si todo funciona el servidor debería sincronizarse nuevamente y poner la hora real.

Saludos.

--

Raydel Hernández Martínez.
Administrador de Red. Nodo TinoPRI.
Subdirección Tecnología y Desarrollo.
Dirección Provincial de Joven Club.
Teléfonos: 048-752311 ext. 115.
Dirección: Calle Martí. Esq. Cuarteles # 124, Pinar del Río. Cuba.


E-mail:ray...@pri.jovenclub.cu <mailto:ray...@pri.jovenclub.cu>
Jabber: ray...@jabber.pri.jovenclub.cu <mailto:ray...@jabber.pri.jovenclub.cu>
Linux_User: # 466430






______________________________________________________________________
Lista de correos del Grupo de Usuarios de Tecnologías Libres de Cuba.
Gutl-l@jovenclub.cu
https://listas.jovenclub.cu/cgi-bin/mailman/listinfo/gutl-l

Responder a