Sometimes you run into a situation where you need to release your DHCP leases or you will run into issue connecting to the network. (Ideally this just simply shouldn’t happen, but I’m seeing it in real world networks, broken as they may be.) Right now, this is a pretty frustrating experience when using NetworkManager, as there’s not actually a particularly obvious way to do this anywhere.
When NetworkManager is configured to use its internal DHCP client, it seems like the way to do it is to simply delete the /var/lib/NetworkManager/*.lease
file for a given connection and re-up it. This is pretty frustrating to try to figure out, especially because the Linux network ecosystem has been in flux, and a lot of the recommendations will tell you to run dhclient
and dhcpcd
commands that do nothing, or perhaps just tell you that down and upping the connection will work (alas, it will not.)
I was going to just open a feature request, but I’m not actually sure exactly what the feature request should be. Assuming the leases are attached to connections (I believe that they are? The *.lease
files contain the connection UUID as well as the interface name.) it seems like this could potentially be stuffed somewhere in the connection editor, not sure. But even then, I can’t find an appropriate D-Bus call or anything in NetworkManager that can clean up the DHCP leases for a connection, so it seems like this would require work further upstream first.
Curious if anyone else thinks this is worth doing and/or has some opinions on how to go about this. This is one of those things that isn’t really important 99% of the time, but when it is, it makes a huge user experience difference.