Procedure for converting a Dynamic Lease to Fixed

Here is how I have always done it:
First set the static IP on the device, then define it under fixed leases.

However I see you can convert an existing Dynamic Lease to Fixed with a radio button on the right edge of the Dynamic Lease. I see that it moves the device to the Fixed section, but leaves the IP alone. So the IP remains what it was when it was in the Dynamic Pool.

It is not clear to me, is it okay to leave this IP as-is and IPFire will know not to ever use that IP for another Dynamic device? Or must you manually change the IP to something outside of the Dynamic range? If you do the latter, must you then go into that device’s network settings and set the same static IP on it? Or can you leave the device set to Dynamic?

You should change the IP to outside the Dynamic Range.

It might work with it set like that but if that PC was ever disconnected from the network for some time then that “fixed” lease could end up being assigned to another machine and now no longer available to be used by the fixed lease machine.

If you have set the client up with a staic IP then you would need to go and change that IP.

I always have my clients set up with dhcp so they ask IPFire for an IP and the fixed lease ensures that they always get the same IP.

It also means that if I want to change the fixed lease IP then I can just change the fixed leases and then reboot the client machine so it requests an IP from fresh.

4 Likes

This was the piece of information I needed. That wasn’t clear to me that I could leave the client set to Dynamic. Thank you!

1 Like

You MUST change the IP.

Basic processing of DHCP server is

  • search for fixed leases definition (MAC, IP) for a requesting MAC; if found, hand out this IP
  • otherwise choose an IP from the dynamic pool ( based on usage age, … ), check if the IP is active; if inactive hand out this IP, otherwise choose another IP.

This shows, if you have any static or fixed IPs which are an element of the dynamic pool, you may run into double instances of these IPs. Device not active during check → IP can be handed out; activation of device → IP becomes active at the device ( either by static definition or by fixed leases definition ).
dhcpd does not check for this doublings, in case of static definition it is even impossible.

EDIT: I’ve tried to clarify this in DHCP wiki page.

1 Like

Obviously not relevant here from what has been posted and IPF does not use dnsmasq, but dnsmasq allows you to have a static lease inside or outside the DHCP pool as it makes a permanent reservation whether or not the device is continually connected to the LAN.

Windows Server does the same in its DHCP Server config. You can convert any dynamic IP to “reserved” which is equivalent to converting that IP to fixed.

1 Like

As an addendum, here is what it looked like for me converting an existing dynamic lease to fixed:
-clicked on the Add button next to a dynamic lease. The device was moved into the Fixed Leases section, but with its existing dynamic IP.
-I then manually changed the last octet of the IP out of the dynamic range. At this point, the device is showing in both locations with two different IPs.
-I then went to Who Is Online and updated the IP of the device to the new fixed IP. It was showing as offline.
-I checked the IP at the client and it was still showing the old dynamic IP.
-I then went to the client and from Command Prompt, issued 'ipconfig /release" and “ipconfig /renew” commands. It took a minute for it to renew, but when it did, it came back with the new fixed IP.
-I went back to IPFire DHCP page and the dynamic IP was showing with a strikethrough.
-I rechecked and clicked the update button in Who is Online and this time it showed as online.

The End

3 Likes

Addendum by me.

  • The ‘Add’ button moves the information of the dynamic lease to the fixed leases set, and to the ‘Add/Edit’ box. There can be edited and saved.
  • The DHCP lease has an expiration time. During this period the client doesn’t renew the lease. On the server side the dynamic lease is valid.
  • On renew the server finds the new definition and answers with the new IP. Also the existing definition ( MAC, old IP ) is set invalid.

The state in the WUI page seems ambigious, but this is resolved by the processing described above.

2 Likes