我正在使用ntpd上的leapfilefunction进行一些testing,以发送假闰秒,并确保我们的Linux平台对“错误”具有适应性。 NTP实验很简单:一个带有本地时钟的“主”服务器,运行ntpd和leapfilefunction,一个“客户”系统也连接到“主”。
我刚才发现闰秒标志在CentOS-6盒子(运行4.2.4p8-2)上没有任何问题,从“主”转发到“客户端”,但是使用相同的configuration,它不能在Debian Squeeze (4.2.6.p2 + DFSG-1 + B1)。
如果我查询ntpd它会返回“leap_add_sec”和“leap = 01”标志,并运行一个tcpdump我也看到这些标志,但“客户端”系统忽略了标志,正如我所说: 这只发生在运行4.2的Debian。 6.p2来自上游,而不是使用4.2.4p8的CentOS 。
CentOS主控NTPconfiguration=工作正常
driftfile /var/lib/ntp/drift restrict default kod nomodify notrap nopeer noquery restrict 127.0.0.1 server 127.127.1.0 iburst fudge 127.127.1.0 stratum 10 includefile /etc/ntp/crypto/pw keys /etc/ntp/keys keysdir /etc/ntp crypto pw password
Debian主NTP config = leap-second不会从主服务器转发到客户端
leapfile "/etc/leap-seconds.list" driftfile /var/lib/ntp/drift restrict default kod nomodify notrap nopeer noquery restrict 127.0.0.1 server 127.127.1.1 iburst fudge 127.127.1.1 stratum 10 includefile /etc/ntp/crypto/pw keys /etc/ntp/keys
CentOS和Debianconfiguration文件的独特区别在于闰秒设置, 它依赖于ntpd版本 ,其余的conf在主服务器和客户端服务器上都是相同的。
这是客户端上的NTPconfiguration:
driftfile /var/lib/ntp/drift restrict default kod nomodify notrap nopeer noquery restrict 127.0.0.1 server 10.204.3.2 iburst includefile /etc/ntp/crypto/pw keys /etc/ntp/keys
什么原因阻碍了Debian / 4.2.6.p2系统上的闰秒转发?
仅供参考:这似乎是一个特定于版本的行为 ,Lenny(4.2.4p4 + dfsg-8lenny3)上的“forward”端口包在Squeeze上按预期工作:将闰秒字段转发给客户端。