Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Beide Seiten der vorigen Revision Vorhergehende Überarbeitung Nächste Überarbeitung | Vorhergehende Überarbeitung | ||
centos:ntp-zeitserver [28.11.2008 10:15. ] – DHCP-Ergänzungen für NTP nachgetragen michi | centos:ntp-zeitserver [20.04.2018 10:31. ] (aktuell) – Externe Bearbeitung 127.0.0.1 | ||
---|---|---|---|
Zeile 1: | Zeile 1: | ||
+ | ====== lokalen Zeitserver einrichten ====== | ||
+ | Mittels NTP((Network Time Protocol)) Nutzen wir einen Standard zur Synchronisierung aller Uhren in unserem SOHO((SmallOfficeHomeOffice))-LAN. | ||
+ | NTP wurde als RFC 958 definiert um eine zuverlässige Zeitgabe über Netzwerke mit variabler Paketlaufzeit zu ermöglichen und bekam von der Internet Assigned Numbers Authority den UDP-Ports 123 zugewiesen. | ||
+ | ===== Installation ===== | ||
+ | Falls nicht schon bei der Erstinstallation geschehen, installieren wir erst ein mal das benötige RPM für unseren Zeitserver. | ||
+ | < | ||
+ | ===== Konfiguration ===== | ||
+ | ==== NTP ==== | ||
+ | Die Konfiguration unseres Zeitservers erfolgt über die Datei **/ | ||
+ | < | ||
+ | # 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. | ||
+ | # be tightened as well, but to do so would effect some of | ||
+ | # the administrative functions. | ||
+ | restrict 127.0.0.1 | ||
+ | restrict -6 ::1 | ||
+ | |||
+ | # Hosts on local network are less restricted. | ||
+ | restrict 192.168.100.0 mask 255.255.255.0 nomodify notrap | ||
+ | |||
+ | # Use public servers from the pool.ntp.org project. | ||
+ | # Please consider joining the pool (http:// | ||
+ | server 0.centos.pool.ntp.org | ||
+ | server 1.centos.pool.ntp.org | ||
+ | server 2.centos.pool.ntp.org | ||
+ | |||
+ | #broadcast 192.168.1.255 key 42 # broadcast server | ||
+ | # | ||
+ | #broadcast 224.0.1.1 key 42 # multicast server | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | |||
+ | # Undisciplined Local Clock. This is a fake driver intended for backup | ||
+ | # and when no outside source of synchronized time is available. | ||
+ | server | ||
+ | fudge | ||
+ | |||
+ | # Drift file. Put this in a directory which the daemon can write to. | ||
+ | # No symbolic links allowed, either, since the daemon updates the file | ||
+ | # by creating a temporary in the same directory and then rename()' | ||
+ | # it to the file. | ||
+ | driftfile / | ||
+ | |||
+ | # Key file containing the keys and key identifiers used when operating | ||
+ | # with symmetric key cryptography. | ||
+ | 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 | ||
+ | restrict 0.centos.pool.ntp.org mask 255.255.255.255 nomodify notrap noquery | ||
+ | restrict 1.centos.pool.ntp.org mask 255.255.255.255 nomodify notrap noquery | ||
+ | restrict 2.centos.pool.ntp.org mask 255.255.255.255 nomodify notrap noquery | ||
+ | #Specify alternate log file | ||
+ | logfile / | ||
+ | </ | ||
+ | ==== DHCP ==== | ||
+ | Damit unsere Klienten auch von [[centos: | ||
+ | |||
+ | Wir editieren also unsere **/ | ||
+ | | ||
+ | |||
+ | | ||
+ | Abschließend restarten wir unseren DHCP-Server. | ||
+ | | ||
+ | |||
+ | ===== Serverstart ===== | ||
+ | Der erste Start unseres Zeitserver erfolgt dem gewohnten Syntaxschema: | ||
+ | < | ||
+ | Im syslog wird der erfolgreiche Start entsprechend quittiert: | ||
+ | < | ||
+ | Nov 7 21:00:40 nss ntpd[15627]: | ||
+ | Nov 7 21:00:40 nss ntpd[15627]: | ||
+ | Nov 7 21:00:40 nss ntpd[15627]: | ||
+ | Nov 7 21:00:40 nss ntpd[15627]: | ||
+ | Nov 7 21:00:40 nss ntpd[15627]: | ||
+ | Nov 7 21:00:40 nss ntpd[15627]: | ||
+ | Nov 7 21:00:40 nss ntpd[15627]: | ||
+ | Nov 7 21:00:40 nss ntpd[15627]: | ||
+ | Nov 7 21:00:40 nss ntpd[15627]: | ||
+ | </ | ||
+ | Damit der Zeitserver **ntpd** automatisch bei jedem Systemstart startet, kann die Einrichtung eines Start-Scriptes über folgenden Befehl erreicht werden: | ||
+ | < | ||
+ | Ein Überprüfung ob der Dienst (Daemon) ntdp wirklich bei jedem Systemstart automatisch mit gestartet wird, kann durch folgenden Befehl erreicht werden: | ||
+ | < | ||
+ | ntpd 0:Aus | ||
+ | Wichtig ist jeweils der Schalter **on** bei den Runleveln - **3 4 5**. | ||
+ | |||
+ | ===== Serverstatus ===== | ||
+ | Mit dem Befehl **watch ntpq -np** können wir uns abschließend den Status unseres Timeservers anzeigen lassen (Die Synchronisation kann bis zu 30 Minuten dauern - diese Zeit muss ggf. gewartet werden) | ||
+ | < | ||
+ | zeigt uns an: | ||
+ | < | ||
+ | |||
+ | | ||
+ | ============================================================================== | ||
+ | +81.169.180.23 | ||
+ | +88.198.23.16 | ||
+ | *88.198.8.101 | ||
+ | |||
+ | An Hand des ** * ** am Zeilenanfang ist zu erkennen, dass Synchronisation erfolgt. Die Spalten haben folgende Bedeutung: | ||
+ | |||
+ | |||
+ | ^Spalte^Bedeutung^ | ||
+ | |remote|Mit welchen Servern ist mein Zeitserver verbunden? | ||
+ | |refid |Von welcher Zeitquelle stammt die Zeit? | | ||
+ | |st |stratum (Entfernung von der Zeitquelle in ) | | ||
+ | |t |type (u = unicast, m = multicast, l = local, - = don't know) | | ||
+ | |when |Wann wurde der Server zuletzt angefragt | ||
+ | |poll |Wie oft wird mit diesem Server syncronisiert? | ||
+ | |reach |Wie gut ist der Server erreichbar? 377 = optimal | ||
+ | |delay | | | ||
+ | |offset| | ||
+ | |jitter| Abweichung in Millisekunden | ||
+ | |||
+ | |||