[WIP] dhcp[46]: Support custom options#262
Conversation
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 <david@hardeman.nu>
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 <david@hardeman.nu>
|
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) | |
There was a problem hiding this comment.
I guess a new example is better now we have RFC4833 support? :)
There was a problem hiding this comment.
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.
|
Hi @Alphix , I'm not a network expert but regular user. This PR seems support set custom option on interface only? The dnsmasq have |
It's very early days, but yes, in the future the idea is that custom options will be available on a per-interface and per-static-lease basis. I don't expect this to be ready for 25.12 though, more likely material for the release after that. |
This adds more feature parity with
dnsmasqby 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.