Skip to content

Conversation

@troglobit
Copy link
Contributor

@troglobit troglobit commented Nov 10, 2025

Description

This PR implements basic DHCPv6 client functionality for Infix, addressing issue #1110.

Key features:

  • Stateful and stateless modes: Full address assignment and information-only (SLAAC companion)
  • Prefix delegation (IA_PD): Request IPv6 prefixes for distribution to downstream networks, although Infix currently does not use this prefix atm.
  • Configurable options: DNS servers, domain search lists, NTP servers, client FQDN, and more
  • Custom DUID support: Optional manual DUID configuration with auto-generation fallback
  • Configurable administrative distance for DHCPv6-learned routes, default: 5

Implementation:

  • New infix-dhcpv6-client YANG module augmenting /interfaces/interface/ipv6/dhcp
  • Refactored shared code into infix-dhcp-common module for DHCPv4/DHCPv6 consistency
  • Use BusyBox udhcpc6 client with custom script handling addresses, routes, DNS, and NTP
  • Test coverage for basic client operation and prefix delegation scenarios

Additional fixes:

  • Corrected namespace in DHCPv4 client YANG module from "urn:ietf:" to "urn:infix:"
  • Fixed DHCPv4 option inference after relocation to /interfaces in commit 764bd8e

Checklist

Tick relevant boxes, this PR is-a or has-a:

  • Bugfix
    • Regression tests
    • ChangeLog updates (for next release)
  • Feature
    • YANG model change => revision updated?
    • Regression tests added?
    • ChangeLog updates (for next release)
    • Documentation added?
  • Test changes
    • Checked in changed Readme.adoc (make test-spec)
    • Added new test to group Readme.adoc and yaml file
  • Code style update (formatting, renaming)
  • Refactoring (please detail in commit messages)
  • Build related changes
  • Documentation content changes
    • ChangeLog updated (for major changes)
  • Other (please describe):

@troglobit troglobit force-pushed the dhcpv6-client branch 3 times, most recently from 28a72a3 to 0ab3a13 Compare November 12, 2025 22:54
@troglobit troglobit changed the title Add support for DHCPv6 client Add DHCPv6 client support Nov 12, 2025
@troglobit troglobit marked this pull request as ready for review November 13, 2025 00:46
@troglobit troglobit requested a review from wkz November 13, 2025 00:46
Basic DHCPv6 support as a per-interface ipv6 setting, not in line with
the IETF YANG model, which has this as a root container.

Note, this also fixes DHCPv4 option inference after the relocation of
/dhcp-client to /interfaces, in 764bd8e.

Fixes #1110

Signed-off-by: Joachim Wiberg <[email protected]>
Also, update docker/README, because after last confusing update I
couldn't follow my own instructions.

Signed-off-by: Joachim Wiberg <[email protected]>
 - Basic DHCPv6 client, request a lease and verify Linux installs a
   default route from the Router Advertisements (option not included
   in DHCPv6), hence the 'enable-ra' option to dnsmasq.  Also verify
   DNS resolution over IPv6, including the resolvconf dance
 - Prefix delegation, verifies that the client can actually request
   and receives a prefix from a DHCPv6 server.  We don't do anything
   with it today though

Two new DHCP server implementations, the basic test relies on dnsmasq
and the prefix delegation test requires an ISC based dhcp server with
server side support for ipv6 prefix delegation.  We could reuse the
latter for both tests, but this way we get compatibility testing.

Signed-off-by: Joachim Wiberg <[email protected]>
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