[Dnsmasq-discuss] DHCP: Allocate from different IP pools depending on MAC address

john doe johndoe65534 at mail.com
Fri Sep 27 15:25:58 BST 2019


On 9/27/2019 3:04 PM, Olivier wrote:
> Hello,
>
> I've got several Debian hosts using ISC DHCP server.
>
> In those, I'm currently using the following feature:
> "when a requesting host MAC address ends with 00, use group 0
> when a requesting host MAC address ends with 01, use group 1
> when a requesting host MAC address ends with 02, use group 0
> when a requesting host MAC address ends with 03 use group 1
> ...
> when a requesting host MAC address ends with ff, use group 1
> for hosts from group 0, allocate from pool 192.168.1.1-50
> for hosts from group 1, allocate from pool 192.168.1.101-150"
>
> In dhcpd.configuration, this translates to
> class "guest0" {
>    match suffix(hardware, 1);
> }
>
> class "guest1" {
>    match suffix(hardware, 1);
> }
>
> subclass "guest0" 00;
> subclass "guest1" 01;
> subclass "guest0" 02;
> subclass "guest1" 03;
> ...
>      pool {
>          allow members of "guest0";
>          range 192.168.1.1-50 192.168.1.50;
>       }
>       pool {
>          allow members of "guest1";
>          range 192.168.1.101 192.168.1.150;
>       }
>
> As you may guess, requesting devices are unknown when DHCP server is
> configured and using two different IP pools allows rough dispatching
> devices among available WAN links.
>
> Is it something that can be reproduced with Dnsmasq ?
> Suggestions ?
>

I guess a conbination of tags and wildcard in 'dhcp-host' option should
do what you want.

--
John Doe



More information about the Dnsmasq-discuss mailing list