[Dnsmasq-discuss] Best way to assign different static IPs on different VLANs?

richardvoigt at gmail.com richardvoigt at gmail.com
Mon Jul 6 20:56:08 BST 2009

On Mon, Jul 6, 2009 at 1:38 PM, Ron Frederick<ronf at timeheart.net> wrote:
> Hi Richard...
> On 7/4/09 6:47 PM, richardvoigt at gmail.com wrote:
>> dnsmasq will only consider address matches from the same subnet as the
>> local IP address(es) on the interface where the request arrived.
>> But you may have to use dnsmasq configuration (dhcp-host) instead of
>> /etc/ethers, because as you say /etc/ethers doesn't provide space for
>> multiple IPs.  dhcp-host can match based on MAC address instead of
>> client id.
> Thanks for the suggestion. This is actually the first thing I tried, but
> it didn't work. I think the reason is that the later dhcp_host line
> overrides the earlier one when they both have the same MAC address
> listed. What you suggest would have worked fine (with no special
> configuration) if I was willing to accept a dynamic IP, but it won't
> work for static IPs. It worked with client IDs because I was able to
> make the names different, preventing the rules from clashing with one
> another.
> After doing some more reading, I think the option I need is the
> "dhcp-fqdn" option in dnsmasq 2.46, possibly combined with the support
> there for the ability to associate domains with specific subnets.
> Unfortunately, I'm currently running an older release of dnsmasq (2.35)
> on my Linksys router, so I've been unable to try this yet. If I'm
> reading things right, though, this would let me put the unqualified name
> in /etc/ethers and have qualified names in two different domains in
> /etc/hosts and have dnsmasq assign the right IP depending on which
> domain was associated with the subnet the request arrived on. Can anyone
> confirm this for me?
> Is there any way to get this kind of behavior with pre-2.46 dnsmasq? It
> looked to me at one point like "localise-queries" might have been enough
> here, but that didn't seem to be enough.

Worst case scenario, you could run separate instances of dnsmasq, one
for each VLAN.  Then each would have its own configuration file and
distinct sets of dhcp-host settings.

More information about the Dnsmasq-discuss mailing list