A lightweight containerized PXE DHCP proxy server using dnsmasq that provides network boot information to PXE clients without interfering with existing DHCP servers. Configured to boot netboot.xyz for easy network installation of operating systems.
- Proxy DHCP Mode: Only provides PXE boot information, does NOT assign IPs
- Multi-Architecture Support: BIOS, EFI x64, and ARM64 clients
- Configurable Interface: Network interface set via environment variable
- netboot.xyz Integration: Pre-configured for netboot.xyz boot files
- Minimal Footprint: Alpine Linux base (~10MB + dnsmasq)
- Existing DHCP server on your network (for IP assignment)
- TFTP server with netboot.xyz boot files at 192.168.50.250
- Docker and Docker Compose installed
- Network interface with access to your LAN
All configuration is done via environment variables in docker-compose.yml:
environment:
- INTERFACE=enp2s0 # Network interface to listen on
- DHCP_RANGE=192.168.50.0 # Network range for proxy DHCP
- TFTP_SERVER=192.168.50.250 # TFTP server IP address
- BIOS_BOOTFILE=netboot.xyz.kpxe # Boot file for BIOS clients
- EFI_BOOTFILE=netboot.xyz.efi # Boot file for EFI x64 clients
- ARM64_BOOTFILE=netboot.xyz-arm64.efi # Boot file for ARM64 clientsCommon configurations:
- Change network interface: Set
INTERFACEto your interface name (check withip link show) - Different network: Update
DHCP_RANGEto match your subnet (e.g.,192.168.1.0) - Custom TFTP server: Set
TFTP_SERVERto your server's IP - Different boot files: Update bootfile names if using custom PXE images
-
Start the container:
docker-compose up -d
-
Check logs to see PXE requests:
docker-compose logs -f
-
Stop the container:
docker-compose down
-
Rebuild after configuration changes:
docker-compose up --build -d
This uses dnsmasq's proxy DHCP mode with PXE service directives:
- Your main DHCP server assigns IP addresses normally
- This container listens for PXE boot requests on UDP port 67
- When a PXE client boots, it receives two DHCP responses:
- IP address and network config from your main DHCP server
- Boot file information from this proxy DHCP server
- The client then downloads the boot file from the TFTP server via UDP port 69
- netboot.xyz loads, providing a menu of operating systems to install
The proxy automatically detects client architecture and provides the appropriate boot file:
- x86 BIOS: netboot.xyz.kpxe
- x86-64 EFI: netboot.xyz.efi
- ARM64 EFI: netboot.xyz-arm64.efi
No PXE boot menu appears:
- Check logs:
docker-compose logs -fshould show DHCP requests - Verify TFTP server is accessible:
ping 192.168.50.250 - Ensure UDP port 67 is not blocked by firewall
- Verify correct network interface is set in docker-compose.yml
Container fails to start:
- Check interface name matches your system:
ip link show - Ensure no other DHCP server conflicts
- Verify
network_mode: hostis set (required for DHCP)
TFTP timeout errors:
- Verify TFTP server is running on port 69
- Check netboot.xyz files exist on TFTP server
- Test TFTP manually from another machine
PXE Client <--DHCP--> Router DHCP (assigns IP)
|
+-------<--DHCP--> Proxy DHCP (provides boot info)
|
+-------<--TFTP--> TFTP Server (sends boot files)
Dockerfile: Container image definitiondocker-compose.yml: Service configurationdnsmasq.conf: PXE proxy DHCP configurationentrypoint.sh: Runtime interface configuration script
- This is a proxy DHCP server - it requires an existing DHCP server
- DNS functionality is disabled (
port=0) - Only responds to PXE clients (broadcast requests)
- Uses
network_mode: hostfor proper DHCP operation - Requires
NET_ADMINandNET_RAWcapabilities