Está en la página 1de 6

Servidor NTP y Cliente NTP

Bogotá, noviembre 18 de 2015.

El servicio de NTP server ya está configurado en el servidor 172.16.1.101


Aquí está el procedimiento para configurar un servidor NTP:

 Primero que todo, debe estar habilitado en los Firewalls de las sedes la conexión al servidor
172.16.1.101, por el puerto udp 123 para que se pueda sincronizar la hora en los demás servers.

Configuración del servidor NTP (172.16.1.101):


cd /etc
vim ntp.conf

Debemos tener estar líneas sin comentarear:

# Se establece la política predeterminada para cualquier


# servidor de tiempo utilizado: se permite la sincronización
# de tiempo con las fuentes, pero sin permitir a la fuente
# consultar (noquery), ni modificar el servicio en el
# sistema (nomodify) y declinando proveer mensajes de
# registro (notrap).
restrict default nomodify notrap noquery
restrict -6 default nomodify notrap noquery

# Permitir todo el acceso a la interfaz de retorno del


# sistema.
restrict 127.0.0.1
restrict -6 ::1

# Hosts on local network are less restricted.


#restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap
# Agregamos las redes que le vamos a permitir sincronizar la hora contra este servidor
restrict 172.16.1.0 mask 255.255.255.128 nomodify notrap
restrict 172.25.11.0 mask 255.255.255.128 nomodify notrap
restrict 172.16.8.0 mask 255.255.250.0 nomodify notrap

# Se debe activar la difusión hacia los clientes


#broadcast 192.168.1.255 autokey # broadcast server
#broadcastclient # broadcast client
broadcastclient
#broadcast 224.0.1.1 autokey # multicast server
#multicastclient 224.0.1.1 # multicast client
#manycastserver 239.255.254.254 # manycast server
#manycastclient 239.255.254.254 autokey # manycast client

El resto de la configuración se deja por defecto.

Configuración del servicio ntp cliente

Estando ubicados en el servidor verificamos si ya está o no instalado el servicio de ntp en el Linux, con
el siguiente comando:
rpm -qa ntp
Nos debe mostrar algo parecido.
ntp-4.2.6p5-5.el6.centos.x86_64

Si no está instalado el servicio, lo instalamos con el siguiente comando:


yum install ntp ntpdate
Arrancamos el servicio:
/etc/init.d/ntpd start o service ntpd start

Configuramos para que siempre arranque el servicio de ntp, cuando se reinicie el Linux.
Podemos hacerlo habilitándolo en el ntsysv o con el comando:
chkconfig ntpd on

Una vez tengamos el servicio de ntp arriba, antes de configurar el ntp client, verificamos que sincronice
la hora de nuestro servidor con el servidor ntp 172.16.1.101 con el siguiente comando:
ntpdate -u 172.16.1.101

Nos debe mostrar algo asi:


18 Nov 11:05:30 ntpdate[20701]: step time server 172.16.1.101 offset 39.418116 sec

Ya comprobada la conexión, configuramos el servicio de ntp cliente en el servidor en la siguiente ruta:


cd /etc
vim /etc/ntp.conf
Deben estar estas líneas en color rojo deben estar sin comentario, y si no estuvieran, debemos agregarlas.

# For more information about this file, see the man pages
# ntp.conf(5), ntp_acc(5), ntp_auth(5), ntp_clock(5), ntp_misc(5), ntp_mon(5).
driftfile /var/lib/ntp/drift

# Permit time synchronization with our time source, but do not


# permit the source to query or modify the service on this system.
restrict default kod nomodify notrap nopeer noquery
restrict -6 default kod nomodify notrap nopeer noquery

# Permit all access over the loopback interface. This could


# be tightened as well, but to do so would effect some of
# the administrative functions.
restrict 127.0.0.1
restrict -6 ::1

# Use public servers from the pool.ntp.org project.


# Please consider joining the pool (http://www.pool.ntp.org/join.html).
server 172.16.1.101 iburst

# Enable public key cryptography.


#crypto
includefile /etc/ntp/crypto/pw

# Key file containing the keys and key identifiers used when operating
# with symmetric key cryptography.
keys /etc/ntp/keys

Guardamos y reiniciamos el servicio de ntp


/etc/init.d/ntpd restart

Verificamos la hora en el server, con el comando date.

También podría gustarte