Retaining information between DHCP requests

CLOSE Dave Dave.Close at
Wed Oct 8 17:26:56 UTC 2014

I understand that dhcpd doesn't record requests for static addresses in 
the leases file, and that makes sense to me. But without that recording 
I'm at a loss of how to save information between requests.

The problem I'm trying to solve is to provide different nameserver 
values to the same machine under different circumstances. In particular, 
I need a different nameserver configuration when the machine is being 
installed, via PXE kickstart, and during normal operation. The machines 
are running Fedora but that may not be important.

During installation, kickstart seems to exchange messages with dhcpd 
three times. The first time it goes through the full DISCOVER, OFFER, 
REQUEST, ACK sequence. The second and third times it only sends REQUEST 
and gets ACK. All responses give it a full-day lease.

The DISCOVER and REQUEST messages in the first exchange include a unique 
vendor-class-identifier starting with "anaconda". I can and do detect 
that string and provide the special nameserver response needed. But the 
subsequent REQUESTs do not include that string and dhcpd then provides 
the normal operation response. That confuses kickstart and the 
installation fails.

(I'm also puzzled why kickstart would send the subsequent REQUESTS, 
given that it was told it had a full-day lease. But I probably can't do 
anything about that.)

Ideally, I'm looking for a way to remember the status of the most recent 
DISCOVER/OFFER and to continue to use that to determine the response to 
any subsequent REQUESTs. But, because these machines have static 
addresses, I can't record anything in the leases file. Is there any 
other solution that anyone can suggest? Is there a way I can add 
something to the OFFER that would always be included in a later REQUEST?
Dave Close

More information about the dhcp-users mailing list