Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enable ntp dhcp option in kea #593

Open
sarcasticadmin opened this issue Mar 15, 2023 · 5 comments
Open

enable ntp dhcp option in kea #593

sarcasticadmin opened this issue Mar 15, 2023 · 5 comments

Comments

@sarcasticadmin
Copy link
Member

sarcasticadmin commented Mar 15, 2023

Description

Blocked by: #592

Now that we have a ntp service lets define the correct dhcp option in kea so ensure that clients are getting this information.

Acceptance Criteria

  • kea serving up ntp servers via dhcp v4 & v6 options
  • tests to confirm that kea is correctly setting those options for a client
@owendelong
Copy link
Collaborator

Does this still need something? How is our Kea configuration built and where would the options need to be added? Let's do this for both v4 and v6 at the same time.

@sarcasticadmin
Copy link
Member Author

Adding some notes here about dhcpv6:

There seem to be more than one way to set NTP servers via DHCPv6: https://superuser.com/a/1766773 which calls out RFC 5908: https://www.rfc-editor.org/rfc/rfc5908.html#section-7

Kea only seems to be aware of SNTP (option 31): https://kea.readthedocs.io/en/kea-2.0.0/arm/dhcp6-srv.html#id2

We could also set both dhcp ntp options just to cover our basis: 31 & 56

@MrHamel
Copy link
Contributor

MrHamel commented Jun 1, 2024

Hijacking this due to the RPi systemd-timesyncd delay issues when booting NixOS. Let's do that.

It seems very simple to add: (existing v4)

"name": "ntp-servers",
, (where V6 additions need to go)
"name": "dns-servers",

Signs is a v6 only network:

VLAN cfSigns 507 2001:470:f026:507::/64 0.0.0.0/0 Signs network (Conference Center) IPv6 Only
+
VLAN exSigns 107 2001:470:f026:107::/64 0.0.0.0/0 Signs network (Expo Center) IPv6 Only

The Pi solution would be to either hard code the NTP server IPs into their config, update the Kea config with the applicable v6 core IPs + get the RPi config to ignore the built-in list and use DHCP https://nixos.wiki/wiki/NTP.

@MrHamel
Copy link
Contributor

MrHamel commented Jun 1, 2024

https://wiki.archlinux.org/title/systemd-timesyncd#Configuration

Per the documentation, this is the order for NTP server list:

Further to the daemon configuration, NTP servers may also be provided via a systemd-networkd configuration with a NTP= option or, dynamically, via a DHCP server.

The NTP server to be used will be determined using the following rules:

  • Any per-interface NTP servers obtained from systemd-networkd.service(8) configuration or via DHCP take precedence.
  • The NTP servers defined in /etc/systemd/timesyncd.conf will be appended to the per-interface list at runtime and the daemon will contact the servers in turn until one is found that responds.
  • If no NTP server information is acquired after completing those steps, the NTP server host names or IP addresses defined in FallbackNTP= will be used.

Errata: According to the big cheese, it checks one server at a time (i.e no parallelism), so it's crucial that the first server be up for a quick RPi boot. -- systemd/systemd#19494 (comment)

An option around that if performance is important, is to ditch systemd-timesyncd for chrony, which would be forced to use hardcoded servers, and for backup it has a pool config option which allows it to discover and automatically maintain 2-16 servers from pool.ntp.org (more information at https://chrony-project.org/doc/4.1/chrony.conf.html).

If DHCP is a must for the RPi's we could pull off something like systemd/systemd#19230 (comment). The "if" is important, because I want to be sure chrony will attempt to sync in parallel, and whatever responds, wins that initial sync.

@owendelong
Copy link
Collaborator

owendelong commented Jun 1, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants