(笔记)【NTP系列:02】NTP使用常见问题记录
一、ntpd & ntpdate
这个问题的出现和你指定的ntp服务器的版本有关,我的版本是4.2。
下面是来自ntp官方网站的说明:
The behavior of notrust changed between versions 4.1 and 4.2.
In 4.1 (and earlier) notrust meant "Don't trust this host/subnet for time".
In 4.2 (and later) notrust means "Ignore all NTP packets that are not cryptographically authenticated." This forces remote time servers to authenticate themselves to your (client) ntpd
远程ntp是必须加密的,这一点有待研究,但是本地测试,先将这个关闭掉即可。
解决:
将你在ntp服务器配置文件指定访问客户ip的限制条件notrust去掉。
修改为:
说明:若ntpdate失败,此时可以使用ntpdate -d server_ip获取具体原因,如下:
root@AM437x-Droidsurg:~# ntpdate -d 172.16.1.200 3 Feb 13:08:27 ntpdate[767]: ntpdate 4.2.8p9@1.3265-o Fri Nov 8 06:35:47 UTC 2019 (2) Looking for host 172.16.1.200 and service ntp host found : 172.16.1.200 transmit(172.16.1.200) receive(172.16.1.200) transmit(172.16.1.200) receive(172.16.1.200) transmit(172.16.1.200) receive(172.16.1.200) transmit(172.16.1.200) receive(172.16.1.200) 172.16.1.200: Server dropped: Leap not in sync server 172.16.1.200, port 123 stratum 4, precision -23, leap 11, trust 000 refid [172.16.1.200], delay 0.02621, dispersion 0.00005 transmitted 4, in filter 4 reference time: e786fc57.694af343 Fri, Feb 3 2023 11:21:59.411 originate timestamp: e787158e.215b7216 Fri, Feb 3 2023 13:09:34.130 transmit timestamp: e7871551.ba3fef9e Fri, Feb 3 2023 13:08:33.727 filter delay: 0.02657 0.02635 0.02621 0.02664 0.00000 0.00000 0.00000 0.00000 filter offset: 60.40218 60.40204 60.40203 60.40224 0.000000 0.000000 0.000000 0.000000 delay 0.02621, dispersion 0.00005 offset 60.402032
如“Server dropped: Leap not in sync”,此时基本上是ntp服务端有异常,可尝试重启ntp服务端。
三、ntpd同步失败
1. 首先一定先确保可以使用ntpdate校时,若ntpdate校时不成功,则需先排查ntpdate的错误信息。使用ntpdate -d server_ip获取具体原因,如“Server dropped: Leap not in sync”、“Server dropped: no data"、“Server dropped: strata oo high".
2. 然后查阅本博客园下方文章。
(笔记)NTP时间同步失败:Windows(W32Time)作为NTP时钟源服务端,Linux作为客户端 - tdyizhen1314 - 博客园 (cnblogs.com)
posted on 2023-02-02 13:42 tdyizhen1314 阅读(2293) 评论(0) 编辑 收藏 举报
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· AI技术革命,工作效率10个最佳AI工具