opnsense / core

OPNsense GUI, API and systems backend
https://opnsense.org/
BSD 2-Clause "Simplified" License
3.07k stars 700 forks source link

Kea: support hub and spoke HA configurations #7528

Open mvglasow opened 1 week ago

mvglasow commented 1 week ago

Important notices

Before you add a new report, we ask you kindly to acknowledge the following:

Is your feature request related to a problem? Please describe.

Kea allows hub and spoke HA setups, as described in chapter 6.12.19 of the Administrator’s Reference Manual: The server has multiple HA relationships, each with a different this-server-name attribute, a different group of HA peers, potentially a different HA mode, and managing a distinct part of the subnets configured. This is intended for setups where there is a central server acting as a fallback for multiple DHCP servers on “satellite” networks, with each of the satellite servers serving just their local network.

This setup requires two things on the central server:

The GUI currently does not seem to allow that, as it only provides a single this-server-name option, a single list of HA peers without any grouping or other distinction, and no ha-server-name for subnets.

Describe the solution you like

The solution is just a matter of exposing existing Kea functionality through the GUI:

Describe alternatives you considered

How to expose Kea functionality through the GUI is mainly a UX question. Another approach would be:

Without exposing this part of Kea functionality through the GUI, we’d be limited to workarounds:

Since multiple DHCP servers (even from different vendors) can coexist on the same network (as long as their ranges don’t overlap, each hands out a valid IP config for that network and static leases are honored in the same way), one could simply set up satellite servers as independent DHCP servers. Drawback: one needs to keep configurations in sync manually (error-prone), and there is some resource wastage since each DHCP broadcast will be answered by both servers.

One could also have all satellite servers sync the whole database with the central server. Drawback: if the satellite networks cannot communicate between each other (such as in a multi-tenant setup, where each satellite belongs to a different tenant), the setup needs to be cold-standby with the central server being the primary, else some (or even all) DHCP broadcasts from all but one satellite will go unanswered because the central server assumes a satellite server is taking care of it – the satellite server is up and running as far as the central server is concerned, but unreachable from the client’s network. Also, in such a setup, failover with multiple satellite servers may not work properly: either the new active node is reachable only from parts of the network, or multiple nodes will claim to be the active one and issues may occur when the primary returns. Not sure how Kea handles this kind of situation; the official answer is probably to use a hub and spoke configuration instead.

Additional context

Add any other context or screenshots about the feature request here or links to relevant forum thread or similar