Dynamically assign Option to Clients:

Patrick Trapp ptrapp at nex-tech.com
Wed Nov 15 18:01:01 UTC 2017


I am far from an expert here, but we are successfully using class statements. It appears that you may be using the class statement to do too much. We only use the class statement to identify what devices qualify for the class. Then in the pool, we use allow statements to determine what classes of device qualify. We are using option-82 information to determine what class the device belongs in, as shown below.

class “end-point-device”
{       match if
        (
                (substring (option agent.circuit-id, 0, 4) = "PREF")
                and not
                (suffix (option agent.circuit-id, 5) = "SUFFI")
        );
}
class "residential-gateway"
{       match if
        (
                (substring (option agent.circuit-id, 0, 4) = "PREF")
                and
                (suffix (option agent.circuit-id, 5) = "SUFFI")
        );
}

How much variation will you have for the options you are trying to declare in the class block?
From: dhcp-users [mailto:dhcp-users-bounces at lists.isc.org] On Behalf Of MA2412 at gmx.de
Sent: Wednesday, November 15, 2017 10:42 AM
To: dhcp-users at lists.isc.org
Subject: Dynamically assign Option to Clients:

Hello, i have a central dhcp server serving multiple remote networks. I want to assign the same group of options to Clients wo are on different Networks, based on MAC adress or better on hostnames. I tried to solve it over a "class" declaration, but it seams that classes are only woking in conjunction with "pools" or "subnets" or "ranges", a class declaration itself has no effect is this correkt?

For example i try:

class "phones" {
  option ntp-servers ntp.mydomain.com;
  option tftp-server-name "https://tftp.mydomain.com";
  default-lease-time 600;
  max-lease-time 600;
  match host-name;
}

host tel132 {
   hardware ethernet 12:04:13:87:1c:41;
   fixed-address 172.30.20.32;
   option host-name "phone132";
#Location: office
}
subclass "phones" "phone132";


The phone should get a fixed IP adress and the options defined in the class.
I also tried the following declaration:

class "phones" {
  option ntp-servers ntp.mydomain.com;
  option tftp-server-name "https://tftp.mydomain.com";
  default-lease-time 600;
  max-lease-time 600;
  match if substring(option host-name,0,7) = "phone132";
}
host tel132 {
   hardware ethernet 12:04:13:87:1c:41;
   fixed-address 172.30.20.32;
   option host-name "phone132";
#Location: office
}

Should have the same effect, but also des not work, as expected above, i thind class declaration does not work if not assigned to a pool or subnet or range.

Can a client be assigned to multiple classes, is this possible or can a client only be member of one class?

Thanks for your help!!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/dhcp-users/attachments/20171115/2854e6be/attachment-0001.html>


More information about the dhcp-users mailing list