|
|
Preboot Execution Environment (PXE) refers to various methods of booting a system without the need for a hard drive or boot diskette. Many network cards support the PXE 2.1 standard and are capable of being used to boot the system from an image on the network.
PXE network boot uses the Dynamic Host Configuration Protocol (DHCP), the Address Allocation Server (AAS), the Internet Bootstrap Protocol (BOOTP), and the Trivial File Transfer Protocol (TFTP) to make the boot image available to the client.
In general, to configure and enable PXE network boot:
These steps are detailed in the subsections below.
This file can have any name, but must match the name specified for the boot_file in the DHCP server's configuration file (see below). In the examples on this manual page, we use the name pxebootldr for the PXE configuration file.
The format for pxebootldr is:
name=valuewhere name can be any of the following (with default values shown):
BOOTFILE="bootramd" BOOTPATH="" SERVER_IP="" GATEWAY_IP="" TFTP_PORT="69" TFTP_PKTSIZE="512"
BOOTFILE is the name of the bootable image, and BOOTPATH is an optional path where the image resides. Note that the BOOTFILE and BOOTPATH parameters are taken relative to the path specified if tftpd was started with the -s option (see below). For example, if tfptd was started with -s /tftpboot, then a BOOTPATH of /tftpboot would be interpreted as /tftpboot/tftpboot by the TFTP server.
SERVER_IP can be used to specify the IP address of an alternate TFTP server from which the bootable image is to be obtained. The GATEWAY_IP is needed if the SERVER_IP is on another subnet.
TFTP_PORT is used to specify a TFTP server port other than the default (69), and TFTP_PKTSIZE specifies another packet size to be used for packets exchanged with the TFTP server.
In many cases, the only parameter needed will be BOOTFILE to specify the name of the bootable image to be passed to the client. If no BOOTFILE is specified, or if no PXE configuration file is found, then the PXE code looks for a file named bootramd.
subnet X.X.X.X { boot_file /pxebootldr boot_server X.X.X.X domain "server.domain" routers X.X.X.X pool PXEbootPool }
The boot_file directive tells the client the name of the PXE configuration file on the TFTP server, specified as boot_server. Note that boot_file will be interpreted on the system serving the bootable image relative to any directory specified with the -s option when tftpd is started. See the description of inetd.conf, below.
The pool directive tells the DHCP server which pool of addresses (managed by the Address Allocation Server, or AAS) is available for use by clients. See the following section.
pool PXEbootPool:INET { X.X.X.X-X.X.X.X }
Any name can be used for the pool name, as long as it matches the pool directive specified in dhcpd.conf, above.
Note that if DHCP is being run on another system on the network, the AAS server should be run on that system as well.
#tftp dgram udp wait root /etc/tftpd tftpd -s /tftpboot #tftp dgram udp wait root /etc/tcpd tftpd -s /tftpboot
This enables the TFTP server in secure mode, where the booting client can only access files under the specified directory; in this case, /tftpboot. You can also enable tfptd without the -s option, but this opens up every world-readable file on your system to being read over the network and should be done only where this risk does not pose a threat (such as on a subnet located behind a secure firewall).
The directory /tftpboot (or whatever directory is used) must be created manually, and populated with at least the bootable image to be downloaded. The default image file name is bootramd. Whatever directory and file names are used, they must match the names specified to the DHCP server (see below).
bootps dgram/i udp wait root /etc/dhcpd dhcpd -b bootps-alt bootps-alt dgram udp wait root /etc/bootpd bootpd -S -c /tftpboot
The directory spcified for bootpd with the -c option must match the directory specified above for tftpd with the -s option (in this case, /tftpboot).
Note that, if desired, the DHCP server could be located on another system on the subnet. See the comments in inetd.conf to configure BOOTP without DHCP.
ps -eaf | grep inetd kill -HUP PIDWhere PID is the process ID of the inetd daemon.
If your network card does not support PXE 2.1, you must update the card's BIOS to include PXE 2.1 support (or use another card). Check the documentation for your networking card. Most network card vendors offer BIOS upgrades on their web sites. (Updates for older Intel Pro/100 cards, for example, are available from http://www.intel.com.) Use the Search box on the network card manufacturer's web site to find the manufacturer's available updates for your card. Instructions for applying the updates are provided by the manufacturer.
Once you are sure that the client's network card supports PXE 2.1 and that the system is on the same subnet as the DHCP server, reboot the client and enter the system BIOS. Enable booting from the network in the system's BIOS, save your changes, and reboot.
As the client comes up, it should display information about the network card's PXE agent, including the key to press to start the PXE boot process. When you press this key, a boot request is sent to the DHCP server on the subnet, which should respond with the location of the boot_server, the name of the boot_file, and the other DHCP parameters (as set above). The client then contacts the boot server and downloads the network bootable image.