Changing dhcp variables served to pxe booting clients

Glenn Satchell Glenn.Satchell at uniq.com.au
Tue Jul 14 15:37:31 UTC 2009


Hi Richard,

Here's what I use. The PXE.mtftp-ip was needed with a newer bios that
expected them. Seems harmless to leave them in for older bios systems.

# Option definitions for PXE
option space PXE code width 1 length width 1 hash size 3;
option PXE.mtftp-ip code 1 = ip-address;
# PXE boots for jumpstarting x86 boxes
class "PXE" {
  match if substring(option vendor-class-identifier, 0, 9) = "PXEClient";
  next-server drill.uniq.com.au;
  filename "pxegrub.I86PC.Solaris_10-1";
  # 10 minutes should be long enough for PXE
  max-lease-time 600;
  # don't use multicast tftp option
  vendor-option-space PXE;
  option PXE.mtftp-ip 0.0.0.0;
}
subnet 192.168.14.0 netmask 255.255.255.0 {
  option routers grinder.uniq.com.au;
  option subnet-mask 255.255.255.0;
  option broadcast-address 192.168.14.255;
  pool {
    range 192.168.14.230 192.168.14.253;
  }
}

Any other PXE specific things can be put in the PXE class.

HTH.

regards,
-glenn
--
Glenn Satchell     mailto:glenn.satchell at uniq.com.au | I telephoned the
Uniq Advances Pty Ltd         http://www.uniq.com.au | swine flu info
PO Box 70 Paddington NSW Australia 2021              | line and all I got
tel:0409-458-580  tel:02-9380-6360  fax:02-9380-6416 | was crackling.



>Date: Tue, 14 Jul 2009 15:12:34 +0100
>From: Richard Grant <rfg3 at mcs.le.ac.uk>
>To: dhcp-users at lists.isc.org
>Subject: Changing dhcp variables served to pxe booting clients
>
>Hi,
>
>I'm trying to do something which seems like it should be easy, but I cannot
>figure out how to make it work...
>
>The situation is that we have a bunch of PCs that dual boot. When they are
>running normally they need to be given a certain set of dhcp 
>information. When
>they are PXE booting to reinstall linux, they need to be given a 
>different set
>of dhcp information (a different router, next-server, etc).
>
>Previously, with a different version of DHCP, we could set up a macro which
>contained the different sets of DHCP information. Then when we wanted to
>reinstall a PC we just changed which macro it used.
>
>It looks like we should be able to use if...else statements in DHCP to do
>something similar. I tried:
>
>subnet xxx.xxx.xxx.0 netmask 255.255.255.0 {
>   if option user-class = "install" {
>      <reinstalling dhcp parameters>
>   } else {
>      <normal dhcp parameters>
>   }
>}
>
>with host entries outside the subnet of the form:
>
>host pc1000 { hardware ethernet 00:11:22:33:44:55; fixed-address pc1000; 
>option user-class install;}
>
>However, this never returned true, and always just returned the 'else'
>parameters, even though the user-class option which set to "install".
>
>I have tried all sorts of other methods, but couldn't get anything to work.
>
>Can anyone help me find a way to make the above system work? The object 
>is to
>have a script which changes the value of the user-class parameter to 
>"install"
>when we want to perform a reinstall, and to "noinstall" or something 
>else when
>we want the PC to boot as normal.
>
>Alternately, is there a way to get it so that the dhcp server can 
>automatically
>tell if the PC is PXE booting, and hence serve it different parameters? 
>I saw
>an example that seemed to do this, but it didn't actually work. It was 
>of the
>form:
>
>if substring(option vendor-class-identifier, 0, 9) = "PXEClient" {
>      <reinstalling dhcp parameters>
>} else {
>      <normal dhcp parameters>
>}
>
>Any idea how this might be made to work? Does that 
>vendor-class-identifier only
>with certain hardware, something like that?
>
>If there is any more information I need to give about my setup, then 
>just let
>me know. I'm pretty new to this sort of functionality in DHCP.
>
>Thanks,
>
>Richard Grant
>_______________________________________________
>dhcp-users mailing list
>dhcp-users at lists.isc.org
>https://lists.isc.org/mailman/listinfo/dhcp-users




More information about the dhcp-users mailing list