From time to time I find myself needing to treat one class of devices differently than another class of devices as dhcp clients. This becomes very common when dealing with sip phones, different phones need different/conflicting configuration parameters. The typical way to deal with this is to have an entry per device to specify how it will behave. That behavior doesn't scale very well unless you have an automated system to modify the dhcpd configuration on the fly. It turns out that dhcpd has quite a few advanced features that few people ever stumble upon. I will show you a couple here, there are several more at your disposal that I don't cover here. I strongly suggest exploring the dhcpd documentation to see what other tools you have at your disposal.
In my example I want to treat Snom IP phones differently than everything else. For those unfamiliar with VoIP phones, most phones on the market today support some form of automatic provisioning. Acquiring their configuration files from a central server, Snom phones need to be told more specifics than say Polycom phones for example. For a polycom phone you point it at the server and it will attempt to retrieve files in it's defined method. Snom phones give you more flexibility but along with that added complexity for dhcpd configuration.
Here is the dhcpd snippet to deal with this situation:
if binary-to-ascii(16, 32, "", substring(hardware, 0, 4)) = "1000413" {
log(info, "request from snom phone, setting proper options.");
option tftp-server-name "http://pbx1.yourdomain.com:80";
option bootfile-name "/phones/snom/{mac}.htm";
} else {
log(info, "Default case, setting basic tftp option");
option tftp-server-name "pbx1.yourdomain.com";
}
In the example we have some if/else logic the binary-to-ascii function which takes the hardware variable and makes it more user friendly and a substring command that peels off just the part of the string we care about. In my case I am matching on the first six characters of the mac address which is the prefix that has been assigned to Snom. If you need to be more or less specific you would simply modify the substring portion you are looking at. Assignments are made at the 6 character level so this should work for most cases. Some vendors will subdivide their MAC space with different prefixes underneath the 6 characters. If that is the case it would give you the granularity to handle each device class differently.
If you want to research the MAC assignments of vendors you can hop over to the IEEE website and perform look ups or download the entire database of assignments. That website can be found Here.
Note: Devices are not guaranteed to show up as being made by the actual manufacturer. If they use a component in their product manufactured by someone else it may have that vendor's mac prefix. When working with new device types it's very important to test and see what MACs they actually have been assigned. Luckily with phones they are typically on the bottom/back or accessible from the menus so you can figure it out before connecting the devices to the network.