Debian Squeeze 中的 NTP 标准配置被误解

Debian Squeeze 中的 NTP 标准配置被误解

Debian Squeeze 中的 NTP 标准配置如下(删除了注释):

driftfile /var/lib/ntp/ntp.drift
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 0.debian.pool.ntp.org iburst
server 1.debian.pool.ntp.org iburst
server 2.debian.pool.ntp.org iburst
server 3.debian.pool.ntp.org iburst
restrict -4 default kod notrap nomodify nopeer noquery
restrict -6 default kod notrap nomodify nopeer noquery
restrict 127.0.0.1
restrict ::1

我不明白前两个“restrict”命令是如何工作的。如果我参考手册页,restrict 的第一个参数必须是指向的地址(Ipv4 或 v6)或“default”。

这个 -4 或 -6 顺序是什么意思?

答案1

-4和分别-6表示使用IPv4或解析的地址。它们IPv6加起来等于default。这允许您有选择地按协议启用ntp。随着 IPv6 的推出,您可能会在其他网络工具中看到类似的变化。

Ubuntu 的手册页包含有关和 的ntp.conf一段。我希望 Debian 的手册页中也能找到它。-4-6

相关内容