Lampros - Weird Bricks

FreeBSD 10 as a PXE Server (dnsmasq)

03 April, 2014 | dnsmasq

In my adventures to get a PXE server running, I run into a limitation of the isc-dhcp server - you need to have a host entry for each new machine you want to PXE boot. But this can be a problem if I just want to keep adding machines and PXE booting them. Turns out there's an alternative that's easier to install and configure - dnsmasq.

Dnsmasq can be used as both a DHCP and TFTP server, making administration much easier. Even more importantly, it doesn't have the isc-dhcp limitation of adding an explicit host for each PXE machine.

Note: This guide assumes that you have already set up an NFS server, the NFS export and have copied the contents of the FreeBSD ISO under /nfs_share as per my isc-dhcp notes . Install it with:

pkg install dnsmasq

Make it start on boot:

echo 'dnsmasq_enable="YES"' >> /etc/rc.conf

Move the default configuration file out of the way with:

mv /usr/local/etc/dnsmasq.conf /usr/local/etc/dnsmasq.conf.old

Create a new /usr/local/etc/dnsmasq.conf and add the following: - Note: I left the comments that came with the sample configuration for some parts:


# Uncomment this to enable the integrated DHCP server, you need
# to supply the range of addresses available for lease and optionally
# a lease time. If you have more than one network, you will need to
# repeat this for each network on which you want to supply DHCP
# service.

# Do the same thing, but using the option name

# The same as above, but use custom tftp-server instead machine running dnsmasq

#note the trailing '/' in the next line:

# Enable dnsmasq's built-in TFTP server

# Set the root directory for files available via FTP.

#log dhcp stuff

#set the logfile

Now start dnsmasq:

service dnsmasq start

This is based on the following sources: