<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    Here's a couple of classes you might find useful:<br>
    <font color="#993300"><tt>class "mobile_device" {</tt><tt><br>
      </tt><tt>    match if (</tt><tt><br>
      </tt><tt>        option vendor-class-identifier ~~ "android"</tt><tt><br>
      </tt><tt>        or option host-name ~~ "android"</tt><tt><br>
      </tt><tt>        or option host-name ~~ "iphone"</tt><tt><br>
      </tt><tt>        or option host-name ~~ "samsung-"</tt><tt><br>
      </tt><tt>        or option host-name ~~ "galaxy"</tt><tt><br>
      </tt><tt>        or option host-name ~~ "ipod"</tt><tt><br>
      </tt><tt>        or option host-name ~~ "ipad"</tt><tt><br>
      </tt><tt>        or option host-name ~~ "watch"</tt><tt><br>
      </tt><tt>        or option host-name ~~ "nintendo 3ds"</tt><tt><br>
      </tt><tt>    );</tt><tt><br>
      </tt><tt>}</tt><tt><br>
      </tt><tt>class "Microsoft" {</tt><tt><br>
      </tt><tt>    match if substring(option vendor-class-identifier, 0,
        4) = "MSFT";</tt><tt><br>
      </tt><tt>    set member_of = "Microsoft";</tt><tt><br>
      </tt><tt>}</tt><tt><br>
      </tt></font>The first class uses the regexp operator ~~ (case
    insensitive).  There is also the<br>
    case sensitive operator ~=.<br>
    <br>
    On the subject of implicit deny for a pool with only "allow
    members":<br>
    I classify most of my devices (i.e. Panasonic, Ricoh, Canon, Linux,
    Microsoft) to assign<br>
    them to a specific pool (i.e Printers, Linux, Microsoft,
    mobile_device).  Then I have an<br>
    "uncategorized" pool for those devices that aren't in a currently
    defined class so that they<br>
    will get an address.  If later I change a class to include a device
    (say Epson), that device<br>
    will request its previous address on renew and <b>will get it</b>
    if my "uncategorized" pool doesn't<br>
    have a 'deny members of "Epson"' configuration line.<br>
    <br>
    TL;DR - If a device requests a renewal of an address and there is no
    "deny members" for<br>
    the pool, it will be granted.<br>
    <br>
    dhcp-server-4.3.6-10.fc27.x86_64<br>
    <br>
    Bill<br>
    <br>
    <div class="moz-cite-prefix">On 8/7/2019 8:42 AM, Juan Antonio
      García Moreno wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAJbOvPGQO_FMTy-wQjqy+unzoOg1ncb9FSUZ1Gn-w+TN_NrVdA@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">
        <div>Hi Simon,<br>
          <br>
          Too much thanks by your anotation about the Hosts
          Declarations. I will keep them in mind and I will change it.<br>
          <br>
          About the Hosts Classifications, I have tested this and works
          for me:<br>
          <br>
------------------------------------------------------------------------------<br>
          class "smartphones" {<br>
            match if substring(option vendor-class-identifier,0,13) =
          "android-dhcp-" or<br>
                     substring(option vendor-class-identifier,0,7) =
          "HUAWEI:" or<br>
                     substring(option vendor-class-identifier,0,7) =
          "dhcpcd-";<br>
          }<br>
------------------------------------------------------------------------------<br>
          <br>
          That is the same that this:<br>
          <br>
------------------------------------------------------------------------------<br>
          class "smartphones" {<br>
            match option vendor-class-identifier;<br>
          }<br>
          <br>
          subclass "smartphones" "android-dhcp-9"<br>
          subclass "smartphones" "android-dhcp-8.1.0"<br>
          subclass "smartphones" "android-dhcp-7.0"<br>
          subclass "smartphones" "HUAWEI:android:FIG-L11"<br>
          subclass "smartphones" "HUAWEI:android:QC_Reference_Phone"<br>
          subclass "smartphones" "dhcpcd-5.5.6"<br>
------------------------------------------------------------------------------<br>
          <br>
          And I can change it to:<br>
          <br>
------------------------------------------------------------------------------<br>
          class "smartphones" {<br>
            match option vendor-class-identifier;<br>
          }<br>
          <br>
          include smartphones.cfg<br>
          <br>
          * smartphones.cfg file containing the subclass lines.<br>
