Skip to content

Conversation

@Alphix
Copy link
Contributor

@Alphix Alphix commented Oct 1, 2025

This adds more feature parity with dnsmasq by allowing custom DHCPv4/DHCPv6 options to be set.

WIP so far, needs more testing and the option parsing could be merged for the v4/v6 cases.

@Alphix Alphix changed the title dhcp[46]: Support custom options [WIP] dhcp[46]: Support custom options Oct 1, 2025
Alphix added 2 commits October 3, 2025 17:55
This adds support for custom DHCPv6 options, similar to what dnsmasq supports
via "--dhcp-option".  Currently, only one type of option data is supported, and
that is a hexadecimal string defining the exact content of the option. More
variants can always be added later.

In other words: the full range of option formats supported by dnsmasq is *not*
supported, but this feature is a bit of a niche feature, so this initial
support is hopefully still useful.

Signed-off-by: David Härdeman <[email protected]>
This adds support for custom DHCPv4 options in the same manner as the previous
patch which added support for custom DHCPv6 options.

Signed-off-by: David Härdeman <[email protected]>
@Alphix
Copy link
Contributor Author

Alphix commented Oct 26, 2025

For anyone who comes across this PR: I will substantially rework it once a bunch of other PRs have landed. I'm keeping the draft PR here as a placeholder and to let ppl know that it will land at some point.

| dhcpv6_na |bool | 1 | DHCPv6 stateful addressing hands out IA_NA - Internet Address - Network Address |
| dhcpv6_pd |bool | 1 | DHCPv6 stateful addressing hands out IA_PD - Internet Address - Prefix Delegation |
| dhcpv6_pd_min_len |integer| - | Minimum prefix length to delegate with IA_PD (value is adjusted if needed to be greater than the interface prefix length). Range [1,62] |
| dhcpv6_option |list | - | Custom DHCPv6 options in the form of strings formatted as `<optcode>,<encoding>:<data>`. For example: `42,hex:4575726F70652F4265726C696E` (timezone = "Europe/Berlin", RFC4833, §3) |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess a new example is better now we have RFC4833 support? :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haha...yes...but don't waste time on reviewing this in detail just yet...I have a much more comprehensive idea in mind, it needs some more time though.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants