Description of problem: ======================= We have a customer that is using nmstate with assisted installer. They use a network configuration that is not currently supported by nmstate, and I wish to know if it could change. They need to set an IP address to a DHCP-enabled NIC; however, this is currently blocked by nmstate. Version-Release number of selected component (if applicable): Some details about their use case: ================================== The SNO (single node Openshift) server will have a static internal IP set to 192.168.x.y at the factory - an initial server install. This IP will never change and will allow the cluster to move and alter external addresses without affecting the operation of the cluster. Actual results: =============== Error: https://github.com/nmstate/nmstate/blob/ad669296545a0fb7f3bd9745155016c8fd474aaf/rust/src/lib/ip.rs#L277-L286 Expected results: ================= A nic with both DHCP and a static IP
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