------------------------------------------------------------------------------<br>
          <br>
          But, is there any way to minimize the number of lines to
          include in the smartphones.cfg file using some kind of
          wildcard or expression/function like "substring()" used in the
          Class Declaration?<br>
          <br>
          Another question:<br>
          <br>
          The iPhones and the iPads not send the
          "vendor-class-identifier" option in the DHCP Discover Packet.<br>
          <br>
          Could I classify iPhones and iPads taking into account some
          other parameter of the DHCP Discover Packet?<br>
          <br>
          <br>
          Best regards<br>
        </div>
        <div><br>
        </div>
        <div><br>
        </div>
        <br>
        <div class="gmail_quote">
          <div dir="ltr" class="gmail_attr">El lun., 5 ago. 2019 a las
            19:35, Simon Hobson (<<a
              href="mailto:dhcp1@thehobsons.co.uk"
              moz-do-not-send="true">dhcp1@thehobsons.co.uk</a>>)
            escribió:<br>
          </div>
          <blockquote class="gmail_quote" style="margin:0px 0px 0px
            0.8ex;border-left:1px solid
            rgb(204,204,204);padding-left:1ex">Juan Antonio García
            Moreno <<a href="mailto:jagarcia@emergya.com"
              target="_blank" moz-do-not-send="true">jagarcia@emergya.com</a>>
            wrote:<br>
            <br>
            > I relly have some hosts declarations, but I don't have
            put these in the post.<br>
            <br>
            Ah yes, about that ... see below !<br>
            <br>
            > subnet 10.53.0.0 netmask 255.255.0.0 {<br>
            > <br>
            >   default-lease-time 86400;<br>
            >   max-lease-time 172800;<br>
            > <br>
            >   option broadcast-address 10.53.255.255;<br>
            >   option routers 10.53.1.1;<br>
            > <br>
            >   # Unknown Clients Range.<br>
            >   pool {<br>
            >     deny members of "smartphones";<br>
            >     range 10.53.33.1 10.53.35.254;<br>
            >   }<br>
            > <br>
            >   # Smartphones Range.<br>
            >   pool {<br>
            >     allow members of "smartphones";<br>
            >     range 10.53.10.2 10.53.11.254;<br>
            >   }<br>
            > <br>
            >   host PC-01 {<br>
            >     hardware ethernet ff:ff:ff:ff:ff:01;<br>
            >     fixed-address 10.53.100.5;<br>
            >   }<br>
            > <br>
            >   host PC-02 {<br>
            >     hardware ethernet ff:ff:ff:ff:ff:02;<br>
            >     fixed-address 10.53.100.6;<br>
            >   }<br>
            > <br>
            > }<br>
            <br>
            That is another common mistake. Host declarations are always
            global in scope even though you might think that putting
            them inside a subnet declaration would tie them to that
            subnet. So even though declared inside one subnet, they will
            be "known" in any subnet - which in itself can cause
            considerable confusion.<br>
            But what really makes life "interesting" (see <a
              href="https://en.wikipedia.org/wiki/May_you_live_in_interesting_times"
              rel="noreferrer" target="_blank" moz-do-not-send="true">https://en.wikipedia.org/wiki/May_you_live_in_interesting_times</a>)
            is that should a host be connected to a different network,
            it will inherit option values from the subnet where it is
            defined. Thus you find yourself with a client that's been
            given an address by DHCP, but the gateway address it's been
            given is in a completely different subnet !<br>
            <br>
            <br>
            > And too, howto fill a text file with the
            "vendor-class-identifier" of the smartphones and include in
            the DHCP Server config to match the smartphones devices too.<br>
            <br>
            It's a simple scripting exercise to take a text file
            containing one string per line, and build a config file
            snippet. You can then use an include statement to
            incorporate that config snippet into the daemon config.<br>
            <br>
            _______________________________________________<br>
            dhcp-users mailing list<br>
            <a href="mailto:dhcp-users@lists.isc.org" target="_blank"
              moz-do-not-send="true">dhcp-users@lists.isc.org</a><br>
            <a href="https://lists.isc.org/mailman/listinfo/dhcp-users"
              rel="noreferrer" target="_blank" moz-do-not-send="true">https://lists.isc.org/mailman/listinfo/dhcp-users</a><br>
          </blockquote>
        </div>
        <br clear="all">
        <div><br>
        </div>
        -- <br>
        <div dir="ltr" class="gmail_signature">
          <div dir="ltr">
            <div>
              <div dir="ltr">
                <div>
                  <div dir="ltr">
                    <div>
                      <div dir="ltr">
                        <div>
                          <div dir="ltr">
                            <div dir="ltr">
                              <div dir="ltr"><a
                                  href="http://www.emergya.com/"
                                  rel="noopener" alt="www.emergya.com"
                                  target="_blank" moz-do-not-send="true"><img
                                    alt="EMERGYA"
src="https://drive.google.com/uc?export=view&id=1Qq3n-rKeCyFt3CQBeL55l8d_ynzEikrr"
                                    style="border: 0px; height: auto;
                                    width: 80px; padding: 6px;"
                                    moz-do-not-send="true" width="80"
                                    border="0"></a>
                                <table cellspacing="0" cellpadding="0">
                                  <tbody>
                                    <tr>
                                      <td
style="width:305px;padding-bottom:3px;padding-left:10px;vertical-align:top;line-height:25px"
                                        valign="top"><strong
style="color:rgb(12,35,64);font-family:Roboto,Verdana,sans-serif;font-size:10pt"><span
style="font-size:12pt;color:rgb(239,51,64)">Juan García</span></strong><font
                                          face="Roboto, Verdana,
                                          sans-serif" color="#0c2340"><span
                                            style="font-size:10pt"> </span></font><br>
                                        <pre><font face="times new roman, serif" color="#444444"><b>Dto. de Soporte Interno</b></font><font face="Roboto, Verdana, sans-serif" color="#444444"><span style="font-size:13.3333px">
</span></font></pre>
                                        <span
style="color:rgb(12,35,64);font-family:Roboto,Verdana,sans-serif;font-size:11pt"><strong>EMERGYA
                                            INGENIERÍA</strong></span></td>
                                    </tr>
                                    <tr>
                                      <td
style="font-size:10pt;color:rgb(68,68,68);font-family:Roboto,Verdana,sans-serif;padding-bottom:3px;padding-top:3px;padding-left:10px;vertical-align:top"
                                        valign="top"><span>
                                          <pre><strong style="font-family:Roboto,Verdana,sans-serif;color:rgb(12,35,64);font-size:13.3333px">m:</strong><span style="font-size:10pt;font-family:Arial,sans-serif"> +34 954 517 577</span>
</pre>
                                        </span><span><span
                                            style="color:rgb(12,35,64)"><strong>p:</strong></span><span
style="font-size:10pt;font-family:Arial,sans-serif"> +34 954 517 577<br>
                                          </span></span><span><span
                                            style="color:rgb(12,35,64)"><strong>e:</strong></span><span
style="font-size:10pt;font-family:Arial,sans-serif"> <a
                                              href="mailto:jagarcia@emergya.com"
                                              target="_blank"
                                              moz-do-not-send="true">jagarcia@emergya.com</a></span></span></td>
                                    </tr>
                                    <tr>
                                      <td
style="font-size:10pt;font-family:Arial,sans-serif;padding-bottom:5px;padding-top:5px;padding-left:10px;vertical-align:top"
                                        valign="top"><span><a
                                            href="https://www.linkedin.com/company/emergya"
                                            rel="noopener"
                                            target="_blank"
                                            moz-do-not-send="true"><img
                                              alt="linkedin icon"
src="https://drive.google.com/uc?export=view&id=14q9KMnHl26KNIOktIUE0SY3sPgQpFWS5"
                                              style="border: 0px;
                                              height: 23px; width:
                                              23px;"
                                              moz-do-not-send="true"
                                              width="23" border="0"></a> </span> <span><a
href="https://www.facebook.com/Emergya" rel="noopener" target="_blank"
                                            moz-do-not-send="true"><img
                                              alt="facebook icon"
src="https://drive.google.com/uc?export=view&id=14LlHRBrAqHVDnAAy4ZeOiDWUtegdTCwT"
                                              style="border: 0px;
                                              height: 23px; width:
                                              23px;"
                                              moz-do-not-send="true"
                                              width="23" border="0"></a> </span> <span><a
href="https://twitter.com/emergya" rel="noopener" target="_blank"
                                            moz-do-not-send="true"><img
                                              alt="twitter icon"
src="https://drive.google.com/uc?export=view&id=14LwyilYJrI3ovruB9yF8ZSF5YP0siLBp"
                                              style="border: 0px;
                                              height: 23px; width:
                                              23px;"
                                              moz-do-not-send="true"
                                              width="23" border="0"></a></span><span> </span> <span><a
href="https://www.youtube.com/channel/UCU0ISPwk1pcOWwjpX63gN_A"
                                            rel="noopener"
                                            target="_blank"
                                            moz-do-not-send="true"><img
                                              alt="youtube icon"
src="https://drive.google.com/uc?export=view&id=14TBFW3LI-4fqSz3-Vqk9MM0B4wonpZVp"
                                              style="border: 0px;
                                              height: 23px; width:
                                              23px;"
                                              moz-do-not-send="true"
                                              width="23" border="0"></a> </span></td>
                                    </tr>
                                  </tbody>
                                </table>
                              </div>
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
dhcp-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:dhcp-users@lists.isc.org">dhcp-users@lists.isc.org</a>
<a class="moz-txt-link-freetext" href="https://lists.isc.org/mailman/listinfo/dhcp-users">https://lists.isc.org/mailman/listinfo/dhcp-users</a>
</pre>
    </blockquote>
  </body>
</html>