Skip to content

Network Booting with netboot.xyz & OPNsense

Network booting is useful when you want to image a machine without having to carry around a USB drive. My main use case for setting this up is to eventually netboot raspberry pi's and mount their boot drives over NFS.

Resources

Related

What is what

  • OPNsense IP is 192.168.1.1
  • TFTP server will be 192.168.1.1
  • DHCP server is 192.168.1.1
  • netbootxyz server is 192.168.1.11

How To

netboot.xyz Docker Setup

  1. Setup is pretty easy, just choose your install method. I'll use a docker compose file to install the container on a Debian LXC Container.
version: "2.1"
services:
  netbootxyz:
    image: ghcr.io/netbootxyz/netbootxyz
    container_name: netbootxyz
    volumes:
      - ./config:/config
      - ./assets:/assets
    ports:
      - 3000:3000
      - 69:69/udp
      - 8080:80
    restart: unless-stopped

TFTP Server & OPNsense Settings

  1. Install the TFTP server on OPNsense by going to [System] -> [Plugin] -> search for tft, and install os-tftp

  2. The server won't start unless the /usr/local/tftp directory exists, so create it.

  3. Download the netboot.xyz efi files from the releases page and place them in the directory you created. You can use the fetch command in freebsd like fetch https://github.com/netbootxyz/netboot.xyz/releases/download/2.0.82/netboot.xyz.efi

    I'll download the following:

    • netboot.xyz-arm64.efi
    • netboot.xyz.efi
    • netboot.xyz.kpxe
  4. Add your netboot server to your DHCP server by going to [Services] -> [ISC DHCPv4] -> [Interface] -> [Network booting].

  5. Add your netboot server under [Services] -> [ISC DHCPv4] -> [Interface] -> [TFTP server].

opnsense dhcp server

  1. You should be able to now boot from the network