1

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;
}
2
  • Why do you think that this question is kernel-related? Commented May 7, 2024 at 20:36
  • Yes, not related, removed the tag. Commented May 7, 2024 at 21:16

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.