matching vendor-encapsulated-options?

Ivan V. Borodin vanchik at yandex.ru
Wed Mar 22 15:59:37 UTC 2006


В ср, 22/03/2006 в 14:01 +0100, Johan Berglund пишет: 
> Dear Sirs,
> I'm trying to match clients based on information in the option 43
> suboptions.
> My goal is to be able to send the correct filename depending on the clients
> software version.
> The clients are sending their current version as a option 43 suboption along
> with other information.
> 
> I've played around with option spaces but that is just for send encapsulated
> options _to_ the client or am I wrong?
> 
> I would like to do something like this:
> 
> option space vendor;
> option vendor.swversion code 12 = text;
> 
> vendor-option-space vendor;
> 
> if substring (option vendor.swversion, 0, 9) = "Version 2" {
>    filename "swversion3.boot";
> }
> 
> 
I have some working installations with Motorola cable modems, which
sends option 43 in its DHCPDISCOVERs, where are a lot of info about
model numbers, software versions, etc. Look at this:

################################

option space MOTO;
option MOTO.devtype     code 2  = text;
option MOTO.esafetype   code 3  = text;
option MOTO.sernum      code 4  = text;
option MOTO.hwver       code 5  = text;
option MOTO.swver       code 6  = text;
option MOTO.bootrom     code 7  = text;
option MOTO.OUI         code 8  = string;
option MOTO.modnum      code 9  = text;
option MOTO.vendor      code 10 = text;
option MOTO.hwaddr      code 31 = string;
option MOTO.corrid      code 32 = integer 32;
option MOTO-43 code 43 = encapsulate MOTO;


class "upgrade" {
	match if ((option MOTO.devtype = "ECM") and (option MOTO.modnum = "SBV5120E") 
	and not (option MOTO.swver = "SBV5120E-2.10.1.2-SCM64-SHPC")); # the latest SW
        log(info, concat("Modem has SW ver. ", option MOTO.swver, " and will be updated now..."));
        filename "sbv_upd_2-10-1-2-scm64.bin";
        option PC-MTA.DHCP-server-1 0.0.0.0;
}

class "latest" {
	match if ((option MOTO.devtype = "ECM") and (option MOTO.modnum = "SBV5120E")
	and (option MOTO.swver = "SBV5120E-2.10.1.2-SCM64-SHPC"));
	filename "sbv5120e.bin";
	option PC-MTA.DHCP-server-1 MY.SERVER.IP.ADDRESS;
}

################################

It works not only with Motorola CMs, but with Scientfifc Atlanta too.

You can use Ethereal to capture packets to/from dhcpd and discover
suboption codes for your option



> 
> 

-- 
Ivan V. Borodin <ivan at vimcom.ru>
Support engineer
JSC "Vimcom Optic TS"
p. +7(495)-737-37-57
f. +7(495)-737-37-55



More information about the dhcp-users mailing list