I have Linux system running DHCP server which assigns less than 5 leases to a similar clients, always. The connecting client can have different MAC OUI(first 3 bytes) and client uses the MAC address as their "Client-Identifier".
To assign the lease to these client currently we have used below config file entries:
class "Devices" {
match if substring(hardware, 1,3) = AA:BB:CC;
}
class "Devices1" {
match if substring(hardware, 1,3) = DD:EE:FF;
}
class "Devices2" {
match if substring(hardware, 1,3) = GG:HH:II;
}
option subnet-mask 255.255.255.0;
option broadcast-address xx.xx.xx.255;
pool {
allow members of "Devices";
allow members of "Devices1";
allow members of "Devices2";
max-lease-time 86400;
range x1.x2.x3.x4 y1.y2.y3.y4;
}
But the host-name (option 12) is always constant for these client devices and can be used at server side to assign the leases.
Can you help me to get the below dhcpd config file that uses "host-name" received from clients and assign the leases if it matches expected string. Also, how to deny client that do not belong to this group having specific host-name? (
I tried as below, but it didn't work.
class "Devices" {
#match if substring(hardware, 1,3) = AA:BB:CC;
option host-name "CLIENT_ID";
}
pool {
allow members of "Devices"; # only one class for all possible clients
deny members of "OtherDevices"; # how to declare the class for this?
#allow members of "Devices1"; // Commented
#allow members of "Devices2"; // Commented
max-lease-time 86400;
range x1.x2.x3.x4 y1.y2.y3.y4;
}