[Networkmanager] NetworkManager handling of NTP options

mh at mike.franken.de mh at mike.franken.de
Fri Mar 10 20:50:37 UTC 2023


Hi *,

I am using systemd-timesyncd for managing the ntp server entries on my 
clients. Because NetworkManager doesn't update timesyncd.conf, I wrote a 
dispatcher script, that is doing this job. The script is using the 
DHCP[46]_NTP_SERVERS env vars, NetworkManager is providing to dispatcher 
scripts.
Everything works fine for DHCP connections, but as for my wireguard VPN 
connection this doesn't work, because there isn't any setting for ntp servers 
- at least I couldn't find one.
So I thought, I could add a static fallback entry to /etc/sysconfig/network/
config in NETCONFIG_NTP_STATIC_SERVERS. Indeed this entry is written to some 
files, for example to chrony.servers.
But I couldn't find any easy way to get that value from my dispatcher script 
besides reading NETCONFIG_NTP_STATIC_SERVERS myself. Is this really the way to 
do this or am I missing something here?
Whats more: If this static entry exists, NetworkManager is writing it to the 
above mentioned files even if it gets ntp servers from a DHCP connection. Is 
this correct?

debug: ntp-runtime Module called
debug: Resolved ntp-policy 'auto' for service 'NetworkManager' to 
'STATIC_FALLBACK NetworkManager'
debug: Static Fallback
debug: Use NetworkManager policy merged settings
debug: exec get_ntp_settings: /run/netconfig/NetworkManager.netconfig
debug:      get_ntp_settings: NTP_SERVER_LIST=''
debug: exit get_ntp_settings: /run/netconfig/NetworkManager.netconfig
debug: write_chrony_servers: 192.168.1.1
debug: ntp servers written to /run/netconfig/chrony.servers
debug: write_ntpd_servers: 192.168.1.1
debug: ntp servers written to /run/ntp/servers-netconfig



- openSUSE Tumbleweed 20230308
- NetworkManager-1.42.2-1.1.x86_64
- systemd-252.7-1.1.x86_64


TIA.

Bye.
Michael.




More information about the Networkmanager mailing list