[Dnsmasq-discuss] Same IP for a range of MAC addresses?

Stephen Lee splee at patchcomputers.com
Sat Apr 4 01:24:50 BST 2009


Hi Tom,


> Stephen Lee wrote:
>> I have a linux box running dnsmasq that needs to assign the
>> same IP to whichever dhcp client it happens to be connected to.
>
> Can you elaborate on your setup? It sounds rather unusual.

I have an Ubuntu notebook that is running dnsmasq. It is used to program
some IP devices. Each device is expecting the same IP to access it and it
they all need to get the same IP via dhcp. Does that make sense?

>> Is it possible to for dnsmasq to assign the same IP to a range of MAC
>> addresses?
>
> I think I ran across the answer to that in the FAQ recently (see below),
> but it sounds like you have to list each MAC address and I wonder if
> there is a better solution for your situation. Can you get the clients
> to issue a consistent ID or host name?
>
> I thought maybe you could use dhcp-mac to map from MAC addresses to a
> network ID tag, but dhcp-host doesn't use network ID tag as a selector
> (instead it does the equivalent of a dhcp-mac to apply the tag for the
> benefit of other options). Which is logical, given that network ID tags
> are meant to apply to groups of machines, and dhcp-host is normally
> meant to apply to a single machine.
>
>   -Tom
>
> http://thekelleys.org.uk/dnsmasq/docs/FAQ
>
> Q: My laptop has two network interfaces, a wired one and a wireless
>     one. I never use both interfaces at the same time, and I'd like the
>     same IP and configuration to be used irrespective of which
>     interface is in use. How can I do that?

I've read this FAQ but it would be impractical if hundreds or even
thousands of devices are involved. Currently I've written a script to
detect when the ethernet cable is unplugged after programming a device and
to restart dnsmasq. This then allows the same IP to be leased out again
but to a different MAC. An ugly kludge but it works...

Thanks,
Stephen





More information about the Dnsmasq-discuss mailing list