<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><br><div>On 17 Jan 2018, at 22.27, Andrew Falanga (afalanga) <<a href="mailto:afalanga@micron.com">afalanga@micron.com</a>> wrote:<br><br></div><blockquote type="cite"><div><blockquote type="cite"><blockquote type="cite"><span>class "controller" {</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>   # tried matching based on two different styles I've seen on the net</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>   #match if substring(hardware, 1, 3) = 00:a0:45;</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>   match if (binary-to-ascii(16, 8, ":", substring(hardware, 0, 4)) =</span><br></blockquote></blockquote><blockquote type="cite"><span>"1:00:a0:45");</span><br></blockquote><blockquote type="cite"><blockquote type="cite"><span>   log(info, "found a controller");</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>}</span><br></blockquote></blockquote><blockquote type="cite"><span>Are you sure the “1:” is needed? I don’t think so.</span><br></blockquote><span></span><br><span>This is actually an irritating hole in the documentation.  It isn't truly clear what "hardware" returns nor is it made clear which method is "better" than the other.  I've tried both</span><br><span></span><br><span>match if substring(hardware, 1,3) = 00:a0:45;</span><br><span></span><br><span>and </span><br><span></span><br><span>match if (binary-to-ascii(16, 8, ":", substring(hardware, 0, 4)) = "1:00:a0:45");</span><br><span></span><br><span>The one thing I do know for sure, the hardware operator returns, in addition to the MAC, the "type" field which is part of the bootp/dhcp header.  In this case, because it is Ethernet, it is 1.  In the first match, I'm only looking for the MAC  so the address is from 1 - 3 of the hardware "data-string" (the docs name for it, it doesn't elaborate anywhere that I know what a *data-string* is, from the usage in the config file, it's a *string*).  I'm pretty sure the first form of usage could be re-written as</span><br><span></span><br><span>match if substring(hardware, 0, 3) = 1:00:a0:45;</span><br><span></span><br><span>but I truthfully haven't tested ti</span><br></div></blockquote>I Suggest trying:<div><blockquote type="cite"><font color="#000000"><span style="background-color: rgba(255, 255, 255, 0);">match if substring(hardware, 0, 3) = 00:a0:45;</span></font></blockquote>The 1: does not come on the wire.<br><blockquote type="cite"><div><span></span><br><span>Andy</span><br><span>_______________________________________________</span><br><span>dhcp-users mailing list</span><br><span><a href="mailto:dhcp-users@lists.isc.org">dhcp-users@lists.isc.org</a></span><br><span><a href="https://lists.isc.org/mailman/listinfo/dhcp-users">https://lists.isc.org/mailman/listinfo/dhcp-users</a></span></div></blockquote><div><span style="background-color: rgba(255, 255, 255, 0);">-- <br>Best regards<br><br>Sten Carlsen<br><br>No improvements come from shouting:<br><br>      "MALE BOVINE MANURE!!!"</span></div><div><span style="background-color: rgba(255, 255, 255, 0);"><br></span></div></div></body></html>