restrict default kod nomodify notrap nopeer noquery
# restrict -6 default kod nomodify notrap nopeer noquery #针对ipv6设置# 允许本地所有操作restrict 127.0.0.1
#restrict -6 ::1# 允许的局域网络段或单独iprestrict 10.0.0.0 mask 255.0.0.0 nomodify motrap
restrict 192.168.0.0 mask 255.255.255.0 nomodify motrap
restrict 192.168.1.123 mask 255.255.255.255 nomodify motrap
# 使用上层的internet ntp服务器server cn.pool.ntp.org prefer
server 0.asia.pool.ntp.org
server 3.asia.pool.ntp.org
server 0.centos.pool.ntp.org iburst
# 如果无法与上层ntp server通信以本地时间为标准时间server 127.127.1.0 # local clockfudge 127.127.1.0 stratum 10# 计算本ntp server 与上层ntpserver的频率误差driftfile /var/lib/ntp/drift
# Key file containing the keys and key identifiers used when operating# with symmetric key cryptography.keys /etc/ntp/keys
#日志文件logfile /var/log/ntp.log
2. /etc/sysconfig/ntpd
1
2
3
4
5
6
# Drop root to id 'ntp:ntp' by default.OPTIONS="-u ntp:ntp -p /var/run/ntpd.pid"# Set to 'yes' to sync hw clock after successful ntpdateSYNC_HWCLOCK=yes #make no into yes; BIOS的时间也会跟着修改# Additional options for ntpdateNTPDATE_OPTIONS=""