Skoči na vsebino

Konfiguriranje strežnika NTP na Mediation Controller

Strežnik NTP omogoča sinhronizacijo ur vaših računalnikov z uro strežnika NTP.
Ta dokumentacija opisuje konfiguracijo strežnika NTP za strežnik Mediation Controller CyberElements Bastion.

Predpogoji

Potrebna sta dostop prek SSH ali konzole + možnost uporabe računa superuporabnika v računalniku. Poleg tega morate zagotoviti, da ima strežnik Mediation Controller odprta vrata UDP 123 do želenega strežnika ali strežnikov NTP.

Konfiguracija strežnika ali strežnikov NTP za strežnik Mediation Controller CyberElements Bastion je nastavljena v datoteki /etc/ntpsec/ntp.conf. Privzeto se kot strežniki NTP uporabljajo strežniki Debian.

Če želite prilagoditi strežnik ali strežnike NTP, ki naj se uporabljajo, najprej v vrsticah 34-37 zakomentirajte (na začetek vrstice dodajte #) uporabo strežnikov NTP Debian:

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

Nato od vrstice 27 naprej dodajte enega ali več strežnikov NTP. V vsako vrstico dodajte en strežnik v naslednji obliki: server IP_ou_DNS_NTP.

Primer

Za uporabo strežnikov ntp1.systancia.local in 172.16.20.20 bi datoteko spremenili takole:

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

Informacije

Več informacij o konfiguraciji datoteke lahko dobite z ukazom man ntp.conf.

Opozorilo!

Če določite manj kot 3 strežnike NTP, je treba parameter minsane v vrstici 24 znižati na število strežnikov NTP.
Brez te spremembe ntpsec ne bo popravil časa računalnika.

Primer

Če je določen le en strežnik NTP, je treba vrstico 24 spremeniti tako, da je vrednost minsane 1:

24
tos minclock 4 minsane 1

Ob uporabi zgornjega primera konfiguracije z dvema konfiguriranima strežnikoma NTP in torej z vrednostjo minsane 2 bi imeli naslednje globalne nastavitve:

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 shranjevanju nove konfiguracije je treba znova zagnati storitev ntpsec:

1
systemctl restart ntpsec