[Dnsmasq-discuss] VLANs and multiple IP addresses for one mac address
Albert ARIBAUD
albert.aribaud at free.fr
Thu Jun 26 16:30:19 UTC 2014
Bonjour David,
Le Thu, 26 Jun 2014 14:19:14 +0100, David Joslin <davidj at nkcc.org.uk> a
écrit :
> On 26 June 2014 12:45, Albert ARIBAUD <albert.aribaud at free.fr> wrote:
>
> > Bonjour David,
> >
> > >
> > > Here's the configuration for the DHCP range used on one VLAN (on
> > interface
> > > br1).
> > > interface=br1
> > > dhcp-range=tag:br1,10.10.20.101,10.10.20.200,255.255.255.0,1440m
> > > dhcp-option=tag:br1,3,10.10.20.1
> > >
> > > Here's the configuration for a couple of hosts on that VLAN.
> > > dhcp-host=60:03:08:9D:3D:08,10.10.20.99
> > > dhcp-host=F0:CB:A1:86:D1:6E,10.10.20.100
> >
> > You're using 'tag:' in both dhcp-range and dhcp-host; I believe you
> > should use 'set:' in dhcp-range with a different tag for each vlan, and
> > 'tag:' in dhcp-host.
> >
>
> Thanks Albert.
>
> According to the man page, dnsmasq only allows you to 'set' tags on
> dhcp-host lines. It doesn't allow you to match tags like you can on
> dhcp-range lines. This is what's confusing me. I know the tag matching
> option works when I use it with 'dhcp-range' but it doesn't appear it can
> be used with 'dhcp-host'. If it could I think my problem would be solved.
Correct, not with 'set', but:
> Maybe I'm still missing something!
Looking at the code, it seems like the interface on which a DHCP request
has arrived is automatically tagged. So I tried this:
dhcp-range=tag:eth0.42,192.168.42.1,192.168.42.10,infinite
(where eth0.42 is VLAN 42 on interface eth0, created with 'vconfig eth0
42', and assigned with address 192.168.42.42)
On a client machine, I created a VLAN42 interface too, then ran
dhclient on it, and it got a lease with address 192.168.42.1.
Is this what you wanted?
> David
Amicalement,
--
Albert.
More information about the Dnsmasq-discuss
mailing list