<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">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">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">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">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/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"><img alt="EMERGYA" width="80" border="0" src="https://drive.google.com/uc?export=view&id=1Qq3n-rKeCyFt3CQBeL55l8d_ynzEikrr" style="border: 0px; height: auto; width: 80px; padding: 6px;"></a><table cellpadding="0" cellspacing="0"><tbody><tr><td valign="top" style="width:305px;padding-bottom:3px;padding-left:10px;vertical-align:top;line-height:25px"><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 color="#0c2340" face="Roboto, Verdana, sans-serif"><span style="font-size:10pt"> </span></font><br><pre><font color="#444444" face="times new roman, serif"><b>Dto. de Soporte Interno</b></font><font color="#444444" face="Roboto, Verdana, sans-serif"><span style="font-size:13.3333px"><br></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 valign="top" 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"><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><br></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">jagarcia@emergya.com</a></span></span></td></tr><tr><td valign="top" style="font-size:10pt;font-family:Arial,sans-serif;padding-bottom:5px;padding-top:5px;padding-left:10px;vertical-align:top"><span><a href="https://www.linkedin.com/company/emergya" rel="noopener" target="_blank"><img border="0" width="23" alt="linkedin icon" src="https://drive.google.com/uc?export=view&id=14q9KMnHl26KNIOktIUE0SY3sPgQpFWS5" style="border: 0px; height: 23px; width: 23px;"></a> </span> <span><a href="https://www.facebook.com/Emergya" rel="noopener" target="_blank"><img border="0" width="23" alt="facebook icon" src="https://drive.google.com/uc?export=view&id=14LlHRBrAqHVDnAAy4ZeOiDWUtegdTCwT" style="border: 0px; height: 23px; width: 23px;"></a> </span> <span><a href="https://twitter.com/emergya" rel="noopener" target="_blank"><img border="0" width="23" alt="twitter icon" src="https://drive.google.com/uc?export=view&id=14LwyilYJrI3ovruB9yF8ZSF5YP0siLBp" style="border: 0px; height: 23px; width: 23px;"></a></span><span> </span> <span><a href="https://www.youtube.com/channel/UCU0ISPwk1pcOWwjpX63gN_A" rel="noopener" target="_blank"><img border="0" width="23" alt="youtube icon" src="https://drive.google.com/uc?export=view&id=14TBFW3LI-4fqSz3-Vqk9MM0B4wonpZVp" style="border: 0px; height: 23px; width: 23px;"></a> </span></td></tr></tbody></table></div></div></div></div></div></div></div></div></div></div></div></div></div>