[ipxe-devel] Need to release DHCPv6 address before booting image

Michael Brown mcb30 at ipxe.org
Fri Nov 15 17:01:15 GMT 2019


On 14/11/2019 10:45, Harald Jensås wrote:
> The DHCP server (dnsmasq) is configured with static addressing matching
> on MAC address. I get to stage 3 because the OVMF UEFI firmware is kind
> enough to do a RELEASE before booting the Network Boot Program (NBP);
> iPXE in my case. Since the UEFI firmware released the address iPXE
> successfully get IP and configuration so that it can download the
> deploy kernel and ramdisk. When the deploy ramdisk boot's and attempt
> DHCPv6 the DHCP server respond with "no addresses available".
> 
> The DHCP server is correct, the address assigned to the client's MAC is
> already leased to the iPXE client.
> 
> As far as I can tell there is no way to tell iPXE to do something like
> this?
> 
> #!ipxe
> 
> imgfree
> kernel --timeout 60000 http://[fd12:3456:789a:1::1]:8088/vmlinuz
> BOOTIF=${mac} i initrd=initrd
> initrd --timeout 60000 http://[fd12:3456:789a:1::1]/initrd
> <%- Command to release DHCPv6 address -%>
> boot

No, there is no way to instruct iPXE to release a DHCP lease.

Even if there were such a way, this would not provide a general solution 
to the problem, since there are situations in which iPXE would have no 
opportunity to release the DHCP lease before handing over control to the 
loaded OS.  For example, when performing an iSCSI boot, there is no 
point at which iPXE is able to determine that the INT 13 interface will 
no longer be used.

The correct solution is a server-side fix: if the DHCPv6 server is 
matching on MAC address and sees a new request from a MAC address, then 
it should assume that the old lease is dead regardless of the IAID 
value.  This solution is robust in all edge cases (e.g. when a VM 
reboots unexpectedly without the OS releasing its address).

Michael


More information about the ipxe-devel mailing list