[Dnsmasq-discuss] Feature request: make dnsmasq able to work as a proxydhcp

Simon Kelley simon at thekelleys.org.uk
Mon Mar 30 21:59:09 BST 2009


Άλκης Γεωργόπουλος wrote:
> Στις 26-03-2009, ημέρα Πεμ, και ώρα 16:48 +0000, ο/η Simon Kelley
> έγραψε: 
>> Alkis,
>>
>> Why is pxe <http://www.kano.org.uk/projects/pxe/> not suitable to do this?
> 
> This project is only suitable for the first scenario that Guilherme
> described - meaning that the server it provides only listens on port
> 4011.
> So the existing DHCP server must be modified to send the string
> "PXEClient".
> 
> This cannot be done if we don't have control over the DHCP server (and
> we wouldn't really need a proxydhcp if we did), or if the DHCP server
> doesn't support sending custom strings (e.g. a cheap
> modem/router/dhcp-server that cannot be substituted by a proper PC-based
> dhcp server for policy reasons).
> 
> So someone would have to modify this project to be suitable for the
> second scenario (=actually the only needed one): to listen for
> broadcasted DHCPDISCOVERs on port 67 and answer with an empty DHCPOFFER
> with PXEclient as the vendor identifier. And of course he would have to
> maintain the project (last version = 2004).
> 
> And then we would have to install dnsmasq as well for the tftp and maybe
> the dns server.
> 
> 
> So if you could make dnsmasq (also) act as a proxydhcp, you'd be
> providing us with a clean solution (actually AFAIK the only open source
> working solution), and doing us a great favor... :-)
> 
>

OK, I got a little obsessed by this over the weekend. PXE is badly
designed, implemented worse and documented worst of all. But once I got
my head round it (don't read the docs, use Wireshark) it turned out to
be possible to implement a PXE service, with proxyDHCP, in only 300
lines of extra code. I've not included support for BIS (checksumming
images) or multicast-TFTP which keeps everything simpler.

The following config is enough to show a simple menu on boot and boot
/var/ftpd/pxelinux.0 when selected

enable-tftp
tftp-root=/var/ftpd
dhcp-option=vendor:PXEClient,6,2b # kill multicast
pxe-prompt="What shall I do now?"
pxe-service=X86PC, "Netboot PXELINUX", pxelinux
pxe-service=X86PC, "Local boot", 0

It's possible to add a timeout to the prompt:
pxe-prompt="Press F8 for boot menu", 60

and it should be possible to hand-off booting to other boot servers
(I've not tested this, as I don't have access to any at the moment)
pxe-service=x86PC, "Install windows from RIS server", 1

For Alkis, to enable proxy-DHCP for a subnet:
dhcp-range=192.168.0.0,proxy


I tested on three different PXE ROMs, one really old (like AMD-K6 old)
and two much newer. The really old one isn't reliable for proxy-DHCP,
but they all work OK otherwise.

Guilherme, it turns out that proxy-DHCP from a second server doesn't
need port 4011 at all, just reply to DHCPDISCOVER with a DHCPOFFER
containing option 60 "PXEClient" and the correct stuff in option 43 and
nothing else, and it just works.

http://www.thekelleys.org.uk/dnsmasq/test-releases/dnsmasq-2.48test8.tar.gz

It would be great if anyone with an interest could test this. There's a
lot of buggy PXE clients out there that might need working around.


Cheers,

Simon.










More information about the Dnsmasq-discuss mailing list