Class matching

Glenn Satchell glenn.satchell at uniq.com.au
Sun Oct 3 12:20:23 UTC 2010


On 10/03/10 20:16, Luka wrote:
> I'm sorry for sending this message as a new one and not as a reply, but
> I haven't received your replies and had to find them in the archives.
>
> Glenn Satchell:
>
> 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?
> ---
>
> Yes, there are many pools declared and I have tried to put the tftp
> option inside the pool with:
>
> if( option vendor-class-identifier = "some-vendor" ) {
> 	option tftp-server-name = "10.0.0.2";
> }
>
> but the clients still get the tftp from the a class.
>

Hmm, what about using groups, something like this?

class "spa" {
     match if (substring(hardware,1,3) = 00:01:02);
}

Subnets are declared as such:

# clients that need 10.0.0.1
group {
   option tftp-server-name "10.0.0.1";
   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 "spa";
         range 192.168.1.2 192.168.1.254;
     }
   }
   subnet ... {
   }
}
# clients that need 10.0.0.2
group {
   option tftp-server-name "10.0.0.2";
   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 "spa";
         range 192.168.2.2 192.168.2.254;
     }
   subnet ... {
   }
}

# or without grouping - use the same class definition above, but note
# there is no tftp-server defined in the class, only in the pool:
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 "spa";
         range 192.168.2.2 192.168.2.254;
         option tftp-server-name "10.0.0.2";
   }
}

regards,
-glenn



More information about the dhcp-users mailing list