How to match part of agent's vendor specific suboption
Glenn Satchell
glenn.satchell at uniq.com.au
Mon Oct 10 00:46:58 UTC 2011
See man dhcp-options, I think you need to specify one of
option agent.circuit-id
option agent.remote-id
option agent.DOCSIS-device-class
option agent.link-selection
You definitely need the "option" key word, otherwise it uses a variable
named "agent" which is probably null.
Using substring on the whole agent field may not extract it correctly, as
the order of packing in the sub options could vary.
regards,
-glenn
> I'm using a similar statement to match PXE clients (to differentiate from
> when installed systems boot - the PXE boot rom sends a specific client
> option, and we had out different settings to these clients... works on
> dhcp 3.0.x and 4.2.x (tested) - seems similar to what you want, it might
> help.. here's the config block (actual IP replaced with 1.2.3.4 in this
> example):
>
>
>
> class "PXE" {
> match if substring(option vendor-class-identifier, 0, 9) =
> "PXEClient";
> filename "pxelinux.0"
> option vendor-class-identifier "PXEClient";
> vendor-option-space PXE;
> option PXE.mtftp-ip 0.0.0.0;
> next-server 1.2.3.4;
> }
>
> sounds like you might need the 'option' keyword before 'agent' to match
> what you're looking for?
>
>
>
> ====================
>
> Scott Stone <scott_stone at trendmicro.com>
> Manager, DCS-RD
> Trend Micro, Inc. http://www.trendmicro.com
>
>
>
> From: dhcp-users-bounces+scott_stone=trendmicro.com at lists.isc.org
> [mailto:dhcp-users-bounces+scott_stone=trendmicro.com at lists.isc.org] On
> Behalf Of Eduardo Ferreira Juca de Castro
> Sent: Sunday, October 09, 2011 12:07 PM
> To: dhcp-users at lists.isc.org
> Subject: How to match part of agent's vendor specific suboption
>
>
>
> Hi,
>
>
>
> I need to assign addresses based on a ssid information carried on agent's
> (option 82) vendor specific suboption.
>
> Do do so I defined classes this way:
>
> class "myClass" {
> match if substring(agent,60,5) = "SSID1";
> }
>
> and used it in pool statements but nothing happens.
>
> I also tried to log things to see waht are beeing decoded but again
> nothing happens.
>
> if option dhcp-message-type = 1 {
>
> log(info,concat("option82-suboption9:
> ",binary-to-ascii(16,8,"",substring(agent,60,5))));
>
> }
>
>
>
> I'm using ISC DHCP 4.2.1.
>
> Anyone can help me with this?
>
>
>
> TIA
>
>
>
> Regards,
>
>
>
>
> Eduardo F. J. de Castro
>
> CPqD - Telecommunications and IT R&D Center
>
>
> TREND MICRO EMAIL NOTICE
> The information contained in this email and any attachments is
> confidential and may be subject to copyright or other intellectual
> property protection. If you are not the intended recipient, you are not
> authorized to use or disclose this information, and we request that you
> notify us by reply mail or telephone and delete the original message from
> your mail system.
> _______________________________________________
> dhcp-users mailing list
> dhcp-users at lists.isc.org
> https://lists.isc.org/mailman/listinfo/dhcp-users
More information about the dhcp-users
mailing list