Skip to content

Keav4: Allow setting option 43 data for subnets#9860

Closed
Holladiewal wants to merge 4 commits intoopnsense:masterfrom
Holladiewal:option-43-raw
Closed

Keav4: Allow setting option 43 data for subnets#9860
Holladiewal wants to merge 4 commits intoopnsense:masterfrom
Holladiewal:option-43-raw

Conversation

@Holladiewal
Copy link
Copy Markdown

This idea is based on #7361, and I am aware of concerns and issues regarding complexity and client-classes raised in that PR.

However I think offering the ability to set option 43 data is still important, even if there is no hand-holding by the UI to get the right values and not caring about client-classes.
If a client wants some option 43 data, there is only on set of data to choose from per subnet.

This PR allows just that: Setting the value delivered to the clients.
Nothing more, nothing less.

This could be expanded by offering help encoding values (for example encoding an ASCII-String into a hex-string).

Below is a picture of config and outcome (I had to set "always-send" so ubuntu would get the option. That should probably be exposed as a checkbox to the user):
grafik

This allows setting a raw data value for the IPv4 DHCP option 43
There is minimal validation in place (it must look like a hex string)

There will be no help encoding the value, we expect a fully compliant TLV-String
@AdSchellevis AdSchellevis self-assigned this Feb 26, 2026
@AdSchellevis
Copy link
Copy Markdown
Member

Preferably I need some people to test this before merging, @Holladiewal can you ask people in the other PR to test yours? I'll keep this open for a bit to collect feedback.

Kea seems to be quite picky about the suboptions being in order.
This is most likely an issue, since we do not use the kea interface to build up the option,
but rather specifying the data ourselves.

For now, there is a hint in the help text reminding the operator.
This reverts commit f3b062e.

Actually, kea is smart enough to figure it out and reorders the options,
so they are in order. I do not see anything in the RFC mention they _have_
to be in order, but it makes everybodies job easier in parsing if they are.
If we can set the option for the subnet, we should also be able to set it for a reservation.
@Holladiewal
Copy link
Copy Markdown
Author

Had the chance to do some testing of my own:

Contrary to most things, Kea actually seems to be quite content with getting some malformed data in its config.

Options that are too short are not sent:
option-too-short

Options that are longer than specified are truncated to the proper length:
option-too-long

Options specified out of order are being reordered (config order is "f1, f3, f2" and options are sent as "f1,f2,f3"):
two-options-reordered

So far, I haven't found a way to make Kea not start up based on the user input.
It might not work as expected if the operator makes a mistake, but at least the service doesn't fall over and refuse to work.

@Monviech
Copy link
Copy Markdown
Member

@Holladiewal The hint about csv-format false is very good. I think this could be generalized for all options.

We might be able to solve the whole subset of problems with such an approach, but since KEA is weird we also might not. But I will investigate this here:

#9942

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants