Skip to main content

5 Steps to Deploying a PXE Server on a Campus Access Switch

written by Asterfuison

March 23, 2024

What is PXE(Preboot Execution Environment)?

Preboot Execution Environment is a standardized client-server protocol that allows networked computers to boot and install operating systems over the network. It eliminates the need to manually install the OS on each individual machine, saving time and effort and particularly useful for thin clients, diskless workstations, or machines with faulty or missing storage devices and virtualized environments. It also helps mitigate security risks and aids compliance with industry standards and regulations.

Deploying a PXE Server on a Campus Switch

How does PXE boot work?

  1. When the terminal boots from the NIC, it sends a special request to the DHCP server on the local network.
  2. After receiving the PXE boot request, the DHCP server will send a DHCP response which contains the terminal’s network configuration information, as well as the IP address of the PXE boot server – TFTP Server
  3. After the terminal receives the DHCP response, it uses TFTP to download the boot file – pxelinux.0 or bootx64.efi – from the Server.
  4. The terminal loads and executes the boot file downloaded from TFTP. (The boot file is usually a small Linux kernel capable of connecting to a PXE server and obtaining an OS image)
  5. The PXE server sends the system image to the terminal.
  6. The terminal loads and executes the OS image, and runs it entirely from the network
PXE booting workflow

The components required for PXE Server(the boot server) can all be deployed on any single Asterfusion CX-M switch.

CX-M series are Asterfusion’s switch products designed for campus access and hyper converged enterprise networks. All of these switches are equipped with AsterNOS, an enterprise ready SONiC. Due to the advanced containerized software architecture, it is easy to deploy many customized services on the switch. Besides, there is a switch model with built-in processing card (as image below) that provides much more flexibility.

PXE Booting Configuration Process

Before you start, please notice the following things.

  1. The NIC needs to support PXE, and the terminal should configure BIOS in advance.
  2. In Legacy boot mode, the PXE client will request pxelinux.0; for UEFI boot, it will request bootx64.efi.
  3. You can also use nfsboot, which will download the ISO file and then install it.

Step 1: TFTP Installation & configuration

Step 2: Preparing boot files

Create directory:

Get the boot files:

grubx64.efi is the UEFI version of the GRand Unified Bootloader, which is a commonly used bootloader in Linux.

Get the kernel iso file:

You can download it directly from the official website, let’s take ubuntu-20.04.6-live-server-amd64.iso as an example (only the live version supports subiquity – the Ubuntu Server installer, which is installed automatically using cloud-init.).Then copy the iso file and configure file.

Step 3: Configuring HTTP server

Step 4: Configuring boot files:grub.cfg & cloud.init

grub.cfg

cloud.init

Cloud-init is an open source cloud initialization program that enables initial configuration of custom information (hostname, keys, user data, etc.)

Tip: It is recommended to install the OS manually so that an autoinstall-user-data file is generated in the /var/log/installer/ directory, which we can use as a reference. Passwords need to be encrypted and please pay particular attention to the disk partition configuration.The installation process log is saved in /var/log/installer/.

Step 5: DHCP configuration

Configure interface ip address

Configure DHCP

These are all the steps to deploy a PXE server on an Asterfusion CX-M switch. Please contact us if you have any questions or are interested in our switch products.

Latest Posts