Dienstag, 23. Dezember 2008

Timeserver mit NTP

NTP (Network-Time-Protocol) basiert auf dem Client/Server-Prinzip. Ein oder mehrere Server bieten im Netzwerk die Uhrzeit an, und beliebig viele Clients synchronisieren sich damit. komm laber.

Server einrichten:
apt-get install ntp ntpdate


Die Konfigurationsfile /etc/ntp.conf:
driftfile /var/lib/ntp/ntp.drift

# Timeserver der physikalisch-Technischen Bundesanstalt
server ptbtime1.ptb.de
server ptbtime2.ptb.de

restrict ptbtime1.ptb.de
restrict ptbtime2.ptb.de
restrict 127.0.0.1
restrict 10.2.2.0 mask 255.255.255.0
restrict default notrust nomodify nopeer


/etc/init.d/ntp start


Clients:

apt-get install ntp ntp-simple ntpdate


Configfile /etc/ntp.conf:
driftfile /var/lib/ntp/ntp.drift

server 10.2.2.1

restrict 10.2.2.1
restrict 127.0.0.1
restrict default notrust nomodify nopeer


/etc/init.d/ntp restart



Gebamte Timeserver kann man hiermit angucken:
ntpq -p
ntpdc -p

Keine Kommentare: