Přeskočit obsah

Konfigurace serveru NTP na serveru Mediation Controller

Použití serveru NTP umožňuje synchronizovat hodiny vašich počítačů s hodinami serveru NTP.
Tato dokumentace popisuje konfiguraci serveru NTP pro server Mediation Controller produktu CyberElements Bastion.

Předpoklady

Je vyžadován přístup přes SSH nebo z konzoly a možnost použít na počítači účet superuživatele. Kromě toho se musíte ujistit, že server Mediation Controller má otevřený port UDP 123 směrem k požadovanému serveru nebo serverům NTP.

Konfigurace serveru nebo serverů NTP pro server Mediation Controller produktu CyberElements Bastion se nastavuje v souboru /etc/ntpsec/ntp.conf. Ve výchozím nastavení se jako servery NTP používají servery Debian.

Chcete-li přizpůsobit používaný server nebo servery NTP, začněte zakomentováním (přidejte # na začátek řádku) použití serverů NTP Debian na řádcích 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

Poté od řádku 27 přidejte jeden nebo více serverů NTP. Na každý řádek se přidává jeden server v následujícím formátu: server IP_ou_DNS_NTP.

Příklad

Chcete-li použít servery ntp1.systancia.local a 172.16.20.20, soubor by se 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

Informace

Další informace o konfiguraci souboru získáte příkazem man ntp.conf.

Upozornění!

Pokud definujete méně než 3 servery NTP, je nutné parametr minsane na řádku 24 snížit na počet serverů NTP.
Bez této úpravy ntpsec neopraví čas počítače.

Příklad

Pokud je definován pouze jeden server NTP, je nutné řádek 24 upravit tak, aby hodnota minsane byla 1:

24
tos minclock 4 minsane 1

Při použití výše uvedeného příkladu konfigurace se dvěma nakonfigurovanými servery NTP, a tedy s hodnotou minsane 2, bychom měli následující globální nastavení:

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í nové konfigurace je nutné restartovat službu ntpsec:

1
systemctl restart ntpsec