Conditionally offering PXE boot to a client

I am working on a pet project, and I am trying to figure out where I should start with achieving the following functionality:

I have a PXE boot rom that wlil do burn-in tests, my burn in test sets a flag on the PXE/DHCP server.

If a client is booting and does not have the flag, I want to offer my PXE boot rom.

If a client does have the flag, I want to just skip pxe boot.

I can do this via pxe config -- but for entire subnets. how do i manage this per MAC?

Edit: I suppose it is worth mentioning, that I can do this via linux or windows server 2008 and it really comes down to which is an easier time to implement this. I'd probably prefer to write the interface for managing the DHCP settings in .net than java or something, but I imagine the dhcpd.conf is going to be more straightforward.


Solution 1:

Take a look at how Foreman does this. You set every machine to PXE boot, and you have a 'default' pxelinux.cfg with a very low TTL. This default config has one entry, localboot.

When you want to switch a machine to PXE booting something else, you create a config file for it (either based on MAC or IP). The next time it boots, it pulls the most specific config file and boots fine. All the other machines get the default one, which does nothing.