0

I want to let my Linux device synchronize its local time with the local time of another Linux server without any other references. I don't care about the actual time. I want my fake time. Therefore I don't need any other ntp servers for reference. For example I just set the local time of my Linux server 1.2.3.4 to 2033-02-23 15:23:10. I want to let my Linux device synchronize this time. The config file /etc/ntp.conf on the Linux server is:

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

On the Linux client, I type ntpdate 1.2.3.4, and then it gives me error:

 5 Feb 08:26:39 ntpdate[31059]: no server suitable for synchronization found

Why is that? I have tested the -d parameter, i.e. ./ntpdate -d 1.2.3.4, and it says:

 5 Feb 08:40:54 ntpdate[22958]: ntpdate 4.2.8p10@1.3728-o 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

What is wrong with it? How can I solve this problem?


P.S. version information:

server:

[xxxx@xxxx:~]$ /usr/sbin/ntpd --version
ntpd 4.2.8p10@1.3728-o Mon Feb  5 10:02:23 UTC 2018 (1)

client:

[xxxx@xxxx:~]$ ./ntpdate -v
 5 Feb 08:36:40 ntpdate[15840]: ntpdate 4.2.8p10@1.3728-o Mon Feb  5 10:02:23 UTC 2018 (1)
 5 Feb 08:36:40 ntpdate[15840]: no servers can be used, exiting
1

If you don't use the iburst option on the server configuration line, it typically takes a few minutes after start-up for ntpd to sync with a reference clock. This is true with local clock driver too, as it is not treated as "special": it gets all the same checks as any other time source before its information is applied to ntpd's internal model of time.

If ntpd receives NTP requests before it has achieved initial synchronization, it will answer with stratum 16 and leap indicator set to 11 (= error) - and that is exactly what you are seeing.

  • Do you mean I need to use server 127.127.1.1 iburst ? – Victor Feb 6 '18 at 1:58
  • Either that, or wait a few minutes after starting ntpd before testing it. You can also run ntpq -np and verify that there is an asterisk in the very first column of the listing: if that asterisk isn't there, ntpd thinks it's out of sync and won't serve out any time information. – telcoM Feb 6 '18 at 7:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.