Basic configuration file
You want to configure local time server server 127.127.1.0 must write this
# --- GENERAL CONFIGURATION ---server aaa.bbb.ccc.dddserver 127.127.1.0fudge 127.127.1.010# Drift file.driftfile /etc/ntp/drift
My example
Restrict 192.168.0.0 mask 255.255.255.0 nomodify
Allow 192.168.0.0 Network segment access
# For more information on this file, see the "The Man pages "# ntp.conf (5), NTP_ACC (5), Ntp_auth (5), Ntp_clock (5), Ntp_misc (5), Ntp_mon (5).Driftfile/var/lib/ntp/drift# Permit time synchronization with We time source, but does not# permit the source to a query or modify the service on this system.RestrictdefaultNomodify# Permit All Access over the loopback interface. This could# is tightened as well, but to does so would effect some of# The administrative functions.#restrict Default IgnoreRestrict192.168. 0. 0Mask255.255. 255. 0Nomodify# Use public servers from the pool.ntp.org project.# Please consider joining the pool (http://www.pool.ntp.org/join.html).#server 0.centos.pool.ntp.org IburstServer127.127. 1. 0Fudge127.127. 1. 0StratumTen#broadcast 192.168.1.255 AutoKey # Broadcast Server#broadcastclient # Broadcast Client#broadcast 224.0.1.1 AutoKey # multicast Server#multicastclient 224.0.1.1 # Multicast Client#manycastserver 239.255.254.254 # manycast Server#manycastclient 239.255.254.254 AutoKey # manycast Client# Enable Public key cryptography.#cryptoIncludefile/etc/ntp/crypto/pw# key file containing the keys and Key identifiers used when operating# with symmetric key cryptography.Keys/etc/ntp/keys# Specify the key identifiers which is trusted.#trustedkey 4 8# Specify the key identifier to use with the NTPDC utility.#requestkey 8# Specify the key identifier to use with the NTPQ utility.#controlkey 8# Enable writing of statistics records.#statistics clockstats cryptostats loopstats peerstats# Disable The monitoring facility to prevent amplification attacks using NTPDC# monlist Command When default restrict does not include the Noquery flag. See# cve-2013-5211 for more details.# note:monitoring'll is disabled with the limited restriction flag.Disable Monitor
Ntp-q
View status
When reach reaches 5 o'clock, it will work properly.
Client actions are written to the timed script.
sudo vi /etc/crontab*/30 * * * * /usr/sbin/ntpdate192.168.233.141
NTP Configuring the local server ntp.conf