Você está na página 1de 4

Cliente -Servidor NTP

Cliente Para cambiar la zona horaria en sistemas operativos basados en Centos es necesario validar que se encuentra instalado el paquete que nos permitir establecer la zona horaria en la que nos encontramos, con el comando: yum list tzadata.noarch Y luego proceda a configurar la zona horaria con el comando: tzselect Responde al asistente escogiendo tu zona horaria por ejemplo: Amrica (2), luego Ecuador(20) , Mainland(1) y Yes(1) Confirmamos los datos. Therefore TZ='America/Guayaquil' will be used. Local time is now: Wed Jul 3 21:10:19 ECT 2013.

Universal Time is now: Thu Jul 4 02:10:19 UTC 2013.

Ahora bien, para crear un servidor NTP como un cliente de otro servidor NTP para que la hora se actualice automticamente de forma peridica el procedimiento es el siguiente:

Instalar el programa ntpdate yum install ntp* Agregas una tarea programada para que actualice la hora cada 4 horas: crontab -e Dentro de la edicin del crontab agregas la siguiente lnea: 0 */4 * * * /usr/sbin/ntpdate -u 2.pool.ntp.org Probamos que se grabe correctamente. crontab -l

Iniciamos el servicio
chkconfig ntpd on

(write the sync time to CMOS) vi /etc/sysconfig/ntpd SYNC_HWCLOCK=yes Ahora editamos y configuramos el archivo vi /etc/ntp.conf # 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 # 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 # Hosts on local network are less restricted. restrict 192.168.1.0 mask 255.255.255.0 nomodify no trap # Use public servers from the pool.ntp.org project. Ingresamos el servidor dns que creamos. server www.srvuceuio.com # Undisciplined Local Clock. This is a fake driver intended for backup and when no outside source of synchronized time is available. server 127.127.1.0 fudge # local clock

127.127.1.0 stratum 10

# Enable public key cryptography. includefile /etc/ntp/crypto/pw # Key file containing the keys and key identifiers used when operating with symmetric key cryptography. keys /etc/ntp/keys #Asigno como servidor a la ip de mi host server 192.168.1.3 iburst

Iniciar el servicio con: service ntpd start

Agregar el servicio para que se inicie de forma automtica con el sistema: chkconfig ntpd on Activamos el puerto 123 en TCP desde el cortafuegos.

Servidor
Realizamos los mismos pasos que en el cliente hasta llegar a modificar archivo de configuracin vi /etc/ntp.conf

E ingresamos las siguientes lineas.


# 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 # 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 # Hosts on local network are less restricted. restrict 192.168.1.0 mask 255.255.255.0 nomodify no trap # Use public servers from the pool.ntp.org project. Ingresamos el servidor dns que creamos. server 0.centos.pool.ntp.org server 1.centos.pool.ntp.org server 2.centos.pool.ntp.org server inocar.ntp.ec server ntp.ec # Undisciplined Local Clock. This is a fake driver intended for backup and when no outside source of synchronized time is available. server 127.127.1.0 fudge # local clock

127.127.1.0 stratum 10

# Enable public key cryptography. includefile /etc/ntp/crypto/pw # Key file containing the keys and key identifiers used when operating with symmetric key cryptography. keys /etc/ntp/keys #Asigno como servidor a la ip de mi host

server 192.168.1.13 iburst

Ahora vamos a realizar pruebas de funcionamiento. date jue jul 4 14:45:23 ECT 2013 y actualizamos nuestro host, buscamos a nuestro servidor

ntpdate -u www.srvuceuio.com 4 Jul 11:46:22 ntpdate[3703]: step time server 192.168.1.13 offset -10793.343840 sec Verificamos la actualizacion date jue jul 4 11:47:03 ECT 2013 Observamos nuestras tabla de servidores de tiempo. watch ntpq -p -n

Biografia: http://www.cyberciti.biz/faq/rhel-fedora-centos-configure-ntp-client-server/ http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch24_:_The_NTP_Server #.Uc5hgW40Xqg http://199.34.120.32:8090/display/DOC/Setup+NTP+Server+on+CentOS http://www.broexperts.com/part-2-ntp-server-client-settings-3/ http://www.alcancelibre.org/staticpages/index.php/como-ntp http://www.alcancelibre.org/staticpages/index.php/como-ntp http://inocar.ntp.ec/sincronizacion.html http://riveromjesus.blogspot.com/2010/02/configurar-servidor-y-cliente-ntp-en_23.html

Você também pode gostar