subnet-specific class

Chuck Anderson cra at WPI.EDU
Thu Apr 12 16:33:49 UTC 2007

On Thu, Apr 12, 2007 at 12:03:46PM -0400, Chuck Anderson wrote:
> class "Class-60P-i2004" {
>         match if (packet(24,3) = 82:d7:vv and substring (option vendor-class-identifier,0,14) = "Nortel-i2004-A");
>         vendor-option-space Nortel;
>         option Nortel.i2004-server-info "Nortel-i2004-A,130.215.v.w:4100,1,10;130.215.v.w:4100,1,10.";
> }
> class "Class-Nortel-i2004-A" {
>         match if substring (option vendor-class-identifier,0,14) = "Nortel-i2004-A";
>         vendor-option-space Nortel;
>         option Nortel.i2004-server-info "Nortel-i2004-A,130.215.x.y:4100,1,10;130.215.x.y:4100,1,10.";
> }
> The question is, which one wins if both match conditions are true?  In 
> my limited testing, the first one is matching for packets from the 
> 130.215.v relay agent.
> Is this deterministic?  What is the rule?  First class in config file 
> wins ?  Most specific match criteria wins?

I see more problems with this approach.  For unicast packets to the 
DHCP server, the giaddr is this won't work for them.  If I 
tried to use leased-address, I'm guessing this won't work either since 
the leased-address cannot always be determined yet, since class 
matching can influence pool selection and hence leased-address.

What I really need here is a way to access the underlying 
subnet-matching logic of the DHCP server.  Is there any way to match 
the incoming interface of a DHCP request, or the matched 
shared-network or subnet of the incoming packet?  Something like this:

match if subnet = 130.215.v.0/

where it would match if giaddr was in that subnet OR if the request 
came in on a local interface that matches that subnet.  I guess if 
there is a shared-network, it would have to match if ANY of the 
subnets in the shared network match.

Another approach would be to support subnet-specific classes with the 
class defined inside the subnet block.

More information about the dhcp-users mailing list