[Dnsmasq-discuss] Script dnsmasq's IP generation

Geert Stappers stappers at stappers.nl
Mon May 16 05:39:40 UTC 2022


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



More information about the Dnsmasq-discuss mailing list