Bug 2177733
| Summary: | nmstate support for both dhcp and static IP at the same NIC | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 9 | Reporter: | Nir Magnezi <nmagnezi> |
| Component: | nmstate | Assignee: | Gris Ge <fge> |
| Status: | CLOSED ERRATA | QA Contact: | Mingyu Shi <mshi> |
| Severity: | unspecified | Docs Contact: | Mayur Patil <maypatil> |
| Priority: | unspecified | ||
| Version: | 9.4 | CC: | ferferna, fge, gfialova, jiji, jishi, lmcnaugh, maypatil, network-qe, sfaye, till |
| Target Milestone: | rc | Keywords: | FutureFeature, Triaged |
| Target Release: | --- | Flags: | pm-rhel:
mirror+
|
| Hardware: | Unspecified | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | nmstate-2.2.10-3.el9 | Doc Type: | Enhancement |
| Doc Text: |
.`NetworkManager` now supports both static and DHCP IP configuration on the same network interface
By using the `nmstate` utility, you can now assign a static IP address with `dhcp: true` or `autoconf: true` value on the DHCP or Ad-Hoc Network Autoconfiguration (autoconf) enabled interface.
With this enhancement, `nmstate` supports two properties of IP addresses:
* `valid_lft` means valid lifetime in seconds
* `preferred_lft` means preferred lifetime in seconds
Default value of both parameters is `forever` which means static.
With above properties, `nmstate` can ignore DHCP/autoconf based IP addresses to avoid converting dynamic IP addresses to static IP after applying the queried state back. If your scenario requires having disabled DHCP/autoconf settings with dynamic IP addresses, `nmstate` converts those dynamic IP to static IP addresses.
|
Story Points: | --- |
| Clone Of: | Environment: | ||
| Last Closed: | 2023-11-07 08:24:02 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Nir Magnezi
2023-03-13 14:28:18 UTC
Patch sent to upstream: https://github.com/nmstate/nmstate/pull/2303 Introducing two properties for IP address: * `valid-left`: seconds for IP address been valid. `forever` means static. * `preferred_left`: seconds for IP address been preferred. `forever` means static. With above properties, we can identify which certain IP address is retrieved from DHCP/Autoconf so we don't convert dynamic IP address to static when user apply the queried state back. With this patch, user is allowed to set static IP address with `dhcp: true` and/or `autoconf: true`. When desire state has DHCP/Autoconf disabled but all desired IP addresses are dynamic, nmstate will convert those dynamic IP to static. This is common use case where user just copy retrieved dynamic IP and hoping nmstate can convert it to static. Example query output of a interface has both static IP and dynamic IP: ```yml --- interfaces: - name: dhcpcli type: ethernet state: up ipv4: enabled: true dhcp: true address: - ip: 192.0.2.99 prefix-length: 24 - ip: 192.0.2.97 prefix-length: 24 valid-left: 30sec preferred-left: 30sec ipv6: enabled: true dhcp: true autoconf: true address: - ip: 2001:db8:a::9 prefix-length: 64 - ip: 2001:db8:a::2 prefix-length: 64 valid-left: 30sec preferred-left: 30sec ``` Please be aware above two new properties is query only. IP address with above properties set to non-forever will be ignored unless it meet the special use case above. Verified with: nmstate-2.2.10-3.el9.x86_64 nispor-1.2.10-1.el9.x86_64 NetworkManager-1.43.8-1.el9.x86_64 DISTRO=RHEL-9.3.0-updates-20230520.44 Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (nmstate bug fix and enhancement update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2023:6323 |