Zeitsync funktioniert nicht

Hallo zusammen,

Ich habe zu dem Thema schon viele Artikel in diesem Forum gelesen und die möglichen Ursachen meines Problems daraufhin abgeklopft, bin aber leider zu keiner Lösung gekommen.

Ich habe bei einem LM7.2-Server mit Windows 11 Clients das Problem, dass die Clients die Zeit unter Windows anscheinend nicht mit dem LM7.2-AD abgleichen. Die Clients driften driften daher teilweise mehrere Stunden ab, in jedem Fall mehr als die 5-Minuten-Tolleranz für AD/GPOs

Ein manuelles Setzen der Zeit per „net time /set /y“ funktioniert tadellos. Danach sind die Clients wieder synchron mit dem Server. Das ist aber ein unschöner Workaround mit dem Holzhammer.

Das Synchronisieren mit m32tm funktioniert dagegen anscheinend nicht.

Ich habe momentan keine Idee mehr, wo ich noch suchen kann. Ich würde mich sehr freuen, wenn mal jemand auf die folgenden Meldungen und Konfigs schauen könnte.

Herzlichen Dank im Voraus und beste Grüße,
Tom

Die Ausgaben eines Win11-Clients (der Printserver mit Win Server 2022 in der Domäne bringt übrigens das gleiche Ergebnis) als Domain-Admin mit w32tm:

w32tm /resync /rediscover
Befehl zum erneuten Synchronisieren wird an den lokalen Computer gesendet.
Der Computer wurde nicht synchronisiert, da keine Zeitdaten verfügbar waren.

w32tm /resync /force
Befehl zum erneuten Synchronisieren wird an den lokalen Computer gesendet.
Der Computer wurde nicht synchronisiert, da keine Zeitdaten verfügbar waren.

w32tm /query /status
Sprungindikator: 3(nicht synchronisiert)
Stratum: 0 (nicht angegeben)
Präzision: -23 (119.209ns pro Tick)
Stammverzögerung: 0.0000000s
Stammabweichung: 0.0000000s
Referenz-ID: 0x00000000 (nicht angegeben)
Letzte erfolgr. Synchronisierungszeit: nicht angegeben
Quelle: Local CMOS Clock
Abrufintervall: 10 (1024s)

w32tm /stripchart /computer:server
server wird verfolgt [172.17.0.1:123].
Es ist 27.11.2025 10:10:22.
10:10:22, d:+00.0006295s o:-02.1164002s  [                     *     |                           ]
10:10:24, d:+00.0010025s o:-02.1165061s  [                     *     |                           ]
10:10:26, d:+00.0012307s o:-02.1164810s  [                     *     |                           ]
10:10:28, d:+00.0007129s o:-02.1165073s  [                     *     |                           ]
10:10:30, d:+00.0011189s o:-02.1166108s  [                     *     |                           ]
10:10:32, d:+00.0012167s o:-02.1166635s  [                     *     |                           ]
10:10:34, d:+00.0010936s o:-02.1166451s  [                     *     |                           ]
10:10:36, d:+00.0011711s o:-02.1167091s  [                     *     |                           ]
10:10:38, d:+00.0009326s o:-02.1167351s  [                     *     |                           ]
10:10:40, d:+00.0005493s o:-02.1166942s  [                     *     |                           ]
10:10:42, d:+00.0010133s o:-02.1167837s  [                     *     |                           ]
10:10:44, d:+00.0009858s o:-02.1168836s  [                     *     |                           ]
10:10:46, d:+00.0010677s o:-02.1169751s  [                     *     |                           ]
10:10:48, d:+00.0007091s o:-02.1168481s  [                     *     |                           ]
10:10:50, d:+00.0010757s o:-02.1170376s  [                     *     |                           ]
10:10:52, Fehler: 0x800705B4
10:10:55, Fehler: 0x800705B4
10:10:58, Fehler: 0x800705B4

Ich habe auf dem Server schon das Reparatur-Script für die Dateirechte von NTP laufen lassen:
sudo /usr/share/linuxmuster/fix-ntp_signd-dir.sh

 ls -al /var/lib/samba/ntp_signd/
