Class matching

Glenn Satchell glenn.satchell at uniq.com.au
Fri Oct 1 13:16:20 UTC 2010


On 10/01/10 19:19, Luka wrote:
> 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.
>
Hi Luka

In this case a client with a suitable mac address will match *both* 
classes. So when it gets an address in the 192.168.2.0 subnet it got 
that because it matched class "b". But it also matches class "a", and 
perhaps because that is listed first in the defintions it uses that 
tftp-server name.

Possible workarounds include defining the option tftp-server-name in the 
pool, rather than the class. This may not be suitable if you have many 
pools.

Can you distinguish the two groups of machines any other way? Do you 
need two different tftp servers because the download file is different?

regards,
-glenn



More information about the dhcp-users mailing list