3

(Note, the title of the question Is there a way to classify DHCP requests based on the interface they're coming from? is what I want answered, but it doesn't actually ask that question for a non-dhcp relay situation, and the answer doesn't help here since I can't rely on a relay to set options for me).

I have a hypervisor (KVM) with isc-dhcpd at dom0, and I need to be able to PXE boot client VMs. This works fine for any one interface, but I can't seem to make it work for multiple interfaces - I have the following class for PXE:

class "pxeclients" {
  match if substring(option vendor-class-identifier, 0, 9) = "PXEClient";
  filename "pxelinux.0";
  next-server 10.71.0.1;
}

The problem is that I have to pick which tftp interface I want to use for next-server. I need clients to pick the tftp server on their own subnet or they can't boot (but otherwise they all look the same, unless I can find some kind of match discriminant). Is there a way to create a class which matches on both PXE and the subnet I'm about to lease, or the interface the packet came in on?

Nick Bastin
  • 213
  • 2
  • 8

1 Answers1

3

Why not specify a tftp server that's a hop away? As long as your clients are receiving the appropriate default gateway this might be the easiest way to go.

That said, if you must support multiple interfaces -

It's possible to run multiple instances of dhcpd. Each would have its own configuration that would include entries to specifically bind said instance to a particular interface. To ease administration each config file could be set to include an additional configuration file that might contain other common settings. This would probably be fine for a relatively small number of interfaces (i.e. <= 10-20) but if it needs to scale much larger then I'd look into a proper L3 infrastructure with helper addresses/relays.

rnxrx
  • 8,103
  • 3
  • 20
  • 30
  • The reason I can't specify a tftp server that's a hop away is because there's no gateway for these VMs - they can only see each other. That being said, accepting the answer as your second option works (if painful, as you mention, but it seems that dhcpd for some reason can't filter based on packet arrival interface) - and of course your first suggestion is what most people should do if they don't have a specialized environment. – Nick Bastin Aug 05 '12 at 22:08