[Dnsmasq-discuss] Script dnsmasq's IP generation

me@foxt.dev ​ me at foxt.dev
Wed May 25 15:58:24 UTC 2022


Hello Geert.

I'd like to confirm that the solutions posted by you and Petr worked
perfectly.

Sorry for my late reply, I didn't receive the email from the mailing list
(I assume I changed my settings wrongly), and Geert's email got caught up
in the Gmail spam filter.

Thanks to you both, foxtdev

On Mon, 16 May 2022 at 06:39, Geert Stappers <stappers at stappers.nl> wrote:

> Hello you,
> (Cc to dnsmasq mailinglist)
>
>
> On Fri, May 13, 2022 at 03:58:30PM +0200, Petr Menšík wrote:
> > On 5/12/22 16:32, me at foxt.dev wrote:
> > > Hello,
> > >    Is it possible to script dnsmasq's IP generation. I'm aware it's
> > > possible to run a script when dnsmasq generates a lease, but as far as
> > > I'm aware it's not possible to send data from the script back into
> > > dnsmasq.
> > >
> > >    My ideal use case is the ability to use a different IP range for
> > > different MAC address ranges (i.e. AA:BB:CC:00:00:00-AA:BB:CC:FF:FF:FF
> > > use 192.168.2.1-255, where everything else uses 1.1-1.255)
> >
> > I think you should be able to use dhcp-mac to assign tags, then use
> > separate dhcp-range only for selected tags. If you are able to create
> > patterns matching this way, no external script would be required.
> >
> > dhcp-mac=set:special,AA:BB:CC:*:*:*
> >
> > dhcp-range=tag:special,192.168.2.2,192.168.2.255
> > dhcp-range=192.168.1.2,192.168.1.255
> >
> >
> > >
> > > Thanks in advance.
>
> Please come with a sincere thanks
> that expresses how usefull a response is.
>
>
> In case you are busy with connecting the AA:BB:CC:*:*:* devices,
> I recomment
>
>   dhcp-range=tag:special,192.168.1.192,192.168.1.254
>   dhcp-range=192.168.1.2,192.168.1.191
>
> So all devices in 192.168.1.0/24  and the AA:BB:CCs at 192-254.
>
> I'm trying to say that I miss the why for 192.168.1.0/24 and also a
> 192.168.2.0/24. That I expect that you are struggling with two networks.
>
>
> In case the good advice Petr didn't solve your original problem,
> try to describe your problem better (or just in other words).
>
>
> Groeten
> Geert Stappers
> --
> Silence is hard to parse
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/attachments/20220525/64b2d6a3/attachment.htm>


More information about the Dnsmasq-discuss mailing list