Free — no signup required

PXE Boot: Booting from the Network

3 min read

The Chicken and Egg Problem

How can a computer connect to the network to download an operating system if it doesn't have an operating system running yet to manage the network card?

The answer lies in a special capability built into almost all server network interface cards (NICs) called the Preboot eXecution Environment, pronounced "Pixie" (PXE).

PXE is a tiny, rudimentary program baked directly into the network card's firmware chip. When a server turns on and finds no bootable OS on its hard drive, the BIOS hands control to the PXE firmware on the NIC. At this point, the NIC itself becomes the boot device — it reaches out to the network to find something to run.

The Enhanced DHCP Handshake

PXE relies on the standard DHCP process (where a device asks the network "what IP address should I use?"), but with two crucial additions called DHCP Options:

  1. Discover: The empty server broadcasts a DHCP request. The DHCP server recognizes it as a PXE request because of a vendor class identifier in the packet.
  2. Special Offer: The DHCP server provides an IP address AND two extra fields:
  3. Option 66 (Next Server / next-server): The IP address of a TFTP server that holds the bootloader.
  4. Option 67 (Boot Filename / filename): The name of a tiny bootloader program to fetch, such as pxelinux.0 or ipxe.efi.
  5. Fetch Bootloader: The NIC uses TFTP (Trivial File Transfer Protocol) — a deliberately simple file transfer protocol — to download that bootloader from the address in Option 66.
  6. Execute: The server runs the bootloader entirely in RAM. The bootloader is just smart enough to fetch a Linux kernel (vmlinuz) and initial RAM disk (initrd) over the network, load them into memory, and start the OS installation process.

A minimal PXE-aware DHCP configuration is just the standard subnet and address range definition, plus the two PXE-specific options set directly on it: the TFTP server's address and the bootloader filename to fetch. When a bare metal server on that subnet powers on, the DHCP server hands it the TFTP server address and the bootloader filename in the same response as its IP lease. The NIC does the rest automatically.

Interview Tip

Interviewers often ask: "What is the role of DHCP in PXE booting?" A weak answer is "it gives the server an IP." The strong answer is: "DHCP does give the server an IP, but for PXE it also carries two critical options — Option 66 (the TFTP server address) and Option 67 (the bootloader filename). Without these, the NIC has an IP but no idea where to fetch the bootloader from. The DHCP server is the entry point for the entire provisioning chain."

Key Point: PXE is not magic — it is a precisely defined protocol interaction between the NIC firmware, a DHCP server, and a TFTP server. Any one of these failing silently (wrong subnet, firewall blocking UDP port 69 for TFTP, wrong filename) will cause the server to fall through to a "No bootable device" error with no obvious indication of which step failed.

This is one of 18 chapters

Every chapter is free — Kubernetes, Terraform, SRE, distributed systems, and more — with fast daily review built in.

Sign up free