[Dnsmasq-discuss] Only TFTP boot clients with specific MAC addresses

Simon Kelley simon at thekelleys.org.uk
Mon Nov 24 22:01:16 GMT 2014

On 23/11/14 01:09, Synchunk wrote:
> Hey,
> I'm trying to create a web interface where you can select which
> computers should boot using TFTP.
> Other computers should get a DHCP lease, but then continue to boot
> normally (without PXE).
> I went through the mailing list archive and found:
> http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/2013q4/007638.html
> Unfortunately, --tftp-unique-root uses the IP address as directory name,
> but I need the MAC address - then I could easily get the web interface
> to symlink the MAC addresses of the computers that should boot from the
> TFTP server to a directory that contains the bootable image.
> I also found the dhcp-script option in the configuration file and it
> seems like a pretty good solution combined with --tftp-unique-root.
> I could write a dhcp-script that, if necessary, creates a symlink with
> the name of the client's new IP address to the folder that contains the
> bootable image so that tftp-unique-root provides the image from that
> directory.
> Now I have two questions:
> - Will dnsmasq wait until the dhcp-script executed or will it run
> asynchronously? It might take the script a few seconds to check if it
> should create a symlink and I don't want the client to send the TFTP
> request before the symlink has been created (as it won't be able to find
> the boot image then).
> - Can anyone suggest a better solution?
> Thanks for reading this huge wall of text (and for creating dnsmasq,
> it's awesome!)

dhcp-script is asynchronous, so that idea won't work.

Look at the dnsmasq pxe-service option. The boot options sent to a
client can be controlled by tags, and tags can be set according to the
MAC address. One possible pxe-service is a filename to boot from, and
another is "boot from local disk", so that covers the options you need.



More information about the Dnsmasq-discuss mailing list