PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : NTP im LAN



rem996
01.12.05, 13:28
Hallo

ich habe 2 Computer im LAN fest verbunden per Netzwerkkabel über einen Router. Ich möchte die Zeit der beiden PCs über NTP synchronisieren. Dazu verbindet sich ein computer im Netz und holt sich die Zeit von einem Stratum 2 Server, was auch gut funktioniert.

Der andere PC soll sich die Zeit aber nicht aus dem Netz sondern von PC Nummer 1 abholen der ja im gleichen LAN ist. Wenn ich den NTP Demon auf PC2 restarte kommt die Meldung

Shutting down network time protocol daemon (NTPD) done
Try to get initial date and time via NTP from 192.168.0.2 failed
Starting network time protocol daemon (NTPD) done

Wenn ich ntpq -p auf dem zweiten Computer eingebe zeigt er mir zwar PC 1 als Remote an, dennoch scheinen die Uhren nicht Syncrhon zu sein, da ich Unterschiede von mehreren hundert Millisekunden habe...

hab ich vergessen auf PC Nummer 1 etwas freizugeben, dass er sich die initial time nicht holen kann oder klappt die Synchronisation trotzdem?

Bin für jeden Tip dankbar :)

lg
rem996

ach ja ich verwende Suse 10

Mr_Maniac
01.12.05, 14:28
1. Einige hundert Millisekunden sind ja wohl nicht so kritisch, oder? ;)
2. Läuft auf dem PC, von dem die NTP-Zeit geholt werden soll überhaupt ein NTPD?
3. Muss dieser NTPD natürlich auch eingerichtet sein... Er braucht eine Liste von Servern, von denen ER sich die Zeit holt und dann muss man ihm natürlich noch sagen, welche PCs sich die Zeit bei ihm abholen dürfen...

Die ntp.conf von meinem NTP-Serverchen sieht z.B. so aus:


# NOTES:
# - you should only have to update the server line below
# - if you start getting lines like 'restrict' and 'fudge'
# and you didnt add them, AND you run dhcpcd on your
# network interfaces, be sure to add '-Y -N' to the
# dhcpcd_ethX variables in /etc/conf.d/net

# Name of the servers ntpd should sync with
# Please respect the access policy as stated by the responsible person.
#server ntp.example.tld iburst

server 0.de.pool.ntp.org prefer iburst
server ptbtime1.ptb.de iburst
server ptbtime2.ptb.de iburst
server 1.de.pool.ntp.org iburst
server 2.de.pool.ntp.org iburst
server de.pool.ntp.org iburst
server ntp0.fau.de iburst
server ntp1.fau.de iburst
server ntp2.fau.de iburst
server ntp3.fau.de iburst
server ntps1-0.cs.tu-berlin.de iburst
server ntps1-1.cs.tu-berlin.de iburst
server ntps1-0.uni-erlangen.de iburst
server ntps1-1.uni-erlangen.de iburst

##
# A list of available servers can be found here:
# http://www.pool.ntp.org/
# A good way to get servers for your machine is:
# netselect -s 3 pool.ntp.org
##

# you should not need to modify the following paths
driftfile /var/lib/ntp/ntp.drift

#server ntplocal.example.com prefer
#server timeserver.example.org

# Warning: Using default NTP settings will leave your NTP
# server accessible to all hosts on the Internet.

# If you want to deny all machines (including your own)
# from accessing the NTP server, uncomment:
#restrict default ignore


# To deny other machines from changing the
# configuration but allow localhost:
restrict default nomodify nopeer
restrict 127.0.0.1

# To allow machines within your network to synchronize
# their clocks with your server, but ensure they are
# not allowed to configure the server or used as peers
# to synchronize against, uncomment this line.
#
restrict 192.168.0.0 mask 255.255.255.0 nomodify nopeer notrap

rem996
01.12.05, 15:36
Hallo

danke für den Tip, ich hab das Problem jetz gefunden. Der LAN-Server hatte kurze Zeit keine Verbindung zum NTP-Server im Internet und dann konnte er auch die Zeit nicht mehr weitergeben. Jetzt gehts wieder :)

Naja einige hunder MS wären normal nicht relevant, da hast Du recht, allerdings muss ich ein paar Zeitmessungen machen und dafür sollte es dann schon wieder genauer sein ;)

Besten Dank für Deine Hilfe

lg
rem996