0

I need to create device (currently Raspberry Pi 3 based) which states as NTP Server, it has no connection to Internet and NTP should read actual time from local system clock (this clock is set from application). My /etc/ntp.conf is:

restrict default kod nomodify notrap nopeer noquery
restrict -6 default kod nomodify notrap nopeer noquery

restrict 127.0.0.1
restrict -6 ::1
restrict ::1

server  127.127.1.0 # local clock
fudge   127.127.1.0 stratum 1

driftfile /var/lib/ntp/ntp.drift
logfile /var/log/ntp.log

When testing connection (after service ntp restart) with ntpdate -du localhost command I get this output:

transmit(::1)
receive(::1)
transmit(127.0.0.1)
receive(127.0.0.1)
transmit(::1)
receive(::1)
transmit(127.0.0.1)
receive(127.0.0.1)
transmit(::1)
receive(::1)
transmit(127.0.0.1)
receive(127.0.0.1)
transmit(::1)
receive(::1)
transmit(127.0.0.1)
receive(127.0.0.1)
::1: Server dropped: strata too high
127.0.0.1: Server dropped: strata too high
server ::1, port 123
stratum 16, precision -20, leap 11, trust 000
refid [::1], delay 0.02573, dispersion 0.00000
transmitted 4, in filter 4
reference time:    00000000.00000000  Thu, Feb  7 2036  6:28:16.000
originate timestamp: ddbf0da9.473a860b  Tue, Nov 21 2017 20:40:09.278
transmit timestamp:  ddbf0da9.47320583  Tue, Nov 21 2017 20:40:09.278
filter delay:  0.02579  0.02573  0.02574  0.02573
         0.00000  0.00000  0.00000  0.00000
filter offset: 0.000018 -0.00001 -0.00000 -0.00001
         0.000000 0.000000 0.000000 0.000000
delay 0.02573, dispersion 0.00000
offset -0.000011

server 127.0.0.1, port 123
stratum 16, precision -20, leap 11, trust 000
refid [127.0.0.1], delay 0.02570, dispersion 0.00000
transmitted 4, in filter 4
reference time:    00000000.00000000  Thu, Feb  7 2036  6:28:16.000
originate timestamp: ddbf0da9.7a812105  Tue, Nov 21 2017 20:40:09.478
transmit timestamp:  ddbf0da9.7a7990a1  Tue, Nov 21 2017 20:40:09.478
filter delay:  0.02571  0.02570  0.02570  0.02570
         0.00000  0.00000  0.00000  0.00000
filter offset: -0.00000 -0.00001 -0.00001 -0.00001
         0.000000 0.000000 0.000000 0.000000
delay 0.02570, dispersion 0.00000
offset -0.000013

21 Nov 20:40:09 ntpdate[1181]: no server suitable for synchronization found

What am I doing wrong? Why ntp does not get time from system clock?

  • 1
    Hello MarcinZdunek. Please add output of ntpq -np to your question so we can see what's going on. Using ntpdate for debugging is of little use I'm afraid. – roaima Nov 22 '17 at 7:58
0

Since the server statement does not include the iburst keyword, ntpd may take a few minutes to sync with a timesource after it's been restarted. During that time, the answers it gives to other servers are identified as unreliable.

Yes, even when it's effectively syncing with itself.

In the ntpdate -d output, the stratum 16, precision -20, leap 11 means ntpd thinks "I'm not ready to provide time service to any others right now."

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.