Pereiti prie turinio

NTP serverio konfigūravimas Mediation Controller serveryje

Naudodami NTP serverį galite sinchronizuoti savo kompiuterių laikrodžius su NTP serverio laikrodžiu.
Šioje dokumentacijoje aprašoma NTP serverio konfigūracija CyberElements Bastion Mediation Controller serveriui.

Būtinosios sąlygos

Reikalinga SSH arba konsolės prieiga ir galimybė kompiuteryje naudoti supervartotojo paskyrą. Be to, turite įsitikinti, kad Mediation Controller serveryje atidarytas UDP prievadas 123 į norimą (-us) NTP serverį (-ius).

CyberElements Bastion Mediation Controller serverio NTP serverio (-ių) konfigūracija nustatoma faile /etc/ntpsec/ntp.conf. Pagal numatytuosius nustatymus kaip NTP serveriai naudojami Debian serveriai.

Norėdami tinkinti naudotiną (-us) NTP serverį (-ius), pirmiausia 34–37 eilutėse užkomentuokite Debian NTP serverių naudojimą (eilutės pradžioje pridėkite #):

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

Tada, pradėdami nuo 27 eilutės, pridėkite vieną ar daugiau NTP serverių. Kiekvienoje eilutėje turi būti vienas serveris tokiu formatu: server IP_ou_DNS_NTP.

Pavyzdys

Norint naudoti serverius ntp1.systancia.local ir 172.16.20.20, failą reikėtų pakeisti taip:

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

Informacija

Daugiau informacijos apie failo konfigūravimą galima gauti komanda man ntp.conf.

Dėmesio!

Jei apibrėžiate mažiau nei 3 NTP serverius, parametrą minsane 24 eilutėje reikia sumažinti iki NTP serverių skaičiaus.
Be šio pakeitimo ntpsec nepataisys kompiuterio laiko.

Pavyzdys

Jei apibrėžtas tik vienas NTP serveris, 24 eilutę reikia pakeisti taip, kad minsane reikšmė būtų 1:

24
tos minclock 4 minsane 1

Remiantis aukščiau pateiktu konfigūracijos pavyzdžiu su dviem sukonfigūruotais NTP serveriais, taigi su minsane reikšme 2, gautume tokius bendruosius parametrus:

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

Įrašius naują konfigūraciją, reikia iš naujo paleisti paslaugą ntpsec:

1
systemctl restart ntpsec