Comment 3 for bug 1911357

Revision history for this message
Alfonso Sanchez-Beato (alfonsosanchezbeato) wrote :

NM creates a netplan configuration to be set as the default renderer. When netplan applies it, networkd releases the DHCP lease and NM requests a new address to the DHCP server, which might assign the same or a different address to the original one (it tends to be the same if the request comes from the same MAC, but not all DHCP server behave in the same way).

AFAIK there is currently no way to transfer DHCP leases from networkd to NM. Maybe an option would be ask networkd to not release the IP when it stops, then I think NM would take over the current IP address. That can be done with:

[Network]
KeepConfiguration=dhcp-on-stop

in the networkd connection files. But I have not seen this supported in netplan reference.

Maybe when network configuration is controlled by snapd setting this will not be an issue, if netplan knows from the beginning that NM is the default renderer, it won't create configuration files for networkd.

In the case of rebooting to recover mode and have the same address, you will need to copy around NM's DHCP lease files across partitions to make sure the DHCP client tries to grab the old address from the server. That should work.