-
Notifications
You must be signed in to change notification settings - Fork 114
[WIP]feat(dhcpv6): Add DHCPv6 support for macvlan and bridge drivers #1323
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Rishikpulhani The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Reviewer's GuideThis PR extends Netavark’s networking stack to support stateful DHCPv6 by adding a dedicated DhcpV6Service in the DHCP proxy, updating the gRPC Lease conversion to handle IPv6, configuring container kernels for Router Advertisement acceptance, and introducing required dependencies. Class diagram for new DHCPv6 support in DhcpServiceclassDiagram
class DhcpService {
<<enum>>
V4(DhcpV4Service)
V6(DhcpV6Service)
}
class DhcpV4Service
class DhcpV6Service {
+DhcpV6ClientAsync client
+NetworkConfig network_config
+Option<MozimV6Lease> previous_lease
+new(nc: NetworkConfig, timeout: u32, ia_type: DhcpV6IaType) Result<Self, DhcpServiceError>
+get_lease() Result<NetavarkLease, DhcpServiceError>
}
DhcpService --> DhcpV4Service
DhcpService --> DhcpV6Service
DhcpV6Service --> DhcpV6ClientAsync
DhcpV6Service --> NetworkConfig
DhcpV6Service --> MozimV6Lease
class DhcpServiceError {
DhcpServiceErrorKind kind
String message
}
DhcpV6Service --> DhcpServiceError
class NetavarkLease
class MozimV6Lease
DhcpV6Service --> NetavarkLease
DhcpV6Service --> MozimV6Lease
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
4601674
to
eba4a4b
Compare
This commit introduces full support for stateful IPv6 address assignment via DHCPv6, resolving the issue where containers would not receive a global IPv6 address on macvlan networks. The implementation follows the standard IPv6 design of separating gateway discovery (via Router Advertisements) from stateful address assignment (via DHCPv6). Key changes include: - **Kernel Configuration:** Netavark now configures the container's kernel to accept Router Advertisements (`accept_ra=2`) for automatic gateway discovery, while disabling SLAAC (`autoconf=0`) to ensure a managed, deterministic network environment. - **DHCPv6 Service:** A new `DhcpV6Service` is added to the DHCP proxy. It uses the `mozim` library to acquire IPv6 leases and correctly generates a stable DUID-LL from the container's static MAC address to ensure a persistent network identity. - **gRPC Layer:** The gRPC `Lease` object and its `From` implementations have been updated to act as a universal carrier for both IPv4 and IPv6 lease information. - **Generic Proxy Logic:** Core functions like `process_client_stream` and `update_lease_ip` have been refactored to handle both DHCPv4 and DHCPv6 services generically, with conditional logic to correctly handle the differences between the protocols (e.g., gateway handling). Signed-off-by: Rishikpulhani <rishikpulhani@gmail.com>
eba4a4b
to
68032d7
Compare
Ephemeral COPR build failed. @containers/packit-build please check. |
5 similar comments
Ephemeral COPR build failed. @containers/packit-build please check. |
Ephemeral COPR build failed. @containers/packit-build please check. |
Ephemeral COPR build failed. @containers/packit-build please check. |
Ephemeral COPR build failed. @containers/packit-build please check. |
Ephemeral COPR build failed. @containers/packit-build please check. |
Fixes #1072
This commit introduces full support for stateful IPv6 address assignment via DHCPv6, resolving the issue where containers would not receive a global IPv6 address on macvlan networks.
The implementation follows the standard IPv6 design of separating gateway discovery (via Router Advertisements) from stateful address assignment (via DHCPv6).
Design
The implementation follows the standard IPv6 model:
sysctl
(accept_ra=2
,autoconf=0
) to automatically learn its default gateway from RAs while preventing SLAAC. Netavark does not parse RA messages itself.DhcpV6Service
in the DHCP proxy uses themozim
library to acquire a lease, providing the container with a stable IP address and other options like DNS.Key changes include:
Kernel Configuration: Netavark now configures the container's kernel to accept Router Advertisements (
accept_ra=2
) for automatic gateway discovery, while disabling SLAAC (autoconf=0
) to ensure a managed, deterministic network environment.DHCPv6 Service: A new
DhcpV6Service
is added to the DHCP proxy. It uses themozim
library to acquire IPv6 leases and correctly generates a stable DUID-LL from the container's static MAC address to ensure a persistent network identity.gRPC Layer: The gRPC
Lease
object and itsFrom
implementations have been updated to act as a universal carrier for both IPv4 and IPv6 lease information.Generic Proxy Logic: Core functions like
process_client_stream
andupdate_lease_ip
have been refactored to handle both DHCPv4 and DHCPv6 services generically, with conditional logic to correctly handle the differences between the protocols (e.g., gateway handling).Summary by Sourcery
Enable stateful DHCPv6 on macvlan and bridge networks by introducing a dedicated DhcpV6Service, updating kernel sysctl settings for IPv6 gateway discovery, and extending the proxy and gRPC lease handling to support IPv6 leases
New Features:
Enhancements:
Build: