我正在configuration公司networking内的ntp。
我已经搞定了
restrict default ignore restrict -6 default ignore
并明确列出了server (我正在使用来自pool.ntp.org公共服务器)。 我也没有启用broadcastclient 。
一段时间后, ntpq -p不断显示本地networking内部没有添加到configuration文件中的特定服务器。
不应该restrict default ignore make ntpd忽略服务器没有明确提到的所有数据包?
我用dig查看了我正在使用的服务器,地址似乎是正确的。
这里是ntpq -pn :
remote refid st t when poll reach delay offset jitter ============================================================================== 10.200.10.253 .INIT. 16 u - 64 0 0.000 0.000 0.000
而我目前的ntp.conf (评论删除)
driftfile /var/lib/ntp/ntp.drift statsdir /var/log/ntpstats/ 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 2.europe.pool.ntp.org restrict default ignore restrict -6 default ignore restrict 2.europe.pool.ntp.org nomodify restrict 127.0.0.1 restrict ::1
经过一些debugging和Aaron的帮助,我发现了这个问题。
ISC DHCP客户端在Debian中默认获取ntp服务器的信息。
Debian的ntpd init脚本通过扩展/etc/ntp.conf来使用这个信息。 生成的文件在/var/lib/ntp/ntp.conf.dhcp可用。
当然,解决scheme是正确configurationDHCP不接收ntp服务器(只需删除/etc/dhcp/dhclient.conf中的ntp-servers选项)。
NTP支持页面中提供了更多信息,第6.12节 :
ISC's dhcp is able to automatically configure the servers used by ntpd. Here's how to get it working: The dhcp server you are using must be configured to provide the ntp-servers option Configure your dhclient to request ntp-servers (it doesn't by default). To do this add ntp-servers to the default request line in /etc/dhcp3/dhclient.conf Create an /etc/ntp.conf with all of the other settings that you wish to use. This file will be used to create /etc/ntp.conf.dhcp, it won't be over written. Your ntpd must be told to use /etc/ntp.conf.dhcp if it exists. This is usually accomplished in the ntp init script (eg /etc/init.d/ntp).