Question regarding client classes

Tor Houghton torh+dhcp-users at bogus.net
Wed May 20 08:17:38 UTC 2009


Ick, I mistakenly sent this to dhcp-hackers; I humbly apologise.

List,

I have a number of similar clients (phones) with the same vendor-id, but they
exist on different subnets.

How can I best set subnet-specific options for these classes?

I thought I would be able to define a bunch of "class" defines:

class "Phones-Subnet1" {
 match if substring (option vendor-class-identifier, 0, 3) = "SOFT";
 option soft-option "ip1=10.0.0.1;ip2=10.0.0.2;";
}

class "Phones-Subnet2" {
 match if substring (option vendor-class-identifier, 0, 3) = "SOFT";
 option soft-option "ip1=10.1.0.1;ip2=10.1.0.2;";
}

class "Phones-Subnet3" {
 match if substring (option vendor-class-identifier, 0, 3) = "SOFT";
 option soft-option "ip1=10.2.0.1;ip2=10.2.0.2;";
}

and then use a number of "shared-network" definitions, so:

shared-network "subnet1" {
 subnet 10.0.0.0 netmask 255.255.255.0 {
 option subnet-mask 255.255.255.0;
 option routers 10.0.0.254;
 default-lease-time 28800;
 max-lease-time 86400;
   pool {
      range 10.0.0.64 10.0.0.128;
      allow members of "Phones-Subnet1";
   }
 }
}

shared-network "subnet2" {
 subnet 10.1.0.0 netmask 255.255.255.0 {
 option subnet-mask 255.255.255.0;
 option routers 10.0.0.254;
 default-lease-time 28800;
 max-lease-time 86400;
   pool {
      range 10.1.0.64 10.1.0.128;
      allow members of "Phones-Subnet2";
   }
 }
}

shared-network "subnet3" {
 subnet 10.2.0.0 netmask 255.255.255.0 {
 option subnet-mask 255.255.255.0;
 option routers 10.2.0.254;
 default-lease-time 28800;
 max-lease-time 86400;
   pool {
      range 10.2.0.64 10.2.0.128;
      allow members of "Phones-Subnet3";
   }
 }
}

However, this does not appear to work (perhaps I missed something important
in the documentation ..); all networks are given options from the
Phones-Subnet1 class (I guess, first match ..).

What would the best work-around be? 

Kind regards,

Tor



More information about the dhcp-users mailing list