dhcpcd
dhcpcd copied to clipboard
Override specific DHCP options
I still haven't found a satisfactory tool for testing DHCP, specifically I'm playing with PXE again.
Could you add functionality to set specific DHCP options to a value? (I suppose this may have complexities when dealing with protocol exchanges with multiple states or something.)
For example, right now I'd like to be able to set option 93 ( https://github.com/NetworkConfiguration/dhcpcd/blob/6a369c6d7bb48c8747717ea6e92bd05a2cc96391/src/dhcpcd-definitions.conf#L155 ), but I see no way to do something like that.
I got fed up with dnsmasq again and stated reading the source code to figure out how the heck to do what I want. Apparently what I need to do to be able to get it to answer ProxyDHCP requests is to set option 60 to PXEClient*, and to set option 93 (some kind of architecture spec.).
*(or override this string to something else with the partially undocumented "--dhcp-pxe-vendor" https://github.com/imp/dnsmasq/blob/770bce967cfc9967273d0acfb3ea018fb7b17522/src/option.c#L4311 , but it needs to be set in any case)
Are you perhaps aware of any other tools that do allow manually specifying DHCP options?
Thanks!
Of course, right after posting this, I finally figure out how to compile https://github.com/CyberShadow/dhcptest (it's trivial, unless you don't realize you are using an outdated compiler). It seems to do what I want.
edit: dhcptest (and reading the dnsmasq source) seems to be the way to go, it appears to work quite well.
So option 93 is for PXE booting - ie a small DHCP client embedded on a network card or some hardwhere level to then load the kernel from the DHCP request.
While dhcpcd is used on many embedded systems, I don't think it's used on any PXE equipment. dhcpcd requires a fairly large footprint of the OS and supporting libraries whereas a PXE DHCP client has no such luxury. Hence my comment about it being of no use.
Saying that, adding an option for it would be fairly trivial but I would like to know your use case first.
Well, that's why I ask about a generic "set option value" ability, because then it's more useful for general testing, it's just these two specific options that came up for me right now. In any case, if you'd rather not, that's fine, because I finally found and figured out dhcptest and it covers the testing usecases I can think of.
Well a generic set option would likely be binary or ASCII only. The definition files are for decoding, not encoding.