Linux – What do I need to send an Extended DHCPOFFER with multiple boot options

linuxpxe-bootuefi

According to Wikipedia and a bazillion other pages, you can have:

Proxy DHCP

If a PXE redirection service (Proxy DHCP) receives an extended DHCPDISCOVER, it replies with an extended DHCPOFFER to the client's port 68/UDP (DHCP client port).

An extended DHCPOFFER contains mainly:

  • a PXE Discovery Control field to recommend multicasting, broadcasting, or unicasting to contact PXE boot servers
  • a list of IP addresses of each available PXE Boot Server Type
  • a PXE Boot Menu with each entry representing a PXE Boot Server Type
  • a PXE Boot Prompt telling the user to press a certain key to see the boot menu
  • a timeout to launch the first boot menu entry if it expires

The Proxy DHCP service may also run on the same host as the standard DHCP service. Since two services cannot share port 67/UDP, the Proxy DHCP runs on port 4011/UDP and expects the extended DHCPDISCOVER packets from PXE Clients to be DHCPREQUESTs. The standard DHCP service has to send a special combination of PXE options in its DHCPOFFER, so the PXE client knows to look for a Proxy DHCP on the same host, port 4011/UDP.

I want to implement such a server that sends out these extended responses. I don't mind setting up another daemon just for this purpose, but if I can just configure isc-dhcp-server to send the response that would be ideal.

(before you suggest it, no I can't use syslinux. This is cheating and I'm doing this on an EFI platform and thus have native PXE support)

Best Answer

dsnmasq can do it. It is a 5 liner. http://etherboot.org/wiki/proxydhcp?s[]=dhcp&s[]=proxy

So for me it is not clear why you need your own server. DHCP and PXEBOOT is a very tricky thing. With DHCP Proxy you add a bunch of additional problems. Because the documents are vague and the implementations on the client side terrible, which implies much testing and byte inspecting on the wire.