total 8
drwxr-x--- 2 root ntp  4096 Nov 27 09:07 .
drwxr-xr-x 9 root root 4096 Nov 27 09:07 ..
srwxrwxrwx 1 root root    0 Nov 27 09:07 socket

NTP läuft auf dem Server:

systemctl status ntp.service
● ntp.service - Network Time Service
     Loaded: loaded (/lib/systemd/system/ntp.service; enabled; vendor preset: enabled)
     Active: active (running) since Thu 2025-11-27 09:08:58 UTC; 34min ago
       Docs: man:ntpd(8)
    Process: 94937 ExecStart=/usr/lib/ntp/ntp-systemd-wrapper (code=exited, status=0/SUCCESS)
   Main PID: 94943 (ntpd)
      Tasks: 2 (limit: 38378)
     Memory: 1.5M
        CPU: 288ms
     CGroup: /system.slice/ntp.service
             └─94943 /usr/sbin/ntpd -p /var/run/ntpd.pid -g -u 113:117

Nov 27 09:08:58 server.groeben.lan ntpd[94943]: Listen and drop on 0 v6wildcard [::]:123
Nov 27 09:08:58 server.groeben.lan ntpd[94943]: Listen and drop on 1 v4wildcard 0.0.0.0:123
Nov 27 09:08:58 server.groeben.lan ntpd[94943]: Listen normally on 2 lo 127.0.0.1:123
Nov 27 09:08:58 server.groeben.lan ntpd[94943]: Listen normally on 3 ens18 172.17.0.1:123
Nov 27 09:08:58 server.groeben.lan ntpd[94943]: Listen normally on 4 lo [::1]:123
Nov 27 09:08:58 server.groeben.lan ntpd[94943]: Listen normally on 5 ens18 [fe80::20c:29ff:fedf:13e9%2]:123
Nov 27 09:08:58 server.groeben.lan ntpd[94943]: Listening on routing socket on fd #22 for interface updates
Nov 27 09:08:58 server.groeben.lan ntpd[94943]: kernel reports TIME_ERROR: 0x41: Clock Unsynchronized
Nov 27 09:08:58 server.groeben.lan ntpd[94943]: kernel reports TIME_ERROR: 0x41: Clock Unsynchronized
Nov 27 09:08:58 server.groeben.lan systemd[1]: Started Network Time Service.

netstat -lnp | grep 123
udp        0      0 172.17.0.1:123          0.0.0.0:*                           94943/ntpd
udp        0      0 127.0.0.1:123           0.0.0.0:*                           94943/ntpd
udp        0      0 0.0.0.0:123             0.0.0.0:*                           94943/ntpd
udp6       0      0 fe80::20c:29ff:fedf:123 :::*                                94943/ntpd
udp6       0      0 ::1:123                 :::*                                94943/ntpd
udp6       0      0 :::123                  :::*                                94943/ntpd

Hier unsere /etc/ntp.conf:


# modified by linuxmuster-setup at 20210929124117
# /etc/ntp.conf
#
# Don't edit this file!!!
# Add your stuff in /etc/ntp.conf.admin.
#
# thomas@linuxmuster.net
# 20200911
#
# configuration for ntpd; see ntp.conf(5) for help

driftfile /var/lib/ntp/ntp.drift
statistics loopstats peerstats clockstats
filegen loopstats file loopstats type day enable
filegen peerstats file peerstats type day enable
filegen clockstats file clockstats type day enable
server 172.17.0.254 iburst prefer
restrict -4 default kod notrap nomodify nopeer noquery limited mssntp
restrict -6 default kod notrap nomodify nopeer noquery limited mssntp
restrict 127.0.0.1
restrict ::1
restrict source notrap nomodify noquery
ntpsigndsocket /var/lib/samba/ntp_signd/

und die apparmor-Konfig /etc/apparmor.d/usr.sbin.ntpd

