Class matching

Adam Moffett adamlists at plexicomm.net
Fri Oct 1 17:46:51 UTC 2010


  Luka,

A similar issue came up for me recently.  If a client matches two 
classes, the result may be difficult to predict.  I resolved it by 
writing more complex match rules in classes to ensure that each client 
would only match one class.

However, in the sample you posted, I don't think you actually need a 
class to define the tftp-server-name option.

Try this:
subnet 192.168.2.0 netmask 255.255.255.0 {

	option routers 192.168.2.1;
	option subnet-mask 255.255.255.0;
	option broadcast-address 192.168.2.255;
	if substring(hardware,1,3) = 00:01:02 {
		option tftp-server-name "10.0.0.2";
	}
	pool {
		range 192.168.2.2 192.168.2.254;
	}
}



> Hi,
>
> I have a problem with matching classes from different pools. I have two,
> almost identical classes:
>
> class "a" {
> 	match if (substring(hardware,1,3) = 00:01:02);
> 	option tftp-server-name "10.0.0.1";
> }
>
> class "b" {
> 	match if (substring(hardware,1,3) = 00:01:02);
> 	option tftp-server-name "10.0.0.2";
> }
>
> Subnets are declared as such:
>
> subnet 192.168.1.0 netmask 255.255.255.0 {
> 	option routers 192.168.1.1;
> 	option subnet-mask 255.255.255.0;
> 	option broadcast-address 192.168.1.255;
> 	pool {
> 		allow members of "a";
> 		range 192.168.1.2 192.168.1.254;
> 	}
> }
>
> subnet 192.168.2.0 netmask 255.255.255.0 {
> 	option routers 192.168.2.1;
> 	option subnet-mask 255.255.255.0;
> 	option broadcast-address 192.168.2.255;
> 	pool {
> 		allow members of "b";
> 		range 192.168.2.2 192.168.2.254;
> 	}
> }
>
> When clients come from 192.168.2.0/24 network, they get the address from
> the second pool, which means they match class b, but the tftp server
> sent is from class a. If I comment out the tftp option in class a, then
> the clients get the right tftp option.
>
> There aren't any global tftp options in the rest of the configuration
> and no duplicate pools were created.
>
> I think I'm missing something, but just can't see it.
>
>
>
> _______________________________________________
> dhcp-users mailing list
> dhcp-users at lists.isc.org
> https://lists.isc.org/mailman/listinfo/dhcp-users
>




More information about the dhcp-users mailing list