Adding HTTP Boot to OPNSense

A few days ago an electrical storm took out my trusty APU 1d. At first I thought that it was only the power supply that died, but the WAN NIC is not recognized ~80% of the time. I thought I could simply just use the OPT1 port instead, but no. Randomly the WAN port will reappear and wreak havoc with the system and basically stop all traffic on my network until it would again randomly disappear. It was an amazing piece of equipment, as was my trusty Alix 2d3 before it. ….even though I love these systems, it’s time to move on.

I wanted to try OPNSence instead of pfSense for this install. The only real hiccup I ran into moving over was around DHCP support for HTTP Boot. The pfSense team added a UI option for this not too long ago and it’s been super helpful for some of the Red Hat related provisioning testing I’ve put together. Anyway, my RFE was justifiably declined due to the deprecation of ISC dhcpd. No worries because it was pointed out that it’s super simple to add dhcp configuration drop-ins manually.

Adding dhcpd config outside of the UI

The project documentation does a great job of outlining how to do this. Basically just SSH to the system, create a file under: /usr/local/etc/dhcpd.opnsense.d/ and paste in the following w/ the correct IP & path for your environment:

class "httpclients" {
option vendor-class-identifier "HTTPClient";
match if substring (option vendor-class-identifier, 0, 10) = "HTTPClient";
filename "http://[webserverip]/path-to-efi-nbp";

That’s it! Once this file has been written, just reload/restart the DHCP server and the config will take effect. If you’re using a RHEL or Red Hat derived distro you’ll want to load the shim for grub as the NBP (network boot program). This is typically /EFI/BOOT/BOOTX64.EFI on the boot media. If you want to move out of the stone ages w/ PXE/TFTP, HTTP booting straight from the firmware is awesome. Basically, just copy the boot media to a web server, modify the grub menu as needed (you’ll likely need to adjust the kernel & initrd paths to align w/ your web server path), and finally pass the desired NBP. If you’re coming from the PXE world, there’s a good chance you’re using pxelinux.0 or some flavor of ipxe, that will get replaced with grub. Easy peasy!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.