Preskočiť na obsah

Konfigurácia servera NTP na serveri Mediation Controller

Použitie servera NTP umožňuje synchronizovať hodiny vašich počítačov s hodinami servera NTP.
Táto dokumentácia opisuje konfiguráciu servera NTP pre server Mediation Controller produktu CyberElements Bastion.

Predpoklady

Vyžaduje sa prístup cez SSH alebo konzolu + možnosť použiť na počítači účet superpoužívateľa. Okrem toho musíte zabezpečiť, aby mal server Mediation Controller otvorený port UDP 123 smerom k požadovanému serveru alebo serverom NTP.

Konfigurácia servera alebo serverov NTP pre server Mediation Controller produktu CyberElements Bastion sa nastavuje v súbore /etc/ntpsec/ntp.conf. Predvolene sa ako servery NTP používajú servery projektu Debian.

Ak chcete prispôsobiť server alebo servery NTP, ktoré sa majú používať, začnite zakomentovaním (pridajte # na začiatok riadka) používania serverov NTP projektu Debian v riadkoch 34-37:

31
32
33
34
35
36
37
# 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>
#pool 0.debian.pool.ntp.org iburst
#pool 1.debian.pool.ntp.org iburst
#pool 2.debian.pool.ntp.org iburst
#pool 3.debian.pool.ntp.org iburst

Potom počnúc riadkom 27 pridajte jeden alebo viac serverov NTP. Na každý riadok treba pridať jeden server v nasledujúcom formáte: server IP_ou_DNS_NTP.

Príklad

Ak chcete použiť servery ntp1.systancia.local a 172.16.20.20, súbor by sa upravil takto:

26
27
28
29
30
31
32
33
34
35
36
37
38
39
# Specify one or more NTP servers.
server ntp1.systancia.local
server 172.16.20.20

# Public NTP servers supporting Network Time Security:
# server time.cloudflare.com nts

# 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>
#pool 0.debian.pool.ntp.org iburst
#pool 1.debian.pool.ntp.org iburst
#pool 2.debian.pool.ntp.org iburst
#pool 3.debian.pool.ntp.org iburst

Informácie

Ďalšie informácie o konfigurácii súboru získate príkazom man ntp.conf.

Upozornenie!

Ak definujete menej ako 3 servery NTP, parameter minsane v riadku 24 treba znížiť na počet serverov NTP.
Bez tejto úpravy ntpsec neopraví čas počítača.

Príklad

Ak je definovaný iba jeden server NTP, riadok 24 treba upraviť tak, aby hodnota minsane bola 1:

24
tos minclock 4 minsane 1

Pri použití vyššie uvedeného príkladu konfigurácie s dvoma nakonfigurovanými servermi NTP, a teda s hodnotou minsane 2, by sme mali nasledujúce globálne nastavenia:

22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# Comment this out if you have a refclock and want it to be able to discipline
# the clock by itself (e.g. if the system is not connected to the network).
tos minclock 4 minsane 2

# Specify one or more NTP servers.
server ntp1.systancia.local
server 172.16.20.20

# Public NTP servers supporting Network Time Security:
# server time.cloudflare.com nts

# 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>
#pool 0.debian.pool.ntp.org iburst
#pool 1.debian.pool.ntp.org iburst
#pool 2.debian.pool.ntp.org iburst
#pool 3.debian.pool.ntp.org iburst

Po uložení novej konfigurácie treba reštartovať službu ntpsec:

1
systemctl restart ntpsec