服务端:
driftfile /var/lib/ntp/driftrestrict default nomodify notrap nopeer noqueryrestrict 127.0.0.1restrict ::1restrict 172.19.103.0 mask 255.255.255.0 nomodify notrapserver ntp.cloud.top iburstrestrict ntp.cloud.top nomodify notrap noqueryserver 127.127.1.0fudge 127.127.1.0 stratum 10includefile /etc/ntp/crypto/pwkeys /etc/ntp/keysdisable monitor
客户端:
driftfile /var/lib/ntp/driftrestrict default nomodify notrap nopeer noqueryrestrict 127.0.0.1restrict ::1server ntp.cloud.toprestrict ntp.cloud.top nomodify notrap noqueryincludefile /etc/ntp/crypto/pwkeys /etc/ntp/keysdisable monitor
server 192.168.59.241 iburstdriftfile /var/lib/ntp/driftrestrict default nomodify notrap nopeer noqueryrestrict 127.0.0.1restrict ::1includefile /etc/ntp/crypto/pwkeys /etc/ntp/keysdisable monitor
CentOS6下的NTP服务通用配置
driftfile /var/lib/ntp/driftrestrict default kod nomodify notrap nopeer noqueryrestrict -6 default kod nomodify notrap nopeer noqueryrestrict 127.0.0.1restrict -6 ::1# 允许内网其他机器同步时间restrict 192.168.1.0 mask 255.255.255.0 nomodify notrapserver 210.72.145.44 perfer server 202.112.10.36 # 1.cn.pool.ntp.orgserver 59.124.196.83 # 0.asia.pool.ntp.org# 允许上层时间服务器主动修改本机时间restrict 210.72.145.44 nomodify notrap noqueryrestrict 202.112.10.36 nomodify notrap noqueryrestrict 59.124.196.83 nomodify notrap noquery# Undisciplined Local Clock. This is a fake driver intended for backup# and when no outside source of synchronized time is available. # 外部时间服务器不可用时,以本地时间作为时间服务server 127.127.1.0 # local clockfudge 127.127.1.0 stratum 10includefile /etc/ntp/crypto/pwkeys /etc/ntp/keys