Assign next server depending on mac vendor

Glenn Satchell Glenn.Satchell at uniq.com.au
Tue Jan 5 01:02:47 UTC 2010


>From: Isc Dhcp <red1dhcp at gmail.com>
>To: "dhcp-users at lists.isc.org" <dhcp-users at lists.isc.org>
>Subject: Assign next server depending on mac vendor
>Date: Mon, 4 Jan 2010 19:45:23 +0300
>X-BeenThere: dhcp-users at lists.isc.org
>
>
>Dear members
>
>My network is composed of nodes manufactured by differents vendors,  
>can I assign next server ip whithin same pool depending on vendor  
>mac.Each vendor has specific next server config, Please send me the  
>config
>Regards
>Red1 

Hi Red1

This is fairly straight forward to do. Create a class for each vendor
that matches on a substring of the mac address. Inside the class
define the next-server and any other settings specific to this vendor.

class "vendor1" {
	match if substring(hardware, 0, 3) = 0a:0b:0c;
	next-server v1.example.com;
}
class "vendor2" {
	match if substring(hardware, 0, 3) = 01:02:03;
	next-server v2.example.com;
}

There is no need to allow or deny this class in pools as the membership
of the class defines the next-server.

It would also be possible to do this with subclasses. Whether that is
more efficient probably depends on how many vendors you think you'll
need to allow for. I do recall that one way uses a linear search and
the other uses a hash lookup.

class "vendors" {
	match substring(hardware, 0, 3);
}
subclass "vendors" 0a:0b:0c { next-server v1.example.com; }
subclass "vendors" 01:02:03 { next-server v2.example.com; }

The relevant man pages for class and subclass is "dhcpd.conf",
substring is in "dhcp-eval". There are examples in both man pages.

regards,
-glenn




More information about the dhcp-users mailing list