Configuring PXE Boot with an External DHCP Server¶
This guide explains how to configure MOJO's PXE boot infrastructure when using your own DHCP server instead of MOJO's built-in DHCP service.
Overview¶
MOJO uses a two-stage PXE boot process for OS provisioning:
- Initial PXE Boot: The client receives DHCP configuration and downloads an iPXE boot file via TFTP
- iPXE Chain-loading: iPXE fetches the boot menu and OS configuration via HTTP from MOJO's pxe-helper service
When using an external DHCP server, you configure your DHCP to point clients to MOJO's TFTP server. MOJO's TFTP and pxe-helper services handle the rest of the boot process.
Prerequisites¶
Before configuring external DHCP for PXE boot, ensure:
- MOJO is installed and running
- You have administrative access to your DHCP server
- Network connectivity exists between your DHCP server, MOJO server, and PXE clients
- You know MOJO's IP address on the provisioning network
MOJO Configuration¶
Enabling Provisioning Services¶
MOJO's TFTP and pxe-helper services are part of the "provision" profile. To ensure these services start, the MOJO_SINGLE_NETWORK_DHCP_RUN setting must be set to y in your configuration.
Edit /opt/mojo/configs/mojo.env and verify:
Why Enable DHCP When Using External?
Setting this to y enables the provision profile, which starts TFTP, pxe-helper, and the iPXE deployer services. While MOJO's DHCP service will also start, your external DHCP server will handle PXE boot requests if configured correctly.
If you need to avoid DHCP conflicts, you can configure MOJO's DHCP range to be minimal or on a different subnet that won't conflict with your external DHCP server.
Verifying Boot Files¶
After starting MOJO, verify the iPXE boot files are deployed to the TFTP directory:
You should see the following boot files:
| File | Purpose |
|---|---|
snponly.efi |
x86_64 UEFI boot (most modern servers) |
ipxe_i386.efi |
x86 32-bit UEFI boot |
undionly.kpxe |
Legacy BIOS boot |
If these files are missing, restart MOJO to trigger the iPXE deployer:
Verifying Services Are Running¶
Check that the required services are running:
# For Docker
sudo docker ps | grep -E "tftpd|pxe-helper"
# For Podman
sudo podman ps | grep -E "tftpd|pxe-helper"
You should see mojo-tftpd and mojo-pxe-helper containers running.
External DHCP Configuration¶
Configure your DHCP server with the following PXE options to point clients to MOJO's TFTP server.
Required DHCP Options¶
| Option | Name | Value |
|---|---|---|
| 66 | next-server / TFTP Server | MOJO server IP address |
| 67 | bootfile-name / Boot Filename | Architecture-specific (see below) |
Boot Filenames by Architecture¶
Different client architectures require different boot files:
| Client Architecture | DHCP Option 93 Value | Boot Filename |
|---|---|---|
| x86 BIOS (Legacy) | 00:00 | undionly.kpxe |
| x86 32-bit UEFI | 00:06 | ipxe_i386.efi |
| x86_64 UEFI | 00:07, 00:09 | snponly.efi |
Simplify for Modern Hardware
If all your servers use UEFI boot (most modern servers), you can simply use snponly.efi as the default boot filename without architecture-specific logic.
ISC DHCP Server Configuration¶
For ISC DHCP Server (commonly used on Linux), add the following to your dhcpd.conf:
# Define client architecture option
option client-arch code 93 = unsigned integer 16;
# MOJO TFTP server address
next-server 192.168.20.101; # Replace with your MOJO server IP
# PXE client class with architecture-specific boot files
class "pxeclients" {
match if substring (option vendor-class-identifier, 0, 9) = "PXEClient";
if option client-arch = 00:00 {
# x86 BIOS
filename "undionly.kpxe";
} elsif option client-arch = 00:06 {
# x86 32-bit UEFI
filename "ipxe_i386.efi";
} else {
# x86_64 UEFI (default for modern servers)
filename "snponly.efi";
}
}
After making changes, restart your DHCP server:
Windows Server DHCP Configuration¶
For Windows Server DHCP:
- Open DHCP Manager
- Navigate to your scope's Scope Options
- Configure the following options:
- Option 066 (Boot Server Host Name): Enter MOJO's IP address
- Option 067 (Bootfile Name): Enter
snponly.efifor UEFI clients
For architecture-specific boot files on Windows Server, you'll need to configure DHCP policies:
- Right-click your scope and select Policies > New Policy
- Create conditions based on the client's architecture (Vendor Class or User Class)
- Assign the appropriate boot filename for each architecture
Cisco IOS DHCP Configuration¶
For Cisco routers/switches acting as DHCP servers:
ip dhcp pool PXE-POOL
network 192.168.20.0 255.255.255.0
default-router 192.168.20.1
dns-server 192.168.20.1
next-server 192.168.20.101
bootfile snponly.efi
pfSense/OPNsense Configuration¶
For pfSense or OPNsense firewalls:
- Navigate to Services > DHCP Server
- Select the appropriate interface
- Scroll to TFTP section
- Set TFTP Server to MOJO's IP address
- Scroll to Network Booting section
- Enable Network Booting
- Set Next Server to MOJO's IP address
- Set Default BIOS file name to
snponly.efi
How PXE Boot Works with MOJO¶
Understanding the boot flow helps troubleshoot issues:
Stage 1: DHCP (Your External Server)
| Step | From | To | Action |
|---|---|---|---|
| 1 | PXE Client | Your DHCP Server | DHCP Request |
| 2 | Your DHCP Server | PXE Client | DHCP Response with IP, next-server (MOJO IP), and boot filename |
Stage 2: TFTP and iPXE (MOJO Server)
| Step | From | To | Action |
|---|---|---|---|
| 3 | PXE Client | MOJO TFTP (port 69) | Download iPXE boot file (e.g., snponly.efi) |
| 4 | iPXE | MOJO pxe-helper (port 80) | HTTP request for boot configuration |
| 5 | MOJO pxe-helper | iPXE | Return boot menu and OS provisioning config |
| 6 | PXE Client | MOJO | Proceed with OS installation |
Troubleshooting¶
Boot Files Not Found¶
If PXE clients timeout waiting for TFTP:
-
Verify boot files exist:
-
Check TFTP container is running:
-
Test TFTP connectivity from another machine:
DHCP Not Providing PXE Options¶
Verify your DHCP server is sending the correct options:
-
On a Linux client, use
tcpdumpto capture DHCP traffic: -
Look for
next-serverandfilefields in the DHCP response
iPXE Loads But Can't Reach pxe-helper¶
If iPXE starts but fails to load the boot menu:
-
Verify pxe-helper is running:
-
Test HTTP connectivity to pxe-helper:
-
Check firewall rules allow HTTP (port 80) traffic to MOJO
Network Isolation Considerations¶
If you have multiple DHCP servers on the same network segment, PXE clients may receive conflicting responses. Consider:
- Using VLANs to isolate the provisioning network
- Configuring DHCP relay/helper addresses to route PXE requests to specific servers
- Ensuring only one DHCP server responds to PXE boot requests on the provisioning network
Support¶
If you encounter issues configuring PXE boot with an external DHCP server, contact us at support@metify.io.