dsp-site/wiki/Linux/System/Сервер NTP в локальной сети.adoc

35 lines
1.1 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

= Сервер времени NTP в локальной сети
:category: Linux
:tags: Linux, NTP, время,
Если в локальной сети необходимо синхронизировать время, не имея
авторитетного источника времени, то можно использовать локальные часы
сервера в качестве базовых. В этом случае файл настройки `/etc/ntp.conf`
на сервере `192.168.0.1` будет выглядеть так:
[source,text]
----
driftfile /var/lib/ntp/ntp.drift
logfile /var/log/ntp.log
tinker panic 0
server 127.127.1.0 minpoll 4 maxpoll 7
fudge 127.127.1.0 stratum 8
restrict 192.168.0.0 mask 255.255.255.0
restrict default nomodify notrap
----
Файл `/etc/ntp.conf` на клиенте из подсети `192.168.0.0/24` имеет вид:
[source,text]
----
driftfile /var/lib/ntp/ntp.drift
logfile /var/log/ntp.log
tinker panic 0
server 127.127.1.0 minpoll 4 maxpoll 7
fudge 127.127.1.0 stratum 12
server 192.168.0.1 minpoll 4 maxpoll 7 iburst
restrict default nomodify nopeer
----