To add some filter rules in conf file

Ray Phillips r.phillips at uq.edu.au
Wed Oct 21 06:50:53 UTC 2009


>I want to drop clients if its option 60 has the string "VIP"...

Perhaps the 'switch' statement would be of use to you in assigning 
clients to classes.  I've not tried to use it and it appears not to 
be mentioned in any of the dhc* man pages, but Droms & Lemon 
describes it, so presumably it's available for use.  Quoting from 
Droms & Lemon, 2nd ed., pp. 476 - 477:

--------------------------------------------------------------------------------

The switch Statement

switch { expression-1 ) {
    case expression-2:
      [ statements ]
    case expression-3:
      [ statements ]
      break;
    ...
    default:
     [ statements ]
}

A switch statement allows the user to direct the DHCP program to 
compute the value of an expression and then compare it against a 
series of expressions, one in each case statement, until it finds one 
that matches.  Execution of the statements within the switch 
statement begins after the matching case statement.  If no case 
statement matches, then execution begins after the default statement, 
if there is one.  The syntax is much like that of the C switch 
statement, but the semantics are a bit different.  The expression in 
each case statement is evaluated at runtime, it does not have to be a 
constant.  Like the C switch/case statement, though, a break 
statement is required to exit the switch statement; otherwise, once 
execution of the switch statement has begun, it continues through 
case statements and default statements until the end of the switch 
statement is reached.

--------------------------------------------------------------------------------


Ray



More information about the dhcp-users mailing list