User Tools

Site Tools


informatica:linux:ntp

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
Last revisionBoth sides next revision
informatica:linux:ntp [2012/06/12 15:01] – creado javiinformatica:linux:ntp [2012/06/15 10:20] javi
Line 3: Line 3:
 ntp ntpq time ntp ntpq time
  
-===== Servidor ======+===== Paquetes ======
  
-1. Instalar paquetes:+Comunnes para cliente y servidor:
  
-  sudo aptitude install ntp ntpdate ntp-server+  sudo aptitude install ntp ntpdate 
 + 
 +===== Servidor ======
  
-2. Actualizar configuracion:+1. Actualizar configuracion:
  
   sudo mv /etc/ntp.conf /etc/ntp.conf.old   sudo mv /etc/ntp.conf /etc/ntp.conf.old
Line 16: Line 18:
  
 <code> <code>
-TBD+# /etc/ntp.conf, configuration for ntpd; see ntp.conf(5) for help 
 + 
 +driftfile /var/lib/ntp/ntp.drift 
 + 
 +# pool.ntp.org maps to about 1000 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.es.pool.ntp.org 
 +server 1.es.pool.ntp.org 
 +server 2.es.pool.ntp.org 
 + 
 +# By default, exchange time with everybody, but don't allow configuration. 
 +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 
 + 
 +# http://support.ntp.org/bin/view/Support/AccessRestrictions#Section_6.5.1.2. 
 +# In theory I should use IP addresses on 'restrict' 
 +restrict 0.es.pool.ntp.org mask 255.255.255.255 nomodify 
 +restrict 1.es.pool.ntp.org mask 255.255.255.255 nomodify 
 +restrict 2.es.pool.ntp.org mask 255.255.255.255 nomodify 
 + 
 +# LAN 
 +restrict 10.0.0.0 mask 255.255.255.0 nomodify notrap nopeer
 </code> </code>
  
-3. Para NTP:+2. Para NTP:
  
   sudo /etc/init.d/ntp stop   sudo /etc/init.d/ntp stop
  
-4. Sincronizar (en este ejemplo el servidor es 0.es.pool.ntp.org)+3. Sincronizar (en este ejemplo el servidor es 0.es.pool.ntp.org)
  
   ntpdate 0.es.pool.ntp.org   ntpdate 0.es.pool.ntp.org
  
-5. Arrancar NTP:+4. Arrancar NTP:
  
   sudo /etc/init.d/ntp start   sudo /etc/init.d/ntp start
Line 33: Line 61:
 ===== Cliente ====== ===== Cliente ======
  
-1. Instalar paquetes: +1. Actualizar configuracion:
- +
-  sudo aptitude install ntp ntp-simple ntpdate +
- +
-2. Actualizar configuracion:+
  
   sudo mv /etc/ntp.conf /etc/ntp.conf.old   sudo mv /etc/ntp.conf /etc/ntp.conf.old
Line 44: Line 68:
  
 <code> <code>
 +# /etc/ntp.conf, configuration for ntpd; see ntp.conf(5) for help
 +
 driftfile /var/lib/ntp/ntp.drift driftfile /var/lib/ntp/ntp.drift
 +
 server time-1.dev.jj.com server time-1.dev.jj.com
-restrict -4 default kod notrap nomodify nopeer noquery + 
-restrict -6 default kod notrap nomodify nopeer noquery+restrict -4 default ignore 
 +restrict -6 default ignore
 restrict 127.0.0.1 restrict 127.0.0.1
 restrict ::1 restrict ::1
 +restrict time-1.dev.jj.com
 </code> </code>
  
-3Para NTP:+Sincronizamos el cliente contra el servidor (time-1.dev.jj.com) y permitimos acceso local, todo lo demas lo cerramos. 
 + 
 +2. Parar NTP:
  
   sudo /etc/init.d/ntp stop   sudo /etc/init.d/ntp stop
  
-4. Sincronizar (en este ejemplo el servidor es time-1.dev.jj.com)+3. Sincronizar (en este ejemplo el servidor es time-1.dev.jj.com)
  
   ntpdate time-1.dev.jj.com   ntpdate time-1.dev.jj.com
  
-5. Arrancar NTP:+4. Arrancar NTP:
  
   sudo /etc/init.d/ntp start   sudo /etc/init.d/ntp start
- 
informatica/linux/ntp.txt · Last modified: 2015/04/13 20:19 by 127.0.0.1