In our environment we have 3 DHCP Servers used for PXE booting.

1 - FreeBSD PXE

1 - Linux PXE

1 - Disked Imaging (clonezilla-like device)

Each device requesting DHCP is on a separate subnet from the DHCP servers.

But the DHCP servers are all on the same subnet.

Is there a way to add additional logic to a DHCP Relay Agent in redhat to look at a configuration file or database table to tell it which DHCP server to use? We basically want to be able to dynamically and automatically configure the relay agent to forward DHCP requests to whichever DHCP server we want at a given time using some logic.

  • 2
    Why do you not have one DHCP server and a PXE Menu to choose what image to boot?!?
    – Chris S
    May 14 '14 at 13:49
  • @ChrisS because that's not automated. May 15 '14 at 0:58
  • What exactly are you trying to do? Have different clients PXE boot different images? If so, what criteria do you intend to make the decision based on? This still sounds like a silly overly complicated setup.
    – Chris S
    May 15 '14 at 1:04
  • @ChrisS Different clients will boot a different image depending on the parameters specified. The relay agent should then lookup what server to forward a dhcp request to. The information will have been given to it via automation and read from a database table/other data point. If you have other suggestions to allow the same automated method yet make this less complicated I'm all ears :D May 15 '14 at 2:35
  • 1
    @ChrisS sorry, I think I felt a little put off when you called the setup "silly and overly complicated" and I may have taken your multiple "?!?" the wrong way. I genuinely do want to know if you or others would have a less complicated solution, and I'm sorry if I came off sounding obtuse. May 15 '14 at 14:15

The short answer to your question is No; Adding Logic to "regular" DHCP Relay Agents is not possible.

Analyzing your scenario I think you should consider that having multiple DHCP servers is never a good idea.

If I were you I would set just a single DHCP and a regular DHCP relay service. Then I'd force the PXE servers to work in proxyDHCP mode. This way the DHCP server will only provide IPs while the proxyDHCPs will only provide the DHCP/PXE complementary information (NBP filename and the IP of the TFTP server hosting it)

You can also add filter rules to the proxyDHCP servers to only answer to specific requests, this way a particular client can be forced to receive a single PXE offer avoiding the typical multi-offer ambiguity.

PS: do not worry; you are not the "obtuse" here.

  • So basically you're saying that proxyDHCP will be doing my filtering. I'm guessing there's different kinds of filtering options on proxyDHCP like binding specific DHCP options per mac-address kind of thing? Also, where would it be pulling this filtering info from? Maybe a config file or something? I've never setup proxyDHCP so I'm not really familiar with the logic there. Thanks for the constructive feedback. May 16 '14 at 17:54
  • in a PXE environment a proxyDHCP provides the PXE related information to pxe booting stations that get their IPs from a regular DHCP server. But if the proxyDHCP is also set to only answer certain requests (lets say depending on the MAC of the booting client or whatever) then yes you can somehow consider that behavior as a filter. Remember in your scenario DHCP helpers are mostly located at router's firmware, a proxyDHCP instead it's a piece of software running in your server then they are much more flexible... of-course in your scenario you have to set clever rules for every proxyDHCP.
    – Pat
    May 17 '14 at 9:52
  • thanks! This gives me a good place to start/play around with. May 17 '14 at 22:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.