DHCP pools with IP Aliases
jnorell last edited by
I have configured multiple ip aliases on an interface (6 aliases + 1) and would like to serve DHCP clients out of all those ip addr ranges, but the user interface only supports the base ip address, and doesn't allow entering multiple pools or even a single pool from one of the other ranges. This is with the latest snapshot (2010/06/01).
Thank you, whomever added ip alias support! This is a long-awaited feature.
DHCP for such scenarios won't be supported in 2.0, maybe in the future. When you have multiple IP subnets like that you should use VLANs or multiple physical interfaces, not throw a bunch of subnets on one interface. Sometimes it's unavoidable, but it's generally a bad practice. Doing DHCP that way would be difficult at best, not sure how it could differentiate between subnets unless you had reservations for everything, even at that I'm not sure if dhcpd could handle such scenarios.
I seem to recall reading that someone did it by passing the options for it in the custom options field.
Multiple interfaces or VLANs is definitely the way to go there. You really need each subnet to be in its own separate layer 2 broadcast domain, not just a subnet, if you want to use multiple DHCP subnets.
That said, it looks like ISC DHCPD supports this somewhat, though it does not work like the OP wants it to work (emphasis mine):
The shared-network statement is used to inform the DHCP server that
some IP subnets actually share the same physical network. Any subnets
in a shared network should be declared within a shared-network state-
ment. Parameters specified in the shared-network statement will be
used when booting clients on those subnets unless parameters provided
at the subnet or host level override them. If any subnet in a shared
network has addresses available for dynamic allocation, those addresses
are collected into a common pool for that shared network and assigned
to clients as needed. There is no way to distinguish on which subnet
of a shared network a client should boot.
Name should be the name of the shared network. This name is used when
printing debugging messages, so it should be descriptive for the shared
network. The name may have the syntax of a valid domain name
(although it will never be used as such), or it may be any arbitrary
name, enclosed in quotes.
jnorell last edited by
We do use ISC dhcpd for that now. I'd disagree with that quote saying there's "no way" to put a client on a subnet, we accomplish that by assigning specific clients (based on hardware addr) to a class and limitting what classes can be assigned out of specific pools. We don't need that for the current setup, but it is possible.
So given the one-pool-per-interface limitation, it does seem like you should still be able to pick an addr pool from one of the alias subnets. I'll just stick to dhcp relay for our needs, thanks for the pointers/info.
Yes, if you go through the trouble of setting up MAC addresses into certain classes you can do that, but it's far from automatic. At that point you may as well assign them static IPs in the other subnet.
(I don't think static IP/MAC settings have a gateway field, but it would not be difficult to add…)
Multiple pools in the same subnet would be nice, not sure how much effort that would take.