[Beowulf] Choosing pxelinux.cfg DEFAULT via dhcpd.conf?
prentice at ias.edu
Thu Apr 22 15:40:08 EDT 2010
In your pxelinux.cfg directory, instead of default, you would need to
create a file whose name is the MAC address of the client, or it's IP
address in hexadecimal.
* First, it will search for the config file using the hardware type
(using its ARP type code) and address, all in lower case hexadecimal
with dash separators; for example, for an Ethernet (ARP type 1) with
address 88:99:AA:BB:CC:DD it would search for the filename
* Next, it will search for the config file using its own IP address in
upper case hexadecimal, e.g. 192.0.2.91 -> C000025B (you can use the
included progam gethostip to compute the hexadecimal IP address for any
host). If that file is not found, it will remove one hex digit and try
again. Ultimately, it will try looking for a file named default (in
lower case). As an example, if the boot file name is
/mybootdir/pxelinux.0, the Ethernet MAC address is `88:99:AA:BB:CC:DD`
and the IP address 192.0.2.91, it will try following files (in that order):
These files don't have to be real files, they could symlinks so you
and then create these symlinks
/tftp/pxelinux.cfg/88-99-AA-BB-CC-D1 -> newservers
/tftp/pxelinux.cfg/88-99-AA-BB-CC-D2 -> newservers
/tftp/pxelinux.cfg/88-99-AA-BB-CC-D3 -> oldservers
/tftp/pxelinux.cfg/88-99-AA-BB-CC-D4 -> oldservers
Using symlinks in this way will reduce how many different config files
you'll actually need.
I'm pretty sure this will accomplish exactly what you desire. If you
were looking for a conditional you could use inside your PXE config
file, I don't think such a feature exists.
David Mathog wrote:
> Is there a way to set dhcpd.conf so that it changes which pxelinux.cfg
> entry (LABEL) starts on a network boot? I think something like this can
> be done with the option pxelinux.magic combined with pxelinux.config
> file or pxelinux.pathprefix to specify a 2nd (or 3rd...) pxelinux.cfg
> file, each of which has a different DEFAULT, but I don't see how to set
> the dhcpd.conf entry for a machine to get pxelinux to effectively change
> the default value for a single pxelinux.cfg file. The idea being, in a
> heterogenous cluster, to have dhcpd.conf set up so that type A nodes
> boot one thing, and type B nodes boot another, without any manual
> intervention required.
> The pxelinux.cfg has several different LABEL entries
> one of which is DEFAULT. If dhcpd.conf has filename "/pxelinux.0" set
> then when the remote node boots it network boots the DEFAULT entry from
> pxelinux.cfg. From the keyboard one can choose an entry other than
> DEFAULT to start. I know how to pass variables to whatever comes up,
> with parameters like this on the relevant line in dhcpd.conf:
> option option-200 "information passed"
> but I don't see how to make the node boot, for instance,
> the 3rd option on the pxelinux.cfg list, using just the one file,
> other than by editing that file changing DEFAULT, and reloading the
> dhcpd daemon.
> David Mathog
> mathog at caltech.edu
> Manager, Sequence Analysis Facility, Biology Division, Caltech
> Beowulf mailing list, Beowulf at beowulf.org sponsored by Penguin Computing
> To change your subscription (digest mode or unsubscribe) visit http://www.beowulf.org/mailman/listinfo/beowulf
Linux Software Support Specialist/System Administrator
School of Natural Sciences
Institute for Advanced Study
Beowulf mailing list, Beowulf at beowulf.org sponsored by Penguin Computing
To change your subscription (digest mode or unsubscribe) visit http://www.beowulf.org/mailman/listinfo/beowulf
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
More information about the Beowulf