<div dir="ltr"><div><div>Glenn,<br><br></div>  Thanks - it is usually the obvious things - I thought that those were position values, not string lengths. I will give that try. <br><br></div>Adam<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, May 8, 2018 at 5:24 PM, Glenn Satchell <span dir="ltr"><<a href="mailto:glenn.satchell@uniq.com.au" target="_blank">glenn.satchell@uniq.com.au</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I think this might be it:<br>
<span class=""><br>
  match if (substring (host-name,0,4)) = “estax”);<br>
<br>
</span>The numbers in the substring() function are the offset and length. So<br>
you're comparing a 4 byte string with a 5 byte string - it'll never match!<br>
<br>
regards,<br>
-glenn<br>
<span class=""><br>
On Tue, May 8, 2018 11:20 am, Adam Raymond wrote:<br>
> All,<br>
><br>
><br>
><br>
>                 I have been having a long struggle to get the ISC DHCP<br>
> daemon to differentiate based on DHCP attributes so as to assign devices<br>
> to<br>
> different pools and trigger different scripts. I have 4 different models<br>
> at<br>
> the moment (and might expand this in the future) and the classes look like<br>
> this:<br>
><br>
><br>
><br>
> class "GE112Pro" {<br>
><br>
>         match if (option vendor-class-identifier) = "ADVA FSP<br>
> 150-GE112Pro"<br>
> ;<br>
><br>
> }<br>
><br>
><br>
><br>
> class "GE112ProH" {<br>
><br>
>         match if (option vendor-class-identifier) = "ADVA FSP 150-GE112Pro<br>
> (H)";<br>
><br>
> }<br>
><br>
><br>
><br>
> class "XP116Pro" {<br>
><br>
>         match if (option vendor-class-identifier) = "ADVA<br>
> FSP150CC-XG116PRO";<br>
><br>
> }<br>
><br>
><br>
><br>
> class "Overture" {<br>
><br>
</span>>         match if (substring (host-name,0,4)) = â€œestax†);<br>
<div><div class="h5">><br>
> }<br>
><br>
><br>
><br>
> The subnet assignment looks like this:<br>
><br>
><br>
><br>
> subnet 10.65.16.0 netmask 255.255.248.0 {<br>
><br>
>         interface eth0;<br>
><br>
>         option routers 10.65.23.254;<br>
><br>
>         option subnet-mask 255.255.248.0;<br>
><br>
>         option broadcast-address 10.65.23.255;<br>
><br>
><br>
><br>
>         set location = "VIC";<br>
><br>
><br>
><br>
>         pool {<br>
><br>
>                 allow members of "GE112Pro";<br>
><br>
>                 include "/etc/dhcp/GE112Pro.conf";<br>
><br>
>                 range 10.65.23.236 10.65.23.240;<br>
><br>
>         }<br>
><br>
><br>
><br>
>         pool {<br>
><br>
>                 allow members of "GE112ProH";<br>
><br>
>                 include "/etc/dhcp/GE112ProH.conf";<br>
><br>
>                 range 10.65.23.241 10.65.23.243;<br>
><br>
>         }<br>
><br>
>         pool {<br>
><br>
>                 allow members of "XP116Pro";<br>
><br>
>                 include "/etc/dhcp/XP116Pro.conf";<br>
><br>
>                 range 10.65.23.244 10.65.23.245;<br>
><br>
>         }<br>
><br>
>         pool {<br>
><br>
>                 allow members of "Overture";<br>
><br>
>                 include "/etc/dhcp/on-commit.conf";<br>
><br>
>                 range 10.65.23.246 10.65.23.249;<br>
><br>
>         }<br>
><br>
> }<br>
><br>
><br>
><br>
> The problem I have is that the Overture device is being ignored by the<br>
> DHCP<br>
> daemon when it receives a discover packet. This is what a TCPDUMP of the<br>
> discover packet looks like:<br>
><br>
><br>
><br>
> 01:46:27.024101 IP (tos 0x0, ttl 26, id 36818, offset 0, flags [none],<br>
> proto UDP (17), length 362)<br>
><br>
>     10.65.23.253.bootps > <a href="http://man01.syd04.nsw.vocus.net.au">man01.syd04.nsw.vocus.net.au</a>.<wbr>bootps: [udp sum<br>
> ok]<br>
> BOOTP/DHCP, Request from 00:0a:c6:51:1a:50 (oui Unknown), length 334, xid<br>
> 0x5a031d96, Flags [none] (0x0000)<br>
><br>
>           Gateway-IP 10.65.23.253<br>
><br>
>           Client-Ethernet-Address 00:0a:c6:51:1a:50 (oui Unknown)<br>
><br>
>           Vendor-rfc1048 Extensions<br>
><br>
>             Magic Cookie 0x63825363<br>
><br>
>             DHCP-Message Option 53, length 1: Discover<br>
><br>
>             PAD Option 0, length 0<br>
><br>
>             MSZ Option 57, length 2: 1024<br>
><br>
>             Parameter-Request Option 55, length 19:<br>
><br>
>               Server-ID, Lease-Time, RN, RB<br>
><br>
>               Subnet-Mask, Default-Gateway, Domain-Name-Server,<br>
> Domain-Name<br>
><br>
>               BR, NTP, BF, Option 224<br>
><br>
>               Option 225, Option 227, Option 228, Option 229<br>
><br>
>               Option 230, Option 231, Option 232<br>
><br>
>             PAD Option 0, length 0, occurs 3<br>
><br>
>             Hostname Option 12, length 15: "estax-51-1a-50^@"<br>
> <<<<< What I am trying to filter on<br>
><br>
>             PAD Option 0, length 0, occurs 3<br>
><br>
>             Client-ID Option 61, length 15: "estax-51-1a-50"<br>
><br>
>             PAD Option 0, length 0, occurs 3<br>
><br>
>             T232 Option 232, length 18:<br>
> 12346,12848,12595,12593,12848,<wbr>21553,13621,13104,13658<br>
><br>
>             END Option 255, length 0<br>
><br>
>             PAD Option 0, length 0<br>
><br>
><br>
><br>
> Have I missed something obvious? I have tried a number of different<br>
> combinations of syntax here, most of which are excepted when I do the<br>
> restart of the daemon. I even have a work around that works: if you remove<br>
</div></div>> the â€œOverture† class definition altogether and just create a generic<br>
<span class="">> pool<br>
> at the end of the pool definitions, the DHCP daemon responds to the<br>
> requests, assigning a correct IP address and triggering the<br>
</span>> â€œon-commit.conf† configuration.<br>
<span class="im HOEnZb">><br>
><br>
><br>
> Would welcome any suggestions on what I have missed.<br>
><br>
> Adam Raymond<br>
</span><div class="HOEnZb"><div class="h5">> ______________________________<wbr>_________________<br>
> dhcp-users mailing list<br>
> <a href="mailto:dhcp-users@lists.isc.org">dhcp-users@lists.isc.org</a><br>
> <a href="https://lists.isc.org/mailman/listinfo/dhcp-users" rel="noreferrer" target="_blank">https://lists.isc.org/mailman/<wbr>listinfo/dhcp-users</a><br>
><br>
<br>
<br>
______________________________<wbr>_________________<br>
dhcp-users mailing list<br>
<a href="mailto:dhcp-users@lists.isc.org">dhcp-users@lists.isc.org</a><br>
<a href="https://lists.isc.org/mailman/listinfo/dhcp-users" rel="noreferrer" target="_blank">https://lists.isc.org/mailman/<wbr>listinfo/dhcp-users</a><br>
</div></div></blockquote></div><br></div>