From 4a78eccd90dc9fd1fd982e1a1e6f7e2448dad79f Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Tue, 21 Jul 2026 22:38:48 +0200 Subject: [PATCH] luci-proto-ipv6: dhcpv6: add option to select the DHCPv6 client ID OpenWrt gained a per-interface "sendclientid" option which overrides the preferred DUID used for DHCPv6 requests. Expose it in the advanced settings of the DHCPv6 client protocol: - "auto" (default) uses the explicitly configured client ID, or falls back to the global default DUID and finally a DUID-LL derived from the interface MAC address - "global" always uses the global default DUID - "hardware" passes no client ID to odhcp6c, so a type 3 DUID-LL is used Unlike DHCPv4 there is no "none" mode, as odhcp6c always sends a client identifier. The explicit client ID is only evaluated in "auto" mode, hence it now depends on that setting. Assisted-by: Claude:claude-opus-4-8 Signed-off-by: Hauke Mehrtens --- .../htdocs/luci-static/resources/protocol/dhcpv6.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/protocols/luci-proto-ipv6/htdocs/luci-static/resources/protocol/dhcpv6.js b/protocols/luci-proto-ipv6/htdocs/luci-static/resources/protocol/dhcpv6.js index ed2d399900..c072155fef 100644 --- a/protocols/luci-proto-ipv6/htdocs/luci-static/resources/protocol/dhcpv6.js +++ b/protocols/luci-proto-ipv6/htdocs/luci-static/resources/protocol/dhcpv6.js @@ -38,7 +38,18 @@ return network.registerProtocol('dhcpv6', { o.default = '1'; o.rmempty = false; + o = s.taboption('advanced', form.ListValue, 'sendclientid', _('Preferred client ID'), + _('Selects the DUID to send when requesting DHCPv6.') + '
' + + _('Automatic uses the client ID configured below, else the default DUID of this device, else a DUID-LL derived from the MAC address of this interface.') + '
' + + _('Default DUID always uses the default DUID of this device, even if a client ID is configured below.') + '
' + + _('Hardware address always uses a DUID-LL derived from the MAC address of this interface.')); + o.value('auto', _('Automatic')); + o.value('global', _('Default DUID')); + o.value('hardware', _('Hardware address')); + o.default = 'auto'; + o = s.taboption('advanced', form.Value, 'clientid', _('Client ID to send when requesting DHCP')); o.datatype = 'hexstring'; + o.depends('sendclientid', 'auto'); } });