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

Sten Carlsen stenc at s-carlsen.dk
Thu Aug 1 16:00:42 UTC 2019



> What Sten is doing is as described in the manual (man dhcpd.conf) section under subclassing. So your "laptop" class might look like :
> class "laptop" {
>   match pick-first-value (option dhcp-client-identifier, hardware);
> }
> subclass "laptop" 1:aa:bb:cc:dd:ee:ff ;
> subclass "laptop" 1:ff:ee:dd:cc:bb:aa ;
> ...
> This works if you know (in advance, or at least as they are "registered" onto the network) the client ID and/or MAC address for each device, it doesn't work if devices can just come and go as they please.
>
Examples of how my files look, only relevant details are shown:
dhcpd.conf:


# class definitions
class "gateway-0" {
     match hardware;
    }


class "gateway-5" {
     match hardware;
    }

# Subnet Declarations
shared-network hjemme{
    authoritative;

    subnet 192.168.16.0 netmask 255.255.255.0{
        option domain-name        "xx";
        option domain-name-servers    192.168.16.20;
        option domain-name-servers    xx;
        option subnet-mask        255.255.255.0;
        # B-NODE: Broadcast - no WINS
        option netbios-node-type    1;
        pool{
            # NO router - these must not touch the internet
            allow members of        "gateway-0";
            range 192.168.16.160        192.168.16.195;
        }
        pool{
            # these go to the FIBER link
            option routers            192.168.16.5;
            allow members of        "gateway-5";
            range 192.168.16.50        192.168.16.150;
        }
    }

    subnet 192.168.161.0  netmask 255.255.255.0{
        max-lease-time 300;
        default-lease-time 150;
        pool{
            # These are not known (yet) and shall not see any other host
            deny known-clients;
            deny members of            "gateway-0";
            deny members of            "gateway-5";
            range 192.168.161.100        192.168.161.150;
        }
    }

}


include "/etc/dhcp/subclass.conf";

subclass.conf:

subclass "gateway-0" 1:00:18:4d:58:a3:ae;
subclass "gateway-0" 1:00:1c:42:84:58:bd;
subclass "gateway-0" 1:00:1d:b3:cb:65:80 {ddns-hostname procurve-1;}
subclass "gateway-0" 1:00:40:8C:29:1E:AE;
subclass "gateway-0" 1:00:80:f0:8f:fd:27;
subclass "gateway-0" 1:00:80:f0:a0:02:40;
subclass "gateway-0" 1:28:10:7b:10:5c:a2 {ddns-hostname argus4;}
subclass "gateway-0" 1:de:ad:be:ef:fe:ed {ddns-hostname ard;}
subclass "gateway-5" 1:00:11:32:05:BB:E9 {always-broadcast
on;ddns-hostname ds-209;}
subclass "gateway-5" 1:00:16:cb:95:7a:7c;
subclass "gateway-5" 1:00:17:f2:41:7c:ff;
subclass "gateway-5" 1:00:18:56:22:d6:93;
subclass "gateway-5" 1:00:1b:63:05:99:1b;
subclass "gateway-5" 1:00:1b:63:1d:1a:f4;
subclass "gateway-5" 1:00:1e:c2:14:ee:7b;
subclass "gateway-5" 1:00:1e:c2:a6:f5:35;


Sten
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/dhcp-users/attachments/20190801/8794bc4c/attachment.html>


More information about the dhcp-users mailing list