iPXE discussion forum

Full Version: Heuristic to break DHCP infinite loop
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I would like to propose a small heuristic to make it easier to break the DHCP infinite loop.

Currently, users that have microtik routers or pfsense servers are advised to build ipxe on their own, while embedding a script to break the loop.

My proposed heuristic is that ipxe would automatically prefer a special "ipxe-override-filename" DHCP option to the stock DHCP filename. That way, if users define both options in their DHCP, then the first request will use "filename" (e.g. ipxe.pxe), while the ipxe request will use "ipxe-override-filename" (e.g. menu.ipxe).

Avoiding custom iPXE builds has the following benefits:
  • Less work, no need to setup a development environment
  • Allows automatic updates from distribution packages
  • Allows ipxe.efi to be signed
I just noticed the almost undocumented scriptlet option. This is even better than the heuristic that I suggested.

So now I just want to suggest that scriptlet gets documented in https://ipxe.org/cfg/scriptlet and in https://ipxe.org/howto/chainloading.

For dnsmasq, an example syntax is:
dhcp-option-force=encap:175,81,"ifopen && chain ltsp/ltsp.ipxe || shell"

P.S. keep in mind that scriptlet won't work if iPXE is booted locally, from ipxe.iso etc; it will only work if ipxe.pxe, undionly.kpxe etc are loaded over the network, so that scriptlet is there even before the "dhcp" command is run.
Reference URL's