-
Notifications
You must be signed in to change notification settings - Fork 177
implement DhcpOptionsIgnore for IP, DNS, and Gateway #5198
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ecdda35 to
1b969c3
Compare
eriknordmark
approved these changes
Aug 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some questions in separate comments.
Kick off tests.
- Extended support for DhcpOptionsIgnore to cover IP addresses, DNS servers/domains, and gateway addresses, in addition to the already supported NTP servers. - By default, DHCP-provided options are merged with static configuration. - If a given "*_exclusively" flag is enabled, static values replace DHCP-provided ones. If no static values are present, the resulting config is then empty (e.g. no DNS servers, no IP). - Domain name and gateway are special cases: only one per-port value is supported. Here, static config always takes priority over DHCP. Regardless of the flag value, non-zero static values always overwrites DHCP config. If static is nil, then the DHCP value is used unless the corresponding "*_exclusively" flag is set, in which case the field is cleared. Implementation notes: - Simplified handling of NTP servers: DeviceNetworkStatus now exposes a single combined list of NTP servers, so consumers do not need to distinguish DHCP vs static. - Introduced HostnameOrIP type for representing NTP servers, supporting both IPs and hostnames and (un)marshalling as strings. - When ignoring DHCP-provided IP addresses, the lease is still acquired and dhcpcd configures the address on the interface. However, EVE suppresses propagation of this IP and its routes into per-port and per-NI routing tables, ensuring only the static configuration is applied. Signed-off-by: Milan Lenco <[email protected]>
1b969c3 to
c96e6c1
Compare
This was referenced Sep 25, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
enhancement
New feature or request
main-quest
The fate of the project rests on this PR. Prioritise review to advance the storyline!
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
DhcpOptionsIgnoreto cover IP addresses, DNS servers/domains, and gateway addresses, in addition to the already supported NTP servers.*_exclusivelyflag is enabled, static values replace DHCP-provided ones. If no static values are present, the resulting config is then empty (e.g. no DNS servers, no IP).*_exclusivelyflag is set, in which case the field is cleared.Implementation notes:
DeviceNetworkStatusnow exposes a single combined list of NTP servers, so consumers do not need to distinguish DHCP vs static.HostnameOrIPtype for representing NTP servers, supporting both IPs and hostnames and (un)marshalling as strings.dhcpcdconfigures the address on the interface. However, EVE suppresses propagation of this IP and its routes into per-port and per-NI routing tables, ensuring only the static configuration is applied.How to test and validate this PR
Once supported by the controller, it will be possible to configure network port with DHCP, but at the same time statically configure port IP addresses, gateways and DNS servers, and for each decide if it should be merged with DHCP-provided configuration or replace DHCP configuration. Then it is a matter of checking the reported network configuration or entering the device and checking output from
ip addr,cat /etc/resolv.confandip route. (as well as testing connectivity)But in the foreseeable future, it will be possible to use this feature only through the new LPS endpoint
/api/v/network, which is still under development.(I tested this using eden+adam, which allows me to create and submit any
EdgeDevConfigedited using a text/JSON editor)Changelog notes
Added support to selectively merge or replace DHCP-provided configuration (IP address, DNS servers/domains, gateways, NTP servers) with statically entered values. Previously, this was supported only for NTP servers.
PR Backports
New feature, not to be backported.
Checklist