Debian deprecated the old ntpd package anymore and is instead now using https://ntpsec.org/
I was using the old ntpd to provide a local timeserver in a docker container. This docker container is not connected to the internet nor to any other timeservers. It should act as a timeserver for local devices in it's network.
When I used the now deprecated ntpd for this, I had to set fudge 127.127.1.1 stratum 8 to set the stratum to 8. Because the server could not get it's time from another server, it's stratum was 0. When the client tried to synchronize the time it got an answer but did not accept it.
Now with ntpsec this does not seem to work anymore. I do
root@e2d0c2489be9:/# tcpdump -n -c 2 -v
on the ntp server. When I restart sytemd-timesyncd on the client using
systemctl restart systemd-timesyncd
I get this output from tcpdump on the server
tcpdump: listening on eth0, link-type EN10MB (Ethernet), snapshot length 262144 bytes
14:18:52.564299 IP (tos 0x10, ttl 64, id 55918, offset 0, flags [DF], proto UDP (17), length 76)
192.168.1.81.33587 > 192.168.1.193.123: NTPv4, Client, length 48
Leap indicator: (0), Stratum 0 (unspecified), poll 0 (1s), precision 0
Root Delay: 0.000000, Root dispersion: 0.000000, Reference-ID: (unspec)
Reference Timestamp: 0.000000000
Originator Timestamp: 0.000000000
Receive Timestamp: 0.000000000
Transmit Timestamp: 3907837176.154516687 (2023-11-01T14:19:36Z)
Originator - Receive Timestamp: 0.000000000
Originator - Transmit Timestamp: 3907837176.154516687 (2023-11-01T14:19:36Z)
14:18:52.564480 IP (tos 0xb8, ttl 64, id 43066, offset 0, flags [DF], proto UDP (17), length 76)
192.168.1.193.123 > 192.168.1.81.33587: NTPv4, Server, length 48
Leap indicator: clock unsynchronized (192), Stratum 0 (unspecified), poll 0 (1s), precision -23
Root Delay: 0.000000, Root dispersion: 0.000137, Reference-ID: (unspec)
Reference Timestamp: 0.000000000
Originator Timestamp: 3907837176.154516687 (2023-11-01T14:19:36Z)
Receive Timestamp: 3907837132.564299408 (2023-11-01T14:18:52Z)
Transmit Timestamp: 3907837132.564463209 (2023-11-01T14:18:52Z)
Originator - Receive Timestamp: -43.590217279
Originator - Transmit Timestamp: -43.590053478
Although the docs of ntpsec mention that old way configuration should still work, apparently it does not. (https://docs.ntpsec.org/latest/ntpsec.html#configuration)
I found this instead: https://docs.ntpsec.org/latest/driver_local.html But putting
refclock local stratum 8
into the file /etc/ntpsec/ntp.conf does not work either. I get the some output of tcpdump like above.
Expected outcome:
Setting refclock local stratum 8 in ntp.conf sets the stratum to 8