Encapsulated match if

Perry, Keith Keith.Perry at sciatl.com
Fri Mar 7 21:25:12 UTC 2008


The working example below creates a Vendor Encapsulated Option Space called "SA" with sub-options 2-10, and then creates a class based on the sub-option 2 matching the ASCII text string of "ECM".   You can do a snoop or sniffer cap of the DHCP Discover issued by the client to determine which sub-options it utilizes and modify the example below accordingly. 

*********************************************************************
option space SA;
option SA.devtype     code 2  = text;
option SA.esafetype   code 3  = text;
option SA.sernum      code 4  = text;
option SA.hwver       code 5  = text;
option SA.swver       code 6  = text;
option SA.bootrom     code 7  = text;
option SA.OUI         code 8  = string;
option SA.modnum      code 9  = text;
option SA.vendor      code 10 = text;
option SA-43 code 43 = encapsulate SA;  [or  vendor-option-space "SA";]

# Create a class for embedded cable modems

class "eCM" {
	match if option SA.devtype = "ECM"; 
}
*********************************************************************
 

Keith



-----Original Message-----
From: dhcp-users-bounce at isc.org [mailto:dhcp-users-bounce at isc.org] On Behalf Of Olivier Bax de Keating
Sent: Thursday, March 06, 2008 5:01 AM
To: dhcp-users at isc.org
Subject: TR: Encapsulated match if

Hi Bruce,

Thx for the answer. Do u know a way to get informations about regular expressions in dhcpd v4 (samples ...)?

I have one last question : I'd like to do a "match if" on a vendor-encapsulated-options suboption.

I tried : 
#codes device1
option space DEVICE1;
option DEVICE1.suboption0 code 2 = unsigned integer 8; option DEVICE1.suboption1 code 3 = text;

class "Device1" {
    vendor-option-space DEVICE1;
    match  if  substring    (option DEVICE1.suboption1, 0, 6) = "value1");
}


To test it, I used dhcpcd and in the dhclient.conf, I put :
send vendor-encapsulated-options 02:01:12:03:06:76:61:6c:75:65:31

But it seemed not to work.

I googled on it and found http://www.lica.cz/admin/pool/dhcpd.conf this example.



class "AmiNET110 fisys" 
{
  match if (option vendor-class-identifier="Aminoaminet110fisys") or 
           ((substring( option vendor-encapsulated-options, 2, 9)="aminet110") 
            and (substring(option vendor-encapsulated-options, 13, 5)="fisys"));
  vendor-option-space AMINO;
  option AMINO.homepage "http://www.lica.cz";

They don't use the AMINO structure for the matches, but only for setting the encapsulated values.

I tried smthg like the previous example:

class "Device1" {
    match  if  substring    (option vendor-encapsulated-options, 5, 6) = "value1");
}


It worked, but this implies that the number and the length of the vendor-encapsulated-options shouldn't be modified between different versions of a same device (for example). So, is there a way to use the Buffer in the "match if" ?

Thx for all

Olivier




-----Message d'origine-----
De : Bruce Hudson [mailto:Bruce.Hudson at Dal.Ca] Envoyé : mercredi 5 mars 2008 16:45 À : Olivier Bax de Keating Objet : Re: Encapsulated match if


    Sorry about the previous garbage message.

    As I understand it, version 4.0 of the server should include operators 
that would allow you to do regular expression matching against the parameter
request list. That may allow you to find an parameter anywhere in the list.
--
Bruce A. Hudson				| Bruce.Hudson at Dal.CA
UCIS, Networks and Systems		|
Dalhousie University			|
Halifax, Nova Scotia, Canada		| (902) 494-3405




     - - - - - Appended by Scientific Atlanta, a Cisco company - - - - -         
This e-mail and any attachments may contain information which is confidential, 
proprietary, privileged or otherwise protected by law. The information is solely 
intended for the named addressee (or a person responsible for delivering it to 
the addressee). If you are not the intended recipient of this message, you are 
not authorized to read, print, retain, copy or disseminate this message or any 
part of it. If you have received this e-mail in error, please notify the sender 
immediately by return e-mail and delete it from your computer.



More information about the dhcp-users mailing list