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

richardvoigt at gmail.com richardvoigt at gmail.com
Sun Jul 5 02:47:29 BST 2009

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.

On Sat, Jul 4, 2009 at 7:14 PM, Ron Frederick<ronf at timeheart.net> wrote:
> Hello...
> I have been using dnsmasq for a number of years now and it has been
> working great. I recently rearranged my network slightly, though, and
> while I have the new configuration working again, I'm wondering if
> there's a better way to do what I'm trying to do.
> Basically, I have two subnets at home. One of them is a public /29
> subnet provided by my ISP. The other is a local network I
> use for internal hosts. I have dnsmasq running on a Linksys WRT54GS
> under OpenWRT. One of my hosts needs to be on both networks, so am I
> using VLANs on both the Linksys and the host for this. VLAN 1 on the
> Linksys is my public subnet and VLAN 2 is my private one. On both the
> Linksys and the dual-homed host, I use VLAN tagging to keep the private
> network traffic separate from the public traffic.
> What I'd like to do is have dnsmasq automatically assign a static public
> IP when it sees a request on VLAN 1 and a static private IP when it sees
> a request on VLAN 2, even though it will see the same MAC address in
> both requests. Can this be done? Normally, I just fill in MAC address
> information in /etc/ethers and host information in /etc/hosts and the
> static mapping is automatically made. However, since I can only
> associate a single name with the MAC address in /etc/ethers, I'm not
> sure how to configure the two different IPs I'd like to assign.
> For now, I have told the dual-homed host to use different client IDs
> (foo and foo-private) in its two requests, and then added entries like:
> dhcp-host=id:foo,foo
> dhcp-host=id:foo-private,foo-private
> By putting entries in /etc/hosts for foo and foo-private, the right
> thing seems to happen. However, it feels like there should be a way to
> do this without using client IDs, since dnsmasq knows which VLAN the
> request is arriving on.
> I've checked through the documentation and I don't see anything which
> covers this specific case. Is there a way to do what I'm looking to do?
> --
> Ron Frederick
> ronf at timeheart.net
> _______________________________________________
> Dnsmasq-discuss mailing list
> Dnsmasq-discuss at lists.thekelleys.org.uk
> http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss

More information about the Dnsmasq-discuss mailing list