Fórum Root.cz
Hlavní témata => Software => Téma založeno: Pavel M 21. 01. 2012, 18:56:11
-
Ahoj potreboval bych poradit s konfiguraci NTP klienta. Podle tohoto http://www.linuxexpres.cz/praxe/seridte-linuxu-hodinky (http://www.linuxexpres.cz/praxe/seridte-linuxu-hodinky) clanku neni pouzivani ntpdate vhodne takze jsem si chtel nastavit ntpd, ale nedari se:( Vsechny servery mam stratum 2.
ntpq -p
remote refid st t when poll reach delay offset jitter
==============================================================================
*tik.cesnet.cz .GPS. 1 u 346 1024 1 5.706 0.305 0.32
tady je moje konfigurace NTP clienta:
# /etc/ntp.conf, configuration for ntpd; see ntp.conf(5) for help
driftfile /var/lib/ntp/ntp.drift
# Enable this if you want statistics to be logged.
#statsdir /var/log/ntpstats/
statistics loopstats peerstats clockstats
filegen loopstats file loopstats type day enable
filegen peerstats file peerstats type day enable
filegen clockstats file clockstats type day enable
# You do need to talk to an NTP server or two (or three).
#server ntp.your-provider.example
# 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>
#zakomentoval jsem ...
#server 0.debian.pool.ntp.org iburst
#server 1.debian.pool.ntp.org iburst
#server 2.debian.pool.ntp.org iburst
#server 3.debian.pool.ntp.org iburst
# Access control configuration; see /usr/share/doc/ntp-doc/html/accopt.html for
# details. The web page <http://support.ntp.org/bin/view/Support/AccessRestrictions>
# might also be helpful.
#
# Note that "restrict" applies to both servers and clients, so a configuration
# that might be intended to block requests from certain clients could also end
# up blocking replies from your own upstream servers.
# 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
# Clients from this (example!) subnet have unlimited access, but only if
# cryptographically authenticated.
#restrict 192.168.123.0 mask 255.255.255.0 notrust
# If you want to provide time to your local subnet, change the next line.
# (Again, the address is an example only.)
#broadcast 192.168.123.255
# If you want to listen to time broadcasts on your local subnet, de-comment the
# next lines. Please do this only if you trust everybody on the network!
#disable auth
#broadcastclient
#pridane servery vsechny stratum 2
server clock1.zcu.cz # TEN, ČR
server clock2.zcu.cz # TEN, ČR
server ntp1.ctt.cz
server ntp2.ctt.cz
server ntp3.ctt.cz
V souboru /etc/ntp.conf mam na konci uvedeno
#pridane servery
ntp1.ctt.cz
ntp2.ctt.cz
ntp3.ctt.cz
clock1.zcu.cz # TEN, ČR
clock2.zcu.cz # TEN, ČR
Tzn. i prikaz ntpq -p by tento stav mel reflektovat a uvedene NTP servery by se mely zobrazit ne?
-
no ja nejak nechapu, kde mas problem? proc nepouzivas ty pool?
ja mam treba totok:
server 0.ch.pool.ntp.org
server 1.ch.pool.ntp.org
server 2.ch.pool.ntp.org
server 3.ch.pool.ntp.org
server 0.europe.pool.ntp.org
server 1.europe.pool.ntp.org
server 2.europe.pool.ntp.org
server 3.europe.pool.ntp.org
a ntpq -p ukazuje totok:
remote refid st t when poll reach delay offset jitter
==============================================================================
+192.33.214.57 192.33.214.12 2 u 537 1024 377 23.621 -1.998 7.178
*ntp0.as34288.ne .PPS. 1 u 1031 1024 377 18.743 -1.782 7.309
+ns1.nexellent.n 194.242.34.149 2 u 686 1024 377 21.129 -0.229 2.305
+khyber.madduck. 131.188.3.222 2 u 856 1024 377 15.213 -0.838 2.289
+ntp.tuxfamily.n 195.220.94.163 2 u 944 1024 377 51.320 0.329 2.484
-virtueledoos.nl 213.239.154.12 3 u 89 1024 377 29.675 1.530 2.990
-ntp1.adviseo.ne 192.53.103.104 2 u 909 1024 377 34.922 -3.814 2.083
-mail.topfactori 80.96.120.253 2 u 50 1024 377 68.710 8.210 1.124
-
jinak ntpdate nebo lepe sntp je zahodno pustit ve startovacim skriptu jednou a seridit cas a pak pustit ntpd.
-
no ja nejak nechapu, kde mas problem? proc nepouzivas ty pool?
ja mam treba totok:
Taky tomu nerozumím...
driftfile /var/lib/ntp/ntp.drift
statistics loopstats peerstats clockstats
filegen loopstats file loopstats type day enable
filegen peerstats file peerstats type day enable
filegen clockstats file clockstats type day enable
server 0.cz.pool.ntp.org iburst
server 1.cz.pool.ntp.org iburst
server 2.cz.pool.ntp.org iburst
server 3.cz.pool.ntp.org iburst
restrict -4 default kod notrap nomodify nopeer noquery
restrict -6 default kod notrap nomodify nopeer noquery
restrict 127.0.0.1
restrict ::1
$ ntpq -p
remote refid st t when poll reach delay offset jitter
==============================================================================
*miriel.vsobotka 195.113.144.201 2 u 154 256 377 42.238 1.723 0.526
+ntp1.kajot.cz 193.85.174.5 2 u 34 256 377 46.994 0.897 0.556
-2a01:5f0:100d:1 147.231.19.43 2 u 88 256 377 109.470 5.676 5.236
+first.blesmrt.n 195.113.144.201 2 u 30 256 377 46.390 2.052 1.273
-
No ja myslel ze NTP servery si muzu sam vybrat...
Co je ale divne, ze vy mate ve vypisu ntpq -p tolik serveru koilik mate polozek(serveru) v konfiguraku. Zatim co ja mam ve vypisu jen jeden server. Schvalne si zkuste zmenit servery v konfiguraku na ty co mam ja a pak overit vypisem ntpq -p jestli se neco zmeni.
-
A co kdybys radši ty zkusil jiný servery a přišel nám poreferovat? (Máš tam tři servery Contactelu, které nikdy pořádně nefungovaly a asi taky nikdy pořádně fungovat nebudou, tak asi tak...)
-
Tak jsem tu kvuli tem referencim...:) Dal jsem tam servery:
server 0.cz.pool.ntp.org iburst
server 1.cz.pool.ntp.org iburst
server 2.cz.pool.ntp.org iburst
server 3.cz.pool.ntp.org iburst
a vysledek je porad stejny....
ntpq -p
remote refid st t when poll reach delay offset jitter
==============================================================================
tik.cesnet.cz .GPS. 1 u 2 64 1 7.171 -0.042 0.188
-
Prosímtě, a už jsi to ntd někdy po těch úpravách restartoval?
-
Samozrejme, restartuju ho po kazde uprave...
-
Samozrejme, restartuju ho po kazde uprave...
Aha, no tak asi holt čte jinej konfigurační soubor nebo ti ho přepisuje DHCP server nějakou pitomostí.
-
Ok, takze pokud mi ho prepisuje DHCP a ja nemam moznost DHCP konfigurovat, ale potrebuju od DHCP adresu tak jak mu mam "rict", at si od DHCP serveru bere jen adresu, dns... proste vse krome NTP serveru? Asi to bude opravdu tim DHCP. Na to jsem uplne zapomnel ...
-
V konfiguraku /etc/dhcp/dhclient.conf jsem narazil na polozku
request ntp-servers
Zakomentuju a zkusim - snad to pojede,...
-
Mel jsi nakonec pravdu - bylo to tim DHCP serverem, prideloval mi i NTP servery. Ted uz to funguje.
-
V konfiguraku /etc/dhcp/dhclient.conf jsem narazil na polozku
request ntp-servers
Zakomentuju a zkusim - snad to pojede,...
Ano, ale to tam defaultně není, tak nevím, kdo to tam napsal. :D A mohl bys kontaktovat majitele toho DHCP serveru a sdělit mu, že používání restricted stratum 1 NTP serveru je přinejmenším nevhodné?
-
Majitele kontaktuju, konfigurak byl nezmeneny. Bylo to tam defaultne. Nebyla tam jen ta jedna polozka... byla jich tam hromada - ja jsem pouze odstranil tu
ntp-servers
V kazdem pripade diky za pomoc!:)
-
Majitele kontaktuju, konfigurak byl nezmeneny. Bylo to tam defaultne.
Jak starý je ten Debian? Tohle je defaultně vypnuté už drahně let. :D
No, hlavně že to funguje, ono jsou taky rozbité DHCP servery, které to tam procpou i když o to klient nestojí, a pak pomůže jedině změna klienta třeba na toho od ISC a volba -N/--nontp.
-
Je to Debian Squeeze. Takto vypadal konfigurak pred opravou (vsimni si posledni polozky):
request subnet-mask, broadcast-address, time-offset, routers,
domain-name, domain-name-servers, domain-search, host-name,
netbios-name-servers, netbios-scope, interface-mtu,
rfc3442-classless-static-routes, ntp-servers;
-
Do souboru step-tickers v adresari /etc/ntp si pridej servery ktere chces pouzivat pro NTP
mas tam jen tik.cesnet.cz
Cest Praci