2 Network booting basics

This section introduces the general concepts and ideas and the motivation for going into the next sections. You can skip this if you are in a hurry.

2.1 Introduction

Intel's PXE (Preboot eXecution Environment) is a small boot code that lets your client query network configuration using DHCP and fetch a boot loader using TFTP. This has become standard in many computers and has replaced etherboot.

This guide sets out to explore two uses of network booting: Jumpstart installation of FreeBSD and diskless clients:

In both cases the benefit is ease of maintenance when working with a large number of workstations or servers. If you're only doing it for one machine, then it's mostly for the sport and learning, but those too are valid reasons.

Setting up a server has been documented in numerous documents, however not every step is clear and various documents describe different paths to follow and some parts are obsolete. This document is probably no different.

2.2 Hard- and software

The hardware must support PXE network booting. Many motherboards with on board Intel based network interface supports PXE. VIA produces mini-ITX format motherboards including some fanless ones, these are ideal for building cheap diskless and completely silent clients.

Any system can function as server as long as they support the services needed to serve the files to the booting client. However, it is easier to setup when using the same platform and version of FreeBSD on the server and client.

2.3 Understanding the boot process

When a PXE client boots, the boot process goes through a number of stages, which are roughly as follows:

  1. PXE sends a bootp query on the network and receives information for configuring the network interface: IP address, netmask, default router. Also it receives information about where to fetch a boot loader and the path name of the root device.

  2. PXE fetches the boot loader with tftp (the boot loader is actually the normal FreeBSD loader with some extra pxe code and tftp or nfs support). Before any other file, the loader fetches boot/loader.rc and any included files using tftp. These files contains information about where to get a kernel and posibly a root device.

  3. The kernel is loaded and the root file system mounted. The kernel will need to acquire information about the network configuration, either by using information passed from stage 2 or by sending a new bootp request.

To enter stage 1, PXE must be supported by the hardware. Alternatively one can install a flash boot image or boot on a floppy - this method is not covered in this document.

In stage 2, if pxeboot is compiled with nfs support (default) it will try to nfs mount the root device specified in the root-path option sent by the dhcp server. If pxeboot is compiled with tftp support, it will fetch the files using tftp. In both cases, it will first read the file boot/loader.rc where the path is relative to the nfs root directory or tftp directory.

What happens after stage 3 depends on how we populate the root file system.

2.4 The root device: Memory FS vs. Network FS

The root device can either be a memory disk or an nfs share, both have their advantages and disadvantages:

Serving a memory disk is easy as it can be fetched with tftp, and tftp has to be setup anyway to serve the pxeboot loader. But, the memory disk is a bit more cumbersome to populate, customise and update.

The main disadvantage of using tftp to fetch a memory file system is that all clients will fetch the same files, load the same kernel and memory file system, regardless of hardware, version of FreeBSD or the purpose of the client.

With an nfs root device you can specify different root mounts for different clients. This means that it is posible to support multiple hardware platforms and configurations from the same server.

The main reason to avoid nfs is that it is difficult to set up in particular if there is a firewall in the way.

The jumpstart installation section will take the approach of using a memory disk device while for diskless clients we use nfs. So both methods are covered. Setting up pxeboot, you can choose the path you find best and ignore the other.

2.5 Security

Keep in mind that all data will be transferred across the network, and at least initially without encryption making your traffic target for eavesdropping.

Do not boot diskless clients on an untrusted network! After boot, connections can be encrypted, but the encryption keys will have been sent in the clear at boot time.

This, and other documents, can be downloaded from ftp://ftp.FreeBSD.org/pub/FreeBSD/doc/.

For questions about FreeBSD, read the documentation before contacting <questions@FreeBSD.org>.
For questions about this documentation, e-mail <doc@FreeBSD.org>.