![如何使用我的本地时间作为`ntpd`的唯一参考?](https://linux22.com/image/1552627/%E5%A6%82%E4%BD%95%E4%BD%BF%E7%94%A8%E6%88%91%E7%9A%84%E6%9C%AC%E5%9C%B0%E6%97%B6%E9%97%B4%E4%BD%9C%E4%B8%BA%60ntpd%60%E7%9A%84%E5%94%AF%E4%B8%80%E5%8F%82%E8%80%83%EF%BC%9F.png)
我想让我的Linux设备将其本地时间与另一个Linux服务器的本地时间同步,而无需任何其他参考。我不在乎实际时间。我想要我的假时间。因此我不需要任何其他 ntp 服务器作为参考。例如,我只需将 Linux 服务器的本地时间设置1.2.3.4
为2033-02-23 15:23:10
。我想让我的 Linux 设备同步这个时间。Linux/etc/ntp.conf
服务器上的配置文件是:
restrict 127.0.0.1
restrict ::1
server 127.127.1.1
fudge 127.127.1.1 stratum 8
disable monitor
logfile /var/log/ntp/ntp.log
pidfile /var/run/ntpd.pid
driftfile /var/lib/ntp/drift
leapfile /etc/ntp.leapseconds
在 Linux 客户端上,我输入ntpdate 1.2.3.4
,然后出现错误:
5 Feb 08:26:39 ntpdate[31059]: no server suitable for synchronization found
这是为什么呢?我测试了-d
参数 ie ./ntpdate -d 1.2.3.4
,结果显示:
5 Feb 08:40:54 ntpdate[22958]: ntpdate [email protected] Mon Feb 5 10:02:23 UTC 2018 (1)
Looking for host 1.2.3.4 and service ntp
host found : 1.2.3.4
transmit(1.2.3.4)
receive(1.2.3.4)
transmit(1.2.3.4)
receive(1.2.3.4)
transmit(1.2.3.4)
receive(1.2.3.4)
transmit(1.2.3.4)
receive(1.2.3.4)
1.2.3.4: Server dropped: strata too high
server 1.2.3.4, port 123
stratum 16, precision -23, leap 11, trust 000
refid [1.2.3.4], delay 0.02573, dispersion 0.00000
transmitted 4, in filter 4
reference time: 00000000.00000000 Thu, Feb 7 2036 14:28:16.000
originate timestamp: de22269c.ab72b039 Mon, Feb 5 2018 8:41:00.669
transmit timestamp: de22269c.ab0e1fba Mon, Feb 5 2018 8:41:00.668
filter delay: 0.02579 0.02574 0.02573 0.02574
0.00000 0.00000 0.00000 0.00000
filter offset: 0.001443 0.001416 0.001417 0.001418
0.000000 0.000000 0.000000 0.000000
delay 0.02573, dispersion 0.00000
offset 0.001417
5 Feb 08:41:00 ntpdate[22958]: no server suitable for synchronization found
这是怎么回事?我该如何解决这个问题?
PS版本信息:
服务器:
[xxxx@xxxx:~]$ /usr/sbin/ntpd --version
ntpd [email protected] Mon Feb 5 10:02:23 UTC 2018 (1)
客户:
[xxxx@xxxx:~]$ ./ntpdate -v
5 Feb 08:36:40 ntpdate[15840]: ntpdate [email protected] Mon Feb 5 10:02:23 UTC 2018 (1)
5 Feb 08:36:40 ntpdate[15840]: no servers can be used, exiting