[gPXE] DHCP Client ID in gPXE 1.0.0?

Michael Brown mbrown at fensystems.co.uk
Fri Mar 19 15:24:13 EDT 2010


On Thursday 18 March 2010 11:18:36 Miller, Shao wrote:
> Speaking of scripting, one possibility might be allow for more control
> of the dhcp_request_options_data[] in src/net/udp/dhcp.c from the CLI or
> scripting system.  With an embedded script that modifies this structure
> and then tries 'autoboot', this might be useful for this particular
> request.

Now that's a practical suggestion.  It would definitely be useful to be able 
to modify the gPXE DHCP request.  This is currently possible to a limited 
extent for things like the DHCP user class, using

  set net0/user-class my_user_class

but this works only because code in dhcp_create_request() explicitly copies 
the user-class setting if present.

If there were a general mechanism for using "set net0/xxx" (or maybe "set 
net0.dhcprequest/xxx") to modify the DHCP request packet, then this would 
solve the client-identifier problem, allow the code explicitly handling 
user-class to be removed, and would open up many possibilities for people 
needing to modify the DHCP requests in some way.

There's the problem that some of the settings in the DHCP request are dynamic 
(e.g. the client UUID which is derived from SMBIOS, or the client-identifier 
which is derived from the MAC address), so you couldn't just have a 
static "DHCP request" settings block.  You could, however, have a "DHCP 
request override" settings block, accessible as "net0/dhcprequest", and 
applied at the *end* of dhcp_create_request().  Any DHCP request setting 
value explicitly set by the user would therefore take priority over the 
dynamically-generated value.

This is a relatively simple, elegant solution, which not only solves the 
problem at hand with very little code, but also allows greater flexibility 
for the future.

Michael


More information about the gPXE mailing list