<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <br>
    Found the problem.<br>
    <br>
    We were using 'host' statements for all clients before and had 'deny
    unknown-clients' globally set.  However when I converted the host
    statement to class+pool the deny unknown-clients prevented the
    client from getting an ip as there was no matching host statement
    anymore for this client.  <br>
    <br>
    After removing 'deny unknown-clients' everything magically worked.<br>
    <br>
    I threw out the binary-to-ascii in the mean time too. I was confused
    by the extra '1' that gets added at the front for some of the
    fields.<br>
    <br>
    By the way on my cisco Remote-id looks like '00:06:84:78:ac:84:e5:80'<br>
    <br>
    Nico<br>
    <br>
    <br>
    <div class="moz-cite-prefix">On 12/17/2012 05:07 AM, Sten Carlsen
      wrote:<br>
    </div>
    <blockquote cite="mid:50CE9A9A.4060800@s-carlsen.dk" type="cite">
      <meta content="text/html; charset=ISO-8859-1"
        http-equiv="Content-Type">
      From original mail:<br>
      <br>
      binary-to-ascii(16, 8, ":", substring(option agent.remote-id, 2,
      7)) = "84:78:ac:84:e5:80"<br>
      <br>
      Reformat to:<br>
      <br>
      binary-to-ascii(<br>
      16,                                          ---------> result
      is in hex<br>
       8,                                           ---------> it
      works in 8bit wide increments<br>
       ":",                                          --------->
      separator is a ":"<br>
       substring(<br>
      option agent.remote-id,          ---------> assumed to be a MAC
      address -> string of 6 bytes: 0x112233445566<br>
       2,<br>
       7<br>
      )                                              --------->
      0x1122 ->33445566<- This is the result of the substring
      operation.<br>
      )<br>
                                                     --------->
      result of binary-to-ascii should then be: "33:44:55:66" as a text
      string, 11 chars long.<br>
      <br>
       = "84:78:ac:84:e5:80"<br>
      <br>
      Something here is mysterious, not quite sure what. Can't see why
      this has ever been a match?<br>
      <br>
      <br>
      <div class="moz-cite-prefix">On 17/12/12 1:03, Glenn Satchell
        wrote:<br>
      </div>
      <blockquote
        cite="mid:0fdb64da16d1ccc8989293c1d987bc9d.squirrel@mail.uniq.com.au"
        type="cite">
        <pre wrap="">Hi Nico

Please see comments below.

On Mon, December 17, 2012 12:17 am, Nico De Ranter wrote:
</pre>
        <blockquote type="cite">
          <pre wrap="">Hi,



I'm trying to use DHCP option 82 to assign a different address to a host
depending on which network port it is connected to.
I'vve created the following section in my config:

############
stash-agent-options true;
...
subnet 10.103.0.0 netmask 255.255.255.0
{
        option routers 10.103.0.1;
        class "OK1Endo" {
                match if  binary-to-ascii(16, 8, ":", substring(option
agent.remote-id, 2, 7)) = "84:78:ac:84:e5:80"
</pre>
        </blockquote>
        <pre wrap="">This string "8 4 : 7 8 : ... : 8 0" is 17 characters long. So a 7 char
substring will never be equal to it. I can't see how it ever matches.</pre>
      </blockquote>
      Precedence: first substring, then binary-to-ascii, I still don't
      see the match.<br>
      <blockquote
        cite="mid:0fdb64da16d1ccc8989293c1d987bc9d.squirrel@mail.uniq.com.au"
        type="cite">
        <pre wrap="">
</pre>
        <blockquote type="cite">
          <pre wrap="">                        and     binary-to-ascii (16, 8, ":", hardware) =
"1:0:14:2d:40:f:15"
                        and     binary-to-ascii (16, 8, ":",
substring(option agent.circuit-id, 5, 5)) = "e";
</pre>
        </blockquote>
        <pre wrap="">This may or may not match. If the agent.circuit-id is exactly 5 characters
long it will return that last char only and if that is an 'e' then it will
match.

These can all be re-written without the binary-to-ascii and be much clearer:

match if substring(option agent.remote-id, 2, 7)) = 84:78:ac:84:e5:80
     and hardware = 1:0:14:2d:40:f:15
     and substring(option agent.circuit-id, 5, 1)) = e;

Finally, putting the class definition inside the subnet can cause some
unexpected inheritance. Probably ok if you only have a single subnet in
your definition, but better to put the class outside the subnet
definition.

</pre>
        <blockquote type="cite">
          <pre wrap="">        }
        pool {
                filename "pxelinux.0";
                next-server 10.103.0.202;
                option mobile-ip-home-agent 10.103.0.202;
                option log-servers 10.103.0.202;
                option tz "Europe/Brussels";
                use-host-decl-names on;
                allow members of "OK1Endo";
                range 10.103.0.220 10.103.0.220;
        }
  }
###########

I'm sure the class definition is correct and the pool matches as I also
added a log statement which only seems to trigger if the client matches
the
pool (if I change the class definition or remove the 'allow members' I
don't see the logs appearing in the log files anymore).

However the dhcpd server doesn't seem to send any reply to the host: in
tcpdump I see a bootp/dhcp request from the clients MAC but no replies
from
the server.  If I replace the 'pool' section with a simple 'host'
definition the server responds immediately.

Any ideas what I'm doing wrong?

Note: I'm using a very old version of dhcpd (3.1.1) which unfortunately I
cannot upgrade at the moment.
</pre>
        </blockquote>
      </blockquote>
      <br>
    </blockquote>
    <br>
    <div class="moz-signature">-- <br>
      <meta http-equiv="content-type" content="text/html;
        charset=ISO-8859-1">
      <title></title>
      <font size="2"><font color="#667788">Nico De Ranter</font></font><br>
      <font size="2"><font color="#667788">Operations Engineer</font></font><br>
      <font size="2"><font color="#667788">T. +32 16 38 72 10<br>
          M. +32 497 915 378</font></font><br>
      <br>
      <table cellpadding="0" cellspacing="0" width="100%">
        <tbody>
          <tr>
            <td valign="top">
              <table width="100%">
                <tbody>
                  <tr>
                    <td align="left" valign="top"> <img
                        src="cid:part1.03090602.01070703@esaturnus.com"
                        align="bottom" height="32" width="243"
                        border="0"> </td>
                  </tr>
                  <tr>
                    <td>
                      <table cellpadding="0" cellspacing="0"
                        width="100%">
                        <tbody>
                          <tr>
                            <td> <br>
                              <font size="2"><font color="#667788">eSATURNUS</font></font><br>
                              <font size="2"><font color="#667788">Romeinse

                                  straat 12</font></font><br>
                              <font size="2"><font color="#667788">3001
                                  Leuven – Belgium</font></font> </td>
                            <td> <br>
                              <font size="2"><font color="#667788">T.
                                  +32 16 40 12 82</font></font><br>
                              <font size="2"><font color="#667788">F.
                                  +32 16 40 84 77</font></font><br>
                              <font size="2"><font color="#667788"><a
                                    href="http://www.esaturnus.com">www.esaturnus.com</a></font></font>
                            </td>
                          </tr>
                        </tbody>
                      </table>
                    </td>
                  </tr>
                </tbody>
              </table>
            </td>
            <td>
              <div align="right"><a href="http://www.esaturnus.com"><img
                    src="cid:part3.07020706.08090102@esaturnus.com"
                    align="bottom" height="108" width="322" border="0"></a></div>
            </td>
          </tr>
        </tbody>
      </table>
      <br>
      <br>
    </div>
  </body>
</html>