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: | VERIFIED --- | QA Contact: | Mingyu Shi <mshi> |
| Severity: | unspecified | Docs Contact: | Mayur Patil <maypatil> |
| Priority: | unspecified | ||
| Version: | 9.4 | CC: | ferferna, fge, jiji, jishi, lmcnaugh, maypatil, network-qe, sfaye, till |
| Target Milestone: | rc | Keywords: | FutureFeature, Triaged |
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | nmstate-2.2.10-3.el9 | Doc Type: | Enhancement |
| Doc Text: |
Feature: Support assigning static IP address on DHCP enabled interface
Reason:
Customer of openshift assisted installer would like nmstate to support assigning static IP address on DHCP/auticonf enabled interface.
Result:
Introduced 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.
|
Story Points: | --- |
| Clone Of: | Environment: | ||
| Last Closed: | 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 |