以前单位都是ubuntu,最近改到了centos,记录下ntp配置
1.安装ntp
yum install ntp ntpdate
2.启动ntp
systemctl start ntpd
systemctl enable ntpd
3.配置内部地址
vim /etc/ntp.conf
注释
#server 0.centos.pool.ntp.org iburst
#server 1.centos.pool.ntp.org iburst
#server 2.centos.pool.ntp.org iburst
#server 3.centos.pool.ntp.org iburst
#局域网设置:server 127.0.0.1 iburst
server 10.2.2.102 iburst
# 配置允许上游时间服务器主动修改本机的时间
restrict 10.2.2.102 nomodify notrap noquery
4.重启NTP
systemctl restart ntpd
5.查看检查状态
ntpstat