我需要设置一个ntp多播客户端。为了能够检查我的配置是好的,我trIde设置一个NTP多播服务器。
我的设置:
我的问题是:
使用针对孤儿的指令,似乎不会降低组播地址的报告层:
ntpq -n -p
remote refid st t when poll reach delay offset jitter
==============================================================================
*192.165.10.2 192.165.10.109 4 u 14 64 377 0.454 2.267 1.479
224.0.1.1 .MCST. 16 u - 64 0 0.000 0.000 0.000我的客户似乎仍然无法在224.0.1.1地址上找到服务器。
我检查了我的主机服务器vm和客户机vm,它们都看到了服务器多播消息(对于vm:使用tcpdump,对于主机:使用wireshark)。
在客户机上,使用ntpq -n -p将返回以下内容:
No association ID's returned在客户机上,我的配置文件都有注释的限制指令,而且我只有这些指令(还有一些更像driftfile之类的):
multicastclient 224.0.1.1
keys /etc/ntp/keys
trustedkey 1ntpd客户端日志提供了以下内容:
systemd[1]: Starting Network Time Service...
ntpd[11076]: ntpd 4.2.6p5@1.2349-o Tue Jun 23 15:38:18 UTC 2020 (1)
systemd[1]: Started Network Time Service.
ntpd[11077]: proto: precision = 0.052 usec
ntpd[11077]: 0.0.0.0 c01d 0d kern kernel time sync enabled
ntpd[11077]: ntp_io: estimated max descriptors: 1024, initial socket boundary: 16
ntpd[11077]: Listen and drop on 0 v4wildcard 0.0.0.0 UDP 123
ntpd[11077]: Listen and drop on 1 v6wildcard :: UDP 123
ntpd[11077]: Listen normally on 2 lo 127.0.0.1 UDP 123
ntpd[11077]: Listen normally on 3 enp0s3 192.165.10.107 UDP 123
ntpd[11077]: Listen normally on 4 lo ::1 UDP 123
ntpd[11077]: Listen normally on 5 enp0s3 fe80::a00:27ff:fec1:cc1 UDP 123
ntpd[11077]: Listening on routing socket on fd #22 for interface updates
ntpd[11077]: Listen normally on 6 multicast 224.0.1.1 UDP 123
ntpd[11077]: Joined 224.0.1.1 socket to multicast group 224.0.1.1
ntpd[11077]: 0.0.0.0 c016 06 restart
ntpd[11077]: 0.0.0.0 c012 02 freq_set kernel 0.000 PPM
ntpd[11077]: 0.0.0.0 c011 01 freq_not_set
ntpd[11077]: io_setbclient: Opened broadcast client on interface #3 enp0s3发布于 2020-08-10 10:20:45
地层16表示NTP服务器不相信它有有效的时间,因为它与任何配置的时间源没有连接。为了使服务器系统上的ntpd信任系统的本地时钟作为时间源,有两个选项:
tos orphan文件中指定ntp.conf和tos orphanwait关键字。# If orphaned, serve others with this stratum.
tos orphan 8
# Wait for this many seconds before starting to serve others (default is 300 s)
tos orphanwait 1ntpd使用本地时钟作为多播服务器上的假时间源。此配置不应与实际NTP时间源一起使用,因为它可能会导致ntpd相信本地时钟而不是真实NTP源,除非已经配置了足够数量的外部源,并且彼此之间保持足够的同步,以排除127.127.1.0伪源(该伪源总是与本地时钟完全一致,因此它往往会受到ntpd选择算法的过度青睐)。server 127.127.1.0 iburst
fudge 127.127.1.0 stratum 8以127.127.*开头的IP地址对于ntpd是特殊的:它们指的是内置于ntpd中的各种参考时钟驱动程序。
这两种方法都将使系统基于NTP上的本地不同步系统时钟服务于UTC时间,因此任何与实际NTP时间源(=分层7或以下)有合理直接连接的系统都应该优先于此。
当您的ntpd版本支持它时,建议使用新的方法,因为使用它时,如果/当您向系统添加真正的NTP时间源时,您不需要记住删除伪源。
https://unix.stackexchange.com/questions/603764
复制相似问题