Why the NTP service systemd-timesyncd is not able to synchronize to an offline NTP Server?
2
votes
1
answer
59
views
### Configuration of
systemd-timesyncd
###
On my linux distribution I'm using the NTP client systemd-timesyncd
. Its configuration file (/etc/systemd/timesyncd.conf
) is:
[Time]
NTP=192.168.127.11
FallbackNTP=192.168.127.11
#RootDistanceMaxSec=5
#PollIntervalMinSec=32
#PollIntervalMaxSec=2048
where 192.168.127.11
is the IP address of a Lubuntu workstation where is installed the package ntp
. The Lubuntu workstation is **offline** (it is not connected to any other host other than the linux distribution where is in execution the systemd-timesyncd
client).
### NTP Server configuration ###
The Lubuntu workstation (ip address 192.168.127.201
) executes the service ntpsec.service
with the following configuration file /etc/ntpsec/ntp.conf
:
# /etc/ntpsec/ntp.conf, configuration for ntpd; see ntp.conf(5) for help
driftfile /var/lib/ntpsec/ntp.drift
leapfile /usr/share/zoneinfo/leap-seconds.list
# This should be maxclock 7, but the pool entries count towards maxclock.
tos maxclock 11
# Comment this out if you have a refclock and want it to be able to discipline
# the clock by itself (e.g. if the system is not connected to the network).
#tos minclock 4 minsane 3
# Specify one or more NTP servers.
# Public NTP servers supporting Network Time Security:
# server time.cloudflare.com nts
# Use servers from the NTP Pool Project. Approved by Ubuntu Technical Board
# on 2011-02-08 (LP: #104525). See https://www.pool.ntp.org/join.html for
# more information.
#pool 0.ubuntu.pool.ntp.org iburst
#pool 1.ubuntu.pool.ntp.org iburst
#pool 2.ubuntu.pool.ntp.org iburst
#pool 3.ubuntu.pool.ntp.org iburst
# Use Ubuntu's ntp server as a fallback.
#server ntp.ubuntu.com
server 127.127.1.0
fudge 127.127.1.0 stratum 1
# By default, exchange time with everybody, but don't allow configuration.
restrict default kod nomodify nopeer noquery limited
# Local users may interrogate the ntp server more closely.
restrict 127.0.0.1
restrict ::1
### systemd-timesyncd
is in Idle ###
systemd-timesyncd
client is in the "Idle" Status
as showed by the following output message:
systemd-timesyncd.service - Network Time Synchronization
Loaded: loaded (/lib/systemd/system/systemd-timesyncd.service; disabled; vendor preset: disabled)
Active: active (running) since Thu 2025-07-10 10:28:13 CEST; 7min ago
Docs: man:systemd-timesyncd.service(8)
Main PID: 71449 (systemd-timesyn)
Status: "Idle."
Tasks: 2 (limit: 2199)
Memory: 860.0K
CGroup: /system.slice/systemd-timesyncd.service
└─71449 /lib/systemd/systemd-timesyncd
Jul 10 10:28:12 systemd: Starting Network Time Synchronization...
Jul 10 10:28:13 systemd: Started Network Time Synchronization.
### Wireshark captured ###
By Wireshark I can see that client and server exchange some datagrams. In the response datagram of the Server I can see the following information:
Frame 4379: 90 bytes on wire (720 bits), 90 bytes captured (720 bits) on interface 0
Ethernet II, Src: (), Dst: ()
Internet Protocol Version 4, Src: 192.168.127.11, Dst: 192.168.127.201
User Datagram Protocol, Src Port: 123, Dst Port: 45358
Network Time Protocol (NTP Version 4, server)
Flags: 0xe4, Leap Indicator: unknown (clock unsynchronized), Version number: NTP Version 4, Mode: server
11.. .... = Leap Indicator: unknown (clock unsynchronized) (3)
..10 0... = Version number: NTP Version 4 (4)
.... .100 = Mode: server (4)
Peer Clock Stratum: unspecified or invalid (0)
Peer Polling Interval: invalid (0)
Peer Clock Precision: 0,000000 sec
Root Delay: 0 seconds
Root Dispersion: 0,0037841796875 seconds
Reference ID: (Initialization)
Reference Timestamp: Jan 1, 1970 00:00:00.000000000 UTC
Origin Timestamp: Jul 10, 2025 09:07:50.163961034 UTC
Receive Timestamp: Jul 10, 2025 09:14:44.087945767 UTC
Transmit Timestamp: Jul 10, 2025 09:14:44.088197457 UTC
In this captured datagram I would highlight the Flags byte=0xe4
and in particular the 2 bits:
11.. .... = Leap Indicator: unknown (clock unsynchronized) # in the Flags byte
Furthermore I highlight the 2 bytes (equal to 0):
Peer Clock Stratum: unspecified or invalid (0)
Peer Polling Interval: invalid (0)
I have noted that with an other NTP server the byte Peer Clock Stratum
is equal to 1
and the client is able to synchronize its date and time.
### Question ###
Why in my context the service systemd-timesyncd
is not able to synchronize to my offline NTP Server?
### links read but not useful ###
I have checked many posts (for example [this link](https://unix.stackexchange.com/questions/323348/ntp-client-not-synchronizing-from-a-private-ntp-server) or [this other](https://unix.stackexchange.com/questions/714732/system-clock-not-synchronized-with-ntp-server-using-systemd-timesyncd)) but none of these have been useful.
Asked by User051209
(498 rep)
Jul 10, 2025, 09:34 AM
Last activity: Jul 11, 2025, 04:36 PM
Last activity: Jul 11, 2025, 04:36 PM