首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >NTP不会更新客户端的时间。

NTP不会更新客户端的时间。
EN

Ask Ubuntu用户
提问于 2019-07-04 09:33:06
回答 1查看 543关注 0票数 0

我正在运行一个安装了ntp的Ubuntu18.04服务器。我需要NTP来同步ordet中的时间,让Munge服务正常工作。

我的防火墙没有启用,但是我添加了允许ntp的规则。服务器和客户端都会产生udp-端口123是打开的。因此,在实例中运行以下命令: Server:sudo nmap -sU -p123 192.168.1.1

客户端:sudo nmap -sU -p123 192.168.1.1

结果是,udp端口123是“开放的、经过筛选的”并被ntp-服务使用的响应。

我有以下设置:

ntp.conf @NTP-服务器:

代码语言:javascript
复制
# /etc/ntp.conf, configuration for ntpd; see ntp.conf(5) for help

driftfile /var/lib/ntp/ntp.drift

leapfile /usr/share/zoneinfo/leap-seconds.list

statistics loopstats peerstats clockstats

filegen loopstats file loopstats type day enable

filegen peerstats file peerstats type day enable

filegen clockstats file clockstats type day enable

restrict -4 default kod notrap nomodify nopeer noquery limited

restrict -6 default kod notrap nomodify nopeer noquery limited

restrict 127.0.0.1

restrict ::1


restrict source notrap nomodify noquery

restrict 192.168.1.0 mask 255.255.255.0 notrust
broadcast 192.168.1.1 

disable auth

ntp.conf @ clients:

代码语言:javascript
复制
# /etc/ntp.conf, configuration for ntpd; see ntp.conf(5) for help

driftfile /var/lib/ntp/ntp.drift

leapfile /usr/share/zoneinfo/leap-seconds.list

statistics loopstats peerstats clockstats

filegen loopstats file loopstats type day enable

filegen peerstats file peerstats type day enable

filegen clockstats file clockstats type day enable

server 192.168.1.1 prefer

restrict default notrust nomodify nopeer

restrict 192.168.1.1 

停止并启动ntp-服务(在服务器上)之后,在客户端输入以下tcpdump命令:

sudo tcpdump -i enp5s0f1 udp port 123 -vvv

(作为一个副词,如果有人要解决同样的问题,我注意到tcpdump命令首先产生了接收udp-package中的一个坏校验和,但是在将rx和tx的校验和设置为off、连接以太网设备(通过ethtool)、错误校验和纠正之后)。

结果输出(在相当一段时间后收到),说明时钟不同步。运行(@客户端) ntpdate -u 192.168.1.1会产生“找不到适合同步的服务器”。

在服务器上运行ntpq -pn将生成refid处于状态.BCST,但在客户端它被注意为.INIT.,并且不会被更改(在等待了几个小时之后)。

我错过了什么?任何帮助都是非常感谢的。你好,P。

EN

回答 1

Ask Ubuntu用户

回答已采纳

发布于 2019-07-05 09:18:11

为了充分支持>=18.04,您应该使用编年史而不是ntpd。

改变这一点解决了记者的问题,把答案记录下来比在评论中更容易找到。

票数 0
EN
页面原文内容由Ask Ubuntu提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://askubuntu.com/questions/1155867

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档