Network booting a system through PXE is a two-stage process:
The DHCP request issued by the NetBSD pxeboot program has the following special parameters:
The DHCP server can use these fields to distinguish between the various originators of requests (first and second PXE stage, NetBSD kernel), and to control conditional behaviour depending on the user's command line input to the pxeboot program, e.g. to support alternative NetBSD installations on one machine.
In addition to the standard network interface configuration, the following fields in the DHCP reply are interpreted:
The commands accepted in interactive mode are:
By default the output from
pxeboot
and from the booted kernel will go to the system's BIOS console.
This can be changed to be one of the serial ports by using
installboot
to modify the boot options contained in the
pxeboot_ia32.bin
file.
/usr/mdec/pxeboot_ia32.bin
/etc/dhcpd.conf
example shows a simple configuration which just loads a file
``netbsd''
from the client's NFS root directory, using the defaults for
protocol and kernel filename.
Similar setups should be possible with any BOOTP/DHCP server.
host myhost {
hardware ethernet 00:00:00:00:00:00;
fixed-address myhost;
option host-name "myhost";
filename "pxeboot_ia32.bin";
option swap-server mynfsserver;
option root-path "/export/myhost";
}
The following
/etc/dhcpd.conf
entry shows how different system installations can be booted depending on
the user's input on the
pxeboot
command line.
host myhost {
hardware ethernet 00:00:00:00:00:00;
fixed-address myhost;
option host-name "myhost";
if substring (option vendor-class-identifier, 0, 9) = "PXEClient" {
filename "pxeboot_ia32.bin";
} elsif filename = "tftp" {
filename "tftp:netbsd.myhost";
} else {
option swap-server mynfsserver;
option root-path "/export/myhost";
if filename = "generic" {
filename "nfs:gennetbsd";
} else {
filename "nfs:netbsd";
}
}
}
It is assumed that the
TFTP
server is the same as the
DHCP
server unless a
next-server
directive is specified somewhere else in
dhcpd.conf
,
and that the
NFS
server for the root file system is
mynfsserver.
The
swap-server:root-path
is only used in the
NFS
case and by the
NetBSD
kernel to mount the root file system.
You need the pxeboot from an i386 build to boot an i386 kernel, and that from an amd64 build to boot an amd64 kernel.