Serveur NTP

Serveur NTP - réseaux et sécurité - Linux et OS Alternatifs

Marsh Posté le 15-01-2010 à 17:08:58    

Bonjour,

 

j'ai trois PC relié comme ceci
http://nsa10.casimages.com/img/2010/01/15/100115050704317765.jpg

 

Chacun des PC étant en mode routeur et donc avec plusieurs port ethernet. (sur chacun des PC il y a quelque chose de brancher sur les ports en adresse 192.10.10.1 (pour celui de gauche), 192.10.20.1 (pour celui du milieu) et en 192.10.0.1 pour celui de droite).

 

J'aimerais mettre du NTP sur les serveurs afin que les deux PC des extremités se synchronise avec le PC centrale. Mais avec mes fichiers de conf actuel cela ne marche pas.

 

Es ce que quelqu'un sais pourquoi??

 

fichier de conf d'un client :
/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
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

 

restrict 192.10.11.0 mask 255.255.255.0 nomodify notrap

 

# Hosts on local network are less restricted.
#restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap

 

# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.ntp.org/join.html).
server 192.10.20.1

 

#broadcast 192.168.1.255 autokey # broadcast server
#broadcastclient   # broadcast client
#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

 

# 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 # local clock
#fudge 127.127.1.0 stratum 10

 

# 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

 

# Specify the key identifiers which are trusted.
#trustedkey 4 8 42

 

# Specify the key identifier to use with the ntpdc utility.
#requestkey 8

 

# Specify the key identifier to use with the ntpq utility.
#controlkey 8

 

# Enable writing of statistics records.
#statistics clockstats cryptostats loopstats peerstats

  


/etc/ntp/ntpservers

 


#This file contains a list of ntp servers to show in the system-config-date user interface.
#It is not recommended that you modify this file by hand.

 

192.10.20.1
clock.redhat.com
clock2.redhat.com

 


fichier de conf du server:

 

/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
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 10.10.0.21
restrict 10.10.10.21
restrict 192.10.0.1
restrict 192.10.10.1
restrict -6 ::1

 

# Hosts on local network are less restricted.
#restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap

 

# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.ntp.org/join.html).
server 0.fedora.pool.ntp.org
server 1.fedora.pool.ntp.org
server 2.fedora.pool.ntp.org

 

#broadcast 192.168.1.255 autokey # broadcast server
#broadcastclient   # broadcast client
#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

 

# 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 # local clock
#fudge 127.127.1.0 stratum 10

 

# 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

 

# Specify the key identifiers which are trusted.
#trustedkey 4 8 42

 

# Specify the key identifier to use with the ntpdc utility.
#requestkey 8

 

# Specify the key identifier to use with the ntpq utility.
#controlkey 8

 

# Enable writing of statistics records.
#statistics clockstats cryptostats loopstats peerstats

  


/etc/ntp/servers
#This file contains a list of ntp servers to show in the system-config-date user interface.
#It is not recommended that you modify this file by hand.

 

clock.redhat.com
clock2.redhat.com

 


Merci par avance!!


Message édité par o'gure le 15-01-2010 à 18:26:35
Reply

Marsh Posté le 15-01-2010 à 17:08:58   

Reply

Marsh Posté le 18-01-2010 à 08:57:30    

Mon probleme a un petit peu changer. Je vois bien passer les trames NTP sur le réseaux pour la mise a jour. Le client envoie son heure. Le service acquite et lui donne sa nouvelle heure mais le client ne met pas a jour son horloge. Es ce que vous sauriez pourquoi??

Reply

Marsh Posté le 18-01-2010 à 10:47:58    

je viens de faire des traces NTP :
 
http://nsa11.casimages.com/img/2010/01/18/100118125839745913.png
 
http://nsa11.casimages.com/img/2010/01/18/100118125905336588.png

Reply

Marsh Posté le 18-01-2010 à 11:03:18    

As tu regardé dans les logs de /var/log pour détecter d'éventuelles erreurs avec des messages explicites ?


---------------
Relax. Take a deep breath !
Reply

Marsh Posté le 18-01-2010 à 11:06:17    

je n'ai aucun fichier de log concernant ntp :/

Reply

Marsh Posté le 18-01-2010 à 11:09:28    

kloklo55 a écrit :

je n'ai aucun fichier de log concernant ntp :/


Tu n'as pas forcément un fichier de log par service, fais usage de la curiosité :-)
Jette un coup d'oeil à ceux qui ne sont pas dédié à un services :
- messages.log
- syslog.log
- dmesg
- errors
...
ou en bourrin : grep -R ntp /var/log/*


---------------
Relax. Take a deep breath !
Reply

Marsh Posté le 18-01-2010 à 11:23:00    

appriori il n'y a pas d'erreur loggué ni sur le serveur ni sur les clients

Reply

Marsh Posté le 19-01-2010 à 21:33:56    

Bonsoir,
 
D'après ce qu'on peut glaner ontheweb , il faut peut-être que tu gères le "stratum" entre ton serveur et tes clients .
 
en gros d'après ce que je crois avoir compris  :ange:
le stratum 1 est pour la référence mondiale , le 2 pour ceux qui se synchronisent etc ...
 
donc à priori un client doit avoir un stratum > à son serveur ntp
 
C'est peut-être une piste à suivre .
 
A+:jlp

Reply

Marsh Posté le 20-01-2010 à 11:31:26    

A titre personnel, j'ai déjà constaté que lorsque l'offset entre le serveur et le client était trop important, le client ne se mettait pas à jour...
 
Que donne un :
ntpdate -q @ip_serveur  
 
 ;)

Reply

Marsh Posté le 20-01-2010 à 20:09:47    

nemo13 > c'est automatique
En règle générale tu ne synchronisera que très rarement sur un stratum 2, la plupart du temps sur stratum 3
Ton serveur NTP sera donc de stratum 3 ou 4
et tes clients obtiendrons automatiquement un stratum 4 ou 5
 
trailx > +1
essaie un ntpdate (paquet homonyme) avant pour forcer la mise à l'heure d'un coup (oui parce que le service NTP décale l'horloge que petit peu à petit peu)

Reply

Sujets relatifs:

Leave a Replay

Make sure you enter the(*)required information where indicate.HTML code is not allowed