# vim:syntax=apparmor
# Updated for Ubuntu by: Jamie Strandboge <jamie@canonical.com>
# ------------------------------------------------------------------
#
#    Copyright (C) 2002-2005 Novell/SUSE
#    Copyright (C) 2009-2012 Canonical Ltd.
#
#    This program is free software; you can redistribute it and/or
#    modify it under the terms of version 2 of the GNU General Public
#    License published by the Free Software Foundation.
#
# ------------------------------------------------------------------

#include <tunables/global>
#include <tunables/ntpd>
/usr/sbin/ntpd flags=(attach_disconnected) {
  #include <abstractions/base>
  #include <abstractions/nameservice>
  #include <abstractions/user-tmp>

  capability ipc_lock,
  capability net_bind_service,
  capability setgid,
  capability setuid,
  capability sys_chroot,
  capability sys_resource,
  capability sys_time,
  capability sys_nice,

  # ntp uses AF_INET, AF_INET6 and AF_UNSPEC
  network dgram,
  network stream,

  @{PROC}/net/if_inet6 r,
  @{PROC}/*/net/if_inet6 r,
  @{NTPD_DEVICE} rw,
  # pps devices are almost exclusively used with NTP
  /dev/pps[0-9]* rw,

  /{,s}bin/      r,
  /usr/{,s}bin/  r,
  /usr/local/{,s}bin/  r,
  /usr/sbin/ntpd rmix,

  /etc/ntp.conf r,
  /etc/ntp.conf.dhcp r,
  /etc/ntpd.conf r,
  /etc/ntpd.conf.tmp r,
  /run/ntp.conf.dhcp r,

  /etc/ntp.keys r,
  /etc/ntp/** r,

  /etc/ntp.drift rwl,
  /etc/ntp.drift.TEMP rwl,
  /etc/ntp/drift* rwl,
  /var/lib/ntp/*drift rw,
  /var/lib/ntp/*drift.TEMP rw,

  /var/log/ntp w,
  /var/log/ntp.log w,
  /var/log/ntpd w,
  /var/log/ntpstats/clockstats* rwl,
  /var/log/ntpstats/loopstats*  rwl,
  /var/log/ntpstats/peerstats*  rwl,
  /var/log/ntpstats/protostats* rwl,
  /var/log/ntpstats/rawstats*   rwl,
  /var/log/ntpstats/sysstats*   rwl,

  /{,var/}run/ntpd.pid w,

  # to be able to check for running ntpdate
  /run/lock/ntpdate wk,

  # samba4 ntp signing socket
  /{,var/}lib/samba/ntp_signd/socket rw,

  # samba4 winbindd pipe
  /run/samba/winbindd/pipe rw,

  # For use with clocks that report via shared memory (e.g. gpsd),
  # you may need to give ntpd access to all of shared memory, though
  # this can be considered dangerous. See https://launchpad.net/bugs/722815
  # for details. To enable, add this to local/usr.sbin.ntpd:
  #     capability ipc_owner,

  # Site-specific additions and overrides. See local/README for details.
  #include <local/usr.sbin.ntpd>

Hi,

Windows-Clients dürfen bei deiner ntpd-Konfiguration keine NTP-Antworten erhalten, weil noquery im restrict default die Option noquery aktiv hat und es im weiteren Verlauf der Konfiguration keine explizite Ausnahme für das Client-Netz gibt. Dir fehlt also mindestens eine weitere Zeile mit restrict, bspw. so:

restrict 172.17.0.0 mask 255.255.0.0 nomodify notrap mssntp

mssntp ist für signierten NTP und könnte mittlerweile wichtig für Windows in AD-Umgebungen sein (von mir ungetestet).

VG
Buster

1 „Gefällt mir“

Hallo Buster,

danke für den Tipp. Ich weiß nicht woher die Restriktion mit dem noquery in der ntp.conf kommt. Ich hatte die ntp.conf am Linuxmuster-Server bisher nie anpassen müssen.
Ich werde es gleich nächste Woche ausprobieren.

Danke und beste Grüße,
Tom