Skip to content

Add NX-OS DHCP relay server-id-override-disable field to NX SystemSpec - #634

Merged
adamtrizuljak-sap merged 1 commit into
mainfrom
feat/dhcprelay-server-id-override-disable
Oct 13, 2026
Merged

adamtrizuljak-sap merged 1 commit into
mainfrom
feat/dhcprelay-server-id-override-disable

Conversation

@adamtrizuljak-sap

Copy link
Copy Markdown
Contributor

Why

Add a RelayServerIDOverrideDisable field to the NX System spec that configures the global command ip dhcp relay information option server-id-override-disable on NX-OS.

When DHCP relay with Option 82 is active, the relay agent overrides the Server-ID (Option 54) in relayed Requests with its own interface IP by default. The DHCP server then silently drops the Request because the Server-ID no longer matches its Offer, breaking the DORA handshake after the Offer step.

The setting is device-global in NX-OS (a scalar leaf under System/dhcp-items/inst-items), so it lives on the System CRD rather than the per-interface DHCPRelay CRD. EnsureSystemSettings maps the bool to the 0..1 leaf and enables the dhcp feature when the toggle is on; ResetSystemSettings replaces the leaf with its platform default. Idempotency comes from the gnmiext get-and-check layer.

Design notes

  • Why System and not DHCPRelay: the command maps to a device-global DME leaf (System/dhcp-items/inst-items/…), while DHCPRelayis a per-interface CRD (a device can have several). Routing a global setting through a per-interface provider config would let relays fight over one value with no clean delete/refcount, so it belongs on the device-globalSystem` CRD. No system-wide DHCP config surface existed before this change.
  • Feature dependency: the command requires feature dhcp. EnsureSystemSettings now enables it automatically when the toggle is on. On reset the feature is left in place, since DHCP relay may still be using it.
  • Idempotency: the new leaf is Defaultable (platform default 0), so the gnmiext get-and-check layer skips the gNMI Set on steady state, and reset becomes a replace-with-default rather than a path delete (which can't disturb the sibling per-interface relay config).

Changes

  • API: RelayServerIDOverrideDisable bool on SystemSpec (api/cisco/nx/v1alpha1/system_types.go).
  • Provider: new DHCPRelayServerIDOverrideDisable gNMI data element; EnsureSystemSettings / ResetSystemSettingsrealize and reset it; introduced aFeatureDHCPconstant (replacing a raw"dhcp"` literal).
  • Regenerated CRD, Helm chart CRD.
  • Added a serialization test + fixture, updated the System sample, and wired the sample into the Tiltfile.

Testing

  • make fmt lint test all pass (envtest).
  • New Test_Payload/dhcprelayserveridoverride verifies the leaf payload.

Tested against a simulated Cisco N9K-C9300v in Clabernetes using the provided System sample.

spec.relayServerIdOverrideDisable: true

% gnmic -a 127.0.0.1 --port 9339 -u *** -p *** --skip-verify get -e json --values-only --path 'System/dhcp-items/inst-items/relayInformationOptionServerIdOverrideDisableEnabled'
[
  1
]

spec.relayServerIdOverrideDisable: false

% gnmic -a 127.0.0.1 --port 9339 -u *** -p *** --skip-verify get -e json --values-only --path 'System/dhcp-items/inst-items/relayInformationOptionServerIdOverrideDisableEnabled'
[
  0
]

Add a RelayServerIDOverrideDisable field to the NX System spec that
configures the global command "ip dhcp relay information option
server-id-override-disable" on NX-OS.

When DHCP relay with Option 82 is active, the relay agent overrides
the Server-ID (Option 54) in relayed Requests with its own interface
IP by default. The DHCP server then silently drops the Request
because the Server-ID no longer matches its Offer, breaking the DORA
handshake after the Offer step.

The setting is device-global in NX-OS (a scalar leaf under
System/dhcp-items/inst-items), so it lives on the System CRD rather
than the per-interface DHCPRelay CRD. EnsureSystemSettings maps the
bool to the 0..1 leaf and enables the dhcp feature when the toggle is
on; ResetSystemSettings replaces the leaf with its platform default.
Idempotency comes from the gnmiext get-and-check layer.

Signed-off-by: Adam Trizuljak <adam.trizuljak@sap.com>
@adamtrizuljak-sap
adamtrizuljak-sap force-pushed the feat/dhcprelay-server-id-override-disable branch from 3e460e9 to 4feb166 Compare October 12, 2026 15:11
@github-actions

Copy link
Copy Markdown

Merging this branch changes the coverage (1 decrease, 3 increase)

Impacted Packages Coverage Δ 🤖
github.com/ironcore-dev/network-operator/api/cisco/nx/v1alpha1 0.00% (ø)
github.com/ironcore-dev/network-operator/internal/controller/cisco/nx 63.91% (+0.35%) 👍
github.com/ironcore-dev/network-operator/internal/controller/evpn 81.65% (+1.95%) 👍
github.com/ironcore-dev/network-operator/internal/controller/overlay 69.09% (-1.82%) 👎
github.com/ironcore-dev/network-operator/internal/controller/pool 75.53% (+1.48%) 👍
github.com/ironcore-dev/network-operator/internal/provider/cisco/nxos 16.00% (-0.00%) 👎
Coverage details

Compared to commit abbf600 (run #38244080223)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/ironcore-dev/network-operator/api/cisco/nx/v1alpha1/system_types.go 0.00% (ø) 5 0 5
github.com/ironcore-dev/network-operator/internal/provider/cisco/nxos/dhcprelay.go 16.67% (+16.67%) 6 (+2) 1 (+1) 5 (+1) 🎉
github.com/ironcore-dev/network-operator/internal/provider/cisco/nxos/feat.go 50.00% (ø) 2 1 1
github.com/ironcore-dev/network-operator/internal/provider/cisco/nxos/provider.go 4.40% (-0.01%) 2478 (+5) 109 2369 (+5) 👎

Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code.

Changed unit test files:

  • github.com/ironcore-dev/network-operator/internal/provider/cisco/nxos/dhcprelay_test.go

@hardikdr hardikdr added the area/switch-automation Automation processes for network switch management and operations. label Oct 13, 2026
@hardikdr hardikdr added this to Roadmap Oct 13, 2026
@adamtrizuljak-sap
adamtrizuljak-sap merged commit 2a732d4 into main Oct 13, 2026
26 checks passed
@adamtrizuljak-sap
adamtrizuljak-sap deleted the feat/dhcprelay-server-id-override-disable branch October 13, 2026 07:36
lparz1val pushed a commit to lparz1val/network-operator that referenced this pull request Oct 15, 2026
ironcore-dev#634)

Add a RelayServerIDOverrideDisable field to the NX System spec that
configures the global command "ip dhcp relay information option
server-id-override-disable" on NX-OS.

When DHCP relay with Option 82 is active, the relay agent overrides
the Server-ID (Option 54) in relayed Requests with its own interface
IP by default. The DHCP server then silently drops the Request
because the Server-ID no longer matches its Offer, breaking the DORA
handshake after the Offer step.

The setting is device-global in NX-OS (a scalar leaf under
System/dhcp-items/inst-items), so it lives on the System CRD rather
than the per-interface DHCPRelay CRD. EnsureSystemSettings maps the
bool to the 0..1 leaf and enables the dhcp feature when the toggle is
on; ResetSystemSettings replaces the leaf with its platform default.
Idempotency comes from the gnmiext get-and-check layer.

Signed-off-by: Adam Trizuljak <adam.trizuljak@sap.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/switch-automation Automation processes for network switch management and operations. size/M

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants