DHCPv6 client classification based on DUID.

Рязанцев Андрей kardox at mail.ru
Tue Sep 18 17:08:42 UTC 2012


Greetings, everyone.

I'm trying to configure isc-dhcp daemon on my new router (it runs OpenWRT codenamed Attitude Adjustment). My main idea is quite simple. I have one internal network interface and a couple of IPv6 subnetworks on it (for example). Lets say those subnets are 2001:db8::a:0/112 and 2001:db8::b:0/112. All I want for DHCPv6 server is to assign network A addresses to real interfaces, and network B addresses for clients whose DUID contains substring "080027" (that's VirtualBox vendor code (or whatever that part of MAC address called) for its interfaces).
My first configuration attempt was as simple as that:

########################################################################
subnet6 2001:db8::a:0/112 
{
        range6 2001:db8::a:10 2001:db8::a:ffff;
}

class "virtualbox" 
{
    match if substring(option6 dhcp6.client-id, 16, 6) = "080027"; # client-id is DUID type 0x1
}

subnet6 2001:db8::b:0/112 
{
        range6 2001:db8::b:10 2001:db8::b:ffff;
        allow members of "virtualbox";
};
########################################################################

Of course it's all wrong when applying to isc-dhcpd, but still it describes my idea.
What I'm getting after that is "WARNING: class declarations are not supported for DHCPv6." :(

I was able to get really close to that with dnsmasq. It was just about 2 config lines:

########################################################################
dhcp-match=set:virtualbox,option:client-id,*:08:00:27:*
dhcp-range=tag:virtualbox,2001:db8::b:10,2001:db8::b:ffff,112,15m
########################################################################

Unfortunately dnsmasq just doesn't understand client-id option. Which can be confirmed by issuing command "dnsmasq --help dhcp6".
So my question is: Can I somehow achieve behavior mentioned above with isc-dhcpd? And of course how can I do that?

Thanks in advance to any responders.


More information about the dhcp-users mailing list