Thanks agian Glenn.<div><br></div><div>I changed the config so it's now:</div><div><div><font face="'courier new', monospace"><br></font></div><div><font face="'courier new', monospace">option space vendor1;</font></div>
<div><font face="'courier new', monospace">option vendor1-encapsulation code 82 = encapsulate vendor1;</font></div><div><font face="'courier new', monospace">option vendor1.node code 1 = string;</font></div>
<div><font face="'courier new', monospace">option vendor1.vlan code 2 = string;</font></div><div><font face="'courier new', monospace">option vendor1.radio code 3 = string;</font></div>
<div><font face="'courier new', monospace">option vendor1.ssid code 4 = string;</font></div><div><font face="'courier new', monospace">option vendor1.gps code 5 = string;</font></div>
</div><div><br></div><div><font face="'courier new', monospace">log (info, concat("agent: ", option.vlan));</font></div><div><br></div><div>The idea with the log statement is to test if the server is deconding the suboption correctly before try to match anything.</div>
<div><br></div><div>But nothing is being logged.</div><div><div><font class="Apple-style-span" face="arial, helvetica, sans-serif">When I tried to define just one option (option vendor1.node code 9 = string) just "agent :" is logged.</font></div>
<div><font class="Apple-style-span" face="arial, helvetica, sans-serif"><br></font></div></div><div>Actually the vendor description is:</div><div><div><font class="Apple-style-span" face="'courier new', monospace"><div>
OptID 82</div><div>len 87</div><div>subopt ID 9</div><div>len 85</div><div>Enterprise Num 0x0 0x0 0x99 0x99</div><div>total_len 80</div><div># Sub ID 1: node mac, in string</div><div>subID 1</div><div>len 17</div><div>value 00:00:00:00:00:00</div>
<div># Sub ID 2: VLAN string</div><div>subID 2</div><div>len 8</div><div>value VLAN0999</div><div># Sub ID 3: radio mac, in string</div><div>subID 3</div><div>len 17</div><div>value 00:00:00:00:00:00</div><div># Sub ID 4: SSID name string</div>
<div>subID 4</div><div>len 8</div><div>value opt82Vlan</div><div># Sub ID 5: GPS coordinate string</div><div>subID 5</div><div>len 17</div><div>value 88.169472,77.338944</div><div><br></div><div>Seems that the server are not recognizing the supotions inside the option 82.</div>
<div>Is there a way to reference the whole option 82 so I can use substring to get each value?</div><div><br></div></font></div></div><div>[]</div><div>Eduardo F. J. de Castro<br clear="all"><div>CPqD - Telecommunications and IT R&D Center</div>
<div></div><br>
<br><br><div class="gmail_quote">2011/10/10 Glenn Satchell <span dir="ltr"><<a href="mailto:glenn.satchell@uniq.com.au" target="_blank">glenn.satchell@uniq.com.au</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
ok, so you still need to say "option agent ...".<br>
<br>
However, you can define your own option space where you specify the sub-options and dhcpd will unpack them for you. See the dhcp-options man page under "ENCAPSULATION". This will look at option numbers and string length, so it will work in a much more generic way, eg your assumption that the length of the string is always 5, and previous options always finish before position 60.<br>
<br>
It will be something like this (note I haven't tested this so it might need some adjustments). In the second line, code 9 refers to the sub-option code number. In the third line code 82 refers to the encapsulated option number.<br>
<br>
option space my-agent;<br>
# decode as many sub-options here as required, one per line<br>
option my-agent.ssid code 9 = text;<br>
<br>
# encapsulate these in one option<br>
option my-agent-encapsulate code 82 = encapsulate local;<br>
<br>
# use it like this<br>
match if (option my-agent.ssid = "SSID1");<br>
<br>
regards,<br>
-glenn<div><br>
<br>
On 10/10/11 22:36, Eduardo Ferreira Juca de Castro wrote:<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>
Thanks Glenn,<br>
<br>
But I need to match a vendor specific suboption. The ones you listed<br>
isn't in the packet.<br>
I'll handle just one vendor dhcp relay though, so I know the order the<br>
suboptions are packed.<br>
If I can't use the global agent how to get access to the vendor specific<br>
suboptions?<br>
<br>
[]<br>
Eduardo F. Jucá de Castro<br>
CPqD - Gerência de Serviços e Aplicações Multimídia<br>
Tel.: <a href="tel:%2B55%2019%203705-7238" value="+551937057238" target="_blank">+55 19 3705-7238</a> / Fax: <a href="tel:%2B55%2019%203705-5868" value="+551937055868" target="_blank">+55 19 3705-5868</a><br>
Cel.: <a href="tel:%2B55%2019%209603-4624" value="+551996034624" target="_blank">+55 19 9603-4624</a><br>
</div><a href="mailto:jucah@cpqd.com.br" target="_blank">jucah@cpqd.com.br</a> <mailto:<a href="mailto:jucah@cpqd.com.br" target="_blank">jucah@cpqd.com.br</a>><br>
<a href="http://www.cpqd.com.br" target="_blank">www.cpqd.com.br</a> <<a href="http://www.cpqd.com.br" target="_blank">http://www.cpqd.com.br</a>><br>
<br>
<br>
<br>
2011/10/9 Glenn Satchell <<a href="mailto:glenn.satchell@uniq.com.au" target="_blank">glenn.satchell@uniq.com.au</a><br>
<mailto:<a href="mailto:glenn.satchell@uniq.com.au" target="_blank">glenn.satchell@uniq.<u></u>com.au</a>>><div><div></div><div><br>
<br>
See man dhcp-options, I think you need to specify one of<br>
<br>
option agent.circuit-id<br>
option agent.remote-id<br>
option agent.DOCSIS-device-class<br>
option agent.link-selection<br>
<br>
You definitely need the "option" key word, otherwise it uses a variable<br>
named "agent" which is probably null.<br>
<br>
Using substring on the whole agent field may not extract it<br>
correctly, as<br>
the order of packing in the sub options could vary.<br>
<br>
regards,<br>
-glenn<br>
<br>
> I'm using a similar statement to match PXE clients (to<br>
differentiate from<br>
> when installed systems boot - the PXE boot rom sends a specific<br>
client<br>
> option, and we had out different settings to these clients...<br>
works on<br>
> dhcp 3.0.x and 4.2.x (tested) - seems similar to what you want,<br>
it might<br>
> help.. here's the config block (actual IP replaced with 1.2.3.4<br>
in this<br>
> example):<br>
><br>
><br>
><br>
> class "PXE" {<br>
> match if substring(option vendor-class-identifier, 0, 9) =<br>
> "PXEClient";<br>
> filename "pxelinux.0"<br>
> option vendor-class-identifier "PXEClient";<br>
> vendor-option-space PXE;<br>
> option PXE.mtftp-ip 0.0.0.0;<br>
> next-server 1.2.3.4;<br>
> }<br>
><br>
> sounds like you might need the 'option' keyword before 'agent' to<br>
match<br>
> what you're looking for?<br>
><br>
><br>
><br>
> ====================<br>
><br>
> Scott Stone <<a href="mailto:scott_stone@trendmicro.com" target="_blank">scott_stone@trendmicro.com</a><br></div></div>
<mailto:<a href="mailto:scott_stone@trendmicro.com" target="_blank">scott_stone@<u></u>trendmicro.com</a>>><div><br>
> Manager, DCS-RD<br>
> Trend Micro, Inc. <a href="http://www.trendmicro.com" target="_blank">http://www.trendmicro.com</a><br>
><br>
><br>
><br>
> From: dhcp-users-bounces+scott_<u></u>stone=<a href="mailto:trendmicro.com@lists.isc.org" target="_blank">trendmicro.com@lists.<u></u>isc.org</a><br></div>
<mailto:<a href="mailto:trendmicro.com@lists.isc.org" target="_blank">trendmicro.com@lists.<u></u>isc.org</a>><br>
> [mailto:<a href="mailto:dhcp-users-bounces%2Bscott_stone" target="_blank">dhcp-users-bounces+<u></u>scott_stone</a><br>
<mailto:<a href="mailto:dhcp-users-bounces%252Bscott_stone" target="_blank">dhcp-users-bounces%<u></u>2Bscott_stone</a>>=<a href="mailto:trendmicro.com@lists.isc.org" target="_blank">trendmicro.com@<u></u>lists.isc.org</a><br>
<mailto:<a href="mailto:trendmicro.com@lists.isc.org" target="_blank">trendmicro.com@lists.<u></u>isc.org</a>>] On<div><br>
> Behalf Of Eduardo Ferreira Juca de Castro<br>
> Sent: Sunday, October 09, 2011 12:07 PM<br></div>
> To: <a href="mailto:dhcp-users@lists.isc.org" target="_blank">dhcp-users@lists.isc.org</a> <mailto:<a href="mailto:dhcp-users@lists.isc.org" target="_blank">dhcp-users@lists.isc.<u></u>org</a>><div>
<br>
> Subject: How to match part of agent's vendor specific suboption<br>
><br>
><br>
><br>
> Hi,<br>
><br>
><br>
><br>
> I need to assign addresses based on a ssid information carried on<br>
agent's<br>
> (option 82) vendor specific suboption.<br>
><br>
> Do do so I defined classes this way:<br>
><br>
> class "myClass" {<br>
> match if substring(agent,60,5) = "SSID1";<br>
> }<br>
><br>
> and used it in pool statements but nothing happens.<br>
><br>
> I also tried to log things to see waht are beeing decoded but again<br>
> nothing happens.<br>
><br>
> if option dhcp-message-type = 1 {<br>
><br>
> log(info,concat("option82-<u></u>suboption9:<br>
> ",binary-to-ascii(16,8,"",<u></u>substring(agent,60,5))));<br>
><br>
> }<br>
><br>
><br>
><br>
> I'm using ISC DHCP 4.2.1.<br>
><br>
> Anyone can help me with this?<br>
><br>
><br>
><br>
> TIA<br>
><br>
><br>
><br>
> Regards,<br>
><br>
><br>
><br>
><br>
> Eduardo F. J. de Castro<br>
><br>
> CPqD - Telecommunications and IT R&D Center<br>
><br>
><br>
</div></blockquote><div><div></div><div>
______________________________<u></u>_________________<br>
dhcp-users mailing list<br>
<a href="mailto:dhcp-users@lists.isc.org" target="_blank">dhcp-users@lists.isc.org</a><br>
<a href="https://lists.isc.org/mailman/listinfo/dhcp-users" target="_blank">https://lists.isc.org/mailman/<u></u>listinfo/dhcp-users</a><br>
</div></div></blockquote></div><br></div>