To have various IP ranges in the same subnet and assign the IP Address depending of the device type that sends the request.

Juan Antonio García Moreno jagarcia at emergya.com
Wed Aug 7 12:42:42 UTC 2019


Hi Simon,

Too much thanks by your anotation about the Hosts Declarations. I will keep
them in mind and I will change it.

About the Hosts Classifications, I have tested this and works for me:

------------------------------------------------------------------------------
class "smartphones" {
  match if substring(option vendor-class-identifier,0,13) = "android-dhcp-"
or
           substring(option vendor-class-identifier,0,7) = "HUAWEI:" or
           substring(option vendor-class-identifier,0,7) = "dhcpcd-";
}
------------------------------------------------------------------------------

That is the same that this:

------------------------------------------------------------------------------
class "smartphones" {
  match option vendor-class-identifier;
}

subclass "smartphones" "android-dhcp-9"
subclass "smartphones" "android-dhcp-8.1.0"
subclass "smartphones" "android-dhcp-7.0"
subclass "smartphones" "HUAWEI:android:FIG-L11"
subclass "smartphones" "HUAWEI:android:QC_Reference_Phone"
subclass "smartphones" "dhcpcd-5.5.6"
------------------------------------------------------------------------------

And I can change it to:

------------------------------------------------------------------------------
class "smartphones" {
  match option vendor-class-identifier;
}

include smartphones.cfg

* smartphones.cfg file containing the subclass lines.
------------------------------------------------------------------------------

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?

Another question:

The iPhones and the iPads not send the "vendor-class-identifier" option in
the DHCP Discover Packet.

Could I classify iPhones and iPads taking into account some other parameter
of the DHCP Discover Packet?


Best regards



El lun., 5 ago. 2019 a las 19:35, Simon Hobson (<dhcp1 at thehobsons.co.uk>)
escribió:

> Juan Antonio García Moreno <jagarcia at emergya.com> wrote:
>
> > I relly have some hosts declarations, but I don't have put these in the
> post.
>
> Ah yes, about that ... see below !
>
> > subnet 10.53.0.0 netmask 255.255.0.0 {
> >
> >   default-lease-time 86400;
> >   max-lease-time 172800;
> >
> >   option broadcast-address 10.53.255.255;
> >   option routers 10.53.1.1;
> >
> >   # Unknown Clients Range.
> >   pool {
> >     deny members of "smartphones";
> >     range 10.53.33.1 10.53.35.254;
> >   }
> >
> >   # Smartphones Range.
> >   pool {
> >     allow members of "smartphones";
> >     range 10.53.10.2 10.53.11.254;
> >   }
> >
> >   host PC-01 {
> >     hardware ethernet ff:ff:ff:ff:ff:01;
> >     fixed-address 10.53.100.5;
> >   }
> >
> >   host PC-02 {
> >     hardware ethernet ff:ff:ff:ff:ff:02;
> >     fixed-address 10.53.100.6;
> >   }
> >
> > }
>
> 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.
> But what really makes life "interesting" (see
> https://en.wikipedia.org/wiki/May_you_live_in_interesting_times) 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 !
>
>
> > 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.
>
> 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.
>
> _______________________________________________
> dhcp-users mailing list
> dhcp-users at lists.isc.org
> https://lists.isc.org/mailman/listinfo/dhcp-users
>


-- 
[image: EMERGYA] <http://www.emergya.com/>
*Juan García*

*Dto. de Soporte Interno*

*EMERGYA INGENIERÍA*

*m:* +34 954 517 577

*p:* +34 954 517 577
*e:* jagarcia at emergya.com
[image: linkedin icon] <https://www.linkedin.com/company/emergya>  [image:
facebook icon] <https://www.facebook.com/Emergya>  [image: twitter icon]
<https://twitter.com/emergya>  [image: youtube icon]
<https://www.youtube.com/channel/UCU0ISPwk1pcOWwjpX63gN_A>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/dhcp-users/attachments/20190807/4cd7b43e/attachment.html>


More information about the dhcp-users mailing list