我正在尝试设置一台计算机作为ntp服务器,其他本地计算机将把它们的时间同步到ntp服务器。无论ntp服务器机器是否连接到互联网,这都需要发生,即:时间是否正确并不重要,重要的是机器彼此同步。
我的配置文件如下:
NTP服务器/etc/ntp.conf
driftfile /var/lib/ntp/ntp.drift
server 0.pool.ntp.org iburst
server 1.pool.ntp.org iburst
server 2.pool.ntp.org iburst
server 127.127.1.0
fudge 127.127.1.0 stratum 10
restrict -4 default kod notrap nomodify nopeer noquery
restrict -6 default kod notrap nomodify nopeer noquery
restrict 127.0.0.1
restrict ::1
NTP客户端/etc/ntp.conf
driftfile /var/lib/ntp/ntp.drift
server 192.168.1.146 iburst
restrict -4 default kod notrap nomodify nopeer noquery
restrict -6 default kod notrap nomodify nopeer noquery
restrict 127.0.0.1
restrict ::1
我更改了服务器上的时间,然后使用sudo /etc/init.d/ntp start
运行ntp服务器,并尝试测试客户端是否可以使用sudo ntpdate 192.168.1.146
接收ntp更新
这是有效的,但仅当连接到Internet时(即使主服务器具有由我的命令设置的时间,而不是来自外部ntp服务器)。
我的配置文件中有什么错误吗?我有没有漏掉什么步骤?
发布于 2014-07-07 16:19:21
当您断开与Internet的连接,并且在DNS缓存中没有已解析的NTP域时,您的工作站无法解析NTP域名。这是第一件要检查的事情。然后你应该允许这种传输通过防火墙进入你的站点,如果你丢弃所有流量并制作隧道。
https://stackoverflow.com/questions/18829311
复制相似问题