Encapsulated match if

Olivier Bax de Keating olivier.baxdekeating.external at aastra.com
Tue Mar 4 10:38:58 UTC 2008


Hi,

 

I'm new to dhcpd servers, but I'd like to know if it's possible to filter devices on a vendor suboption, which depends on the vendor-class-identifier.
I give an example of what I'd like in the following lines. 

 

#codes device1
option space DEVICE1;
option DEVICE1.suboption1 code 3 = text;
option DEVICE1.suboption2 code 4 = unsigned integer 16;
 
#codes device2 (la suboption1 est commune aux deux appareils, mais n'a pas le même numéro de code)
option space DEVICE2;
option DEVICE2.suboption1 code 1 = text;
option DEVICE2.suboption3 code 3 = ip-address;
 
class "Device1" {
    match  if  substring    (option  vendor-class-identifier, 0, 15) = "Name of Device1";
    # Si l'appareil est de type DEVICE 1, le c'est le sous code 3 qui est testé
    vendor-option-space DEVICE1;
    match  if  substring    (option DEVICE1.suboption1, 0, 4) = "value1");
}
 
class "Device2" {
    match  if  substring    (option  vendor-class-identifier, 0, 15) = "Name of Device2";
    # Si l'appareil est de type DEVICE 2, le c'est le sous code 1 qui est testé
    vendor-option-space DEVICE2;
    match  if  substring    (option DEVICE2.suboption1, 0, 4) = "value1");
}
 
 
shared-network mynetwork{
    option server.min-lease-time 600000;
    option server.default-lease-time 700000;
    option server.max-lease-time 800000;
 
    subnet 127.0.0.1 netmask 255.255.255.0 {
        option tftp-server-name "localhost";
    }
 
    pool {
        allow members of "Device1";
        allow members of "Device2";
        range 127.0.0.10 127.0.0.40;
    }
}

 

The IPs and domain names are for the example only. In each classes, I put 2 "match if", and I know that this syntax is probably not correct. I'm searching for the good one, I mean, a way to encapsulate 2 conditions of match, with "if ..." if it exists, or subclasses (but it seems to me that they are not done for that ?)

Thx for all

 

Best regards

 

Olivier

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/dhcp-users/attachments/20080304/94a41340/attachment.html>


More information about the dhcp-users mailing list