One, NTP server (ip:192.168.1.101)
Installation: Yum install-y NTP
Firewall allowed: iptables-a input-i $EXTIF-P udp-s 192.168.1.0/24--dport 123-j ACCEPT
Configuration: vim/etc/ntp.conf
Restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap
Server before # Remove
Start:/ETC/INIT.D/NTPD start
Chkconfig ntpd on
Observation: Ntpq-p or Ntpstat
Second, NTP client
Installation: Yum install-y ntpdate
Manual sync First: Ntpdate 192.168.1.101 (wrong: ntpdate-d 192.168.1.101)
Configuration: vim/etc/ntp.conf
Server 192.168.1.101
Start:/ETC/INIT.D/NTPD start
Chkconfig ntpd on
Write Crontab-e
Add a row to synchronize with the time synchronization server 6:10 daily
* * * */usr/sbin/ntpdate ntp-server IP >>/usr/local/logs/crontab/ntpdate.log
Attention:
Self-built NTP time cannot be too much worse than external server time
Firewall to allow UDP port 123
Need to wait a few minutes to take effect
The time error between server and client cannot be greater than 1000s
NTP Server for Linux experiments