PXEBOOT(8) | System Manager's Manual (i386) | PXEBOOT(8) |
By default, the pxeboot program is configured with modules loading and boot.cfg(5) support disabled. See EXAMPLES for how to enable these options individually. This manual page assumes that boot.cfg(5) support is enabled.
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 (i.e. the DHCP vendor class identifier tag and the requested file name, possibly supplied by the user's command line input to the pxeboot program) to distinguish between the various originators of requests (PXE BIOS, first and second pxeboot stage, NetBSD kernel), and to alter its behaviour. For example, this can be used 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.
installboot -e -o bootconf pxeboot_ia32.bin
To enable modules loading support in the pxeboot program:
installboot -e -o modules pxeboot_ia32.bin
The first /etc/dhcpd.conf example shows a simple configuration which just loads “boot.cfg” and “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 sets loads the boot config and kernel over tftp. This can be used, for example, for installing machines by using an install kernel.
host myhost { hardware ethernet 00:00:00:00:00:00; fixed-address myhost; option host-name "myhost"; next-server mytftpserver; # This section allows dhcpd to respond with different answers # for the different tftp requests for the bootloader and kernel. if substring (option vendor-class-identifier, 0, 20) = "PXEClient:Arch:00000" { filename "pxeboot_ia32.bin"; } elsif substring (option vendor-class-identifier, 0, 17) = "NetBSD:i386:libsa" { if filename = "boot.cfg" { filename "tftp:boot.cfg"; } else if filename = "netbsd" { filename "tftp:netbsd-INSTALL.gz"; } } }
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"; next-server mytftpserver; if substring (option vendor-class-identifier, 0, 9) = "PXEClient" { filename "pxeboot_ia32.bin"; } elsif filename = "boot.cfg" { filename "tftp:boot.cfg"; } 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"; } } }
The TFTP server is supplied using the next-server directive. 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.
Intel Corporation, Preboot Execution Environment (PXE) Specification, Version 2.1, September 20, 1999.
You need the pxeboot from an i386 build to boot an i386 kernel, and that from an amd64 build to boot an amd64 kernel.
In a Xen setup, the NetBSD DOM0 kernel is loaded as a module, and cannot know the device from which the Xen hypervisor was booted. In this case, the DOM0 kernel will fall back to the default boot device (typically the first disk on the host). If the boot device is different from the default one, consider passing additional arguments, like bootdev, to the DOM0 kernel as explained in the load command subsection in boot(8).
November 7, 2010 | NetBSD 6.1 |