subnet-specific class

Chuck Anderson cra at WPI.EDU
Thu Apr 12 16:03:46 UTC 2007


On Wed, Apr 11, 2007 at 07:52:25PM -0500, Martin McCormick wrote:
> Chuck Anderson writes:
> > I would like to hand out different options to a class of devices,
> > depending on what subnet they are in.
> 
> 	You may find something you can use in the dhcp-eval man
> page.  There are lots of testable states described there and one
> caught my attention.  I haven't tried to use it, but it may be
> what you are looking for.

Ok, I used the packet function to match on the first 3 octets of the 
giaddr in the packet to effect a subnet match.  Here are my two 
classes, in the order they appear in the config file:

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?


More information about the dhcp-users mailing list