[Dnsmasq-discuss] VLANs and multiple IP addresses for one mac address
Albert ARIBAUD
albert.aribaud at free.fr
Thu Jun 26 17:18:26 UTC 2014
Bonjour David,
Le Thu, 26 Jun 2014 11:57:25 +0100, David Joslin <davidj at nkcc.org.uk> a
écrit :
> On 25 June 2014 06:24, Albert ARIBAUD <albert.aribaud at free.fr> wrote:
>
> > Hi David,
> >
> > Le Tue, 24 Jun 2014 23:50:54 +0100, David Joslin <davidj at nkcc.org.uk> a
> > écrit :
> >
> > > Thanks for the reply, Simon.
> > >
> > > How would I do that?
> > >
> > > I already use the --dhcp-host option to allocate IP addresses by MAC
> > > address for certain clients but these are all machines with just one IP
> > > address on one VLAN. How would I allocate static IP addresses to these
> > > access points when they require a different IP address per VLAN but all
> > > with the same MAC address? Each VLAN is associated with a LAN bridge on
> > the
> > > machine running dnsmasq and I allocate DHCP addresses to the different
> > > VLANs using the tag option in the --dhcp-range statements - for
> > > example:
> > dhcp-range=tag:br3,10.10.70.101,10.10.70.200,255.255.255.0,1440m.
> > > This works fine. But I can't see how to allocate static IP addresses
> > based
> > > on VLAN membership.
> > >
> > > Am I missing something obvious?
> >
> > I don't know about missing anything obvious, but i) can you also show
> > the dhcp-host options you use for one host? Also, just in case, try
> > with a tag that does not match the name of an interface (and make sure
> > that you change it in the VLANs' dhcp-range options as well as in the
> > hosts' dhcp-host options).
> >
>
> 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
>
> What I thought Simon was suggesting was to allocate specific static
> addresses to the access points that are outside the ranges that are
> allocated to other clients. This would avoid the problem of dnsmasq
> allocating addresses to other clients that had already been allocated to
> the access points. What I'm missing here is how to reserve several
> addresses for a particular access point when all the requests use the same
> mac address. The requests will arrive on different interfaces (br0, br1,
> br2 etc) but I can't see how to use that in the dhcp-host configuration.
> That's why I think I'm missing something!
Ok, pulling back a level or two in the discussion tree since I'd
gonethe wrong path, I have now tried the following:
dhcp-range=<start1>,<stop1>...
dhcp-range=tag:<vlan-if>,<start2>,<stop2>...
dhcp-host=<eth-addr>,<ethwlan-addr>,<name1>,<ip-in-range1>
dhcp-host=<eth-addr>,<ethwlan-addr>,<name2>,<ip-in-range2>
I deleted the dnsmasq lease file in /var, ran dnsmasq -d, and from the
host with given eth (or wlan) addr, did a dhclient on the main interface
and on the VLAN-ed one. Each interface got its own IP as specified in
the dhcp-host for the IP range corresponding to the interface, and both
names got registered in DNS with the right IP address.
It appears no tag is needed, and the right dhcp-option is found based
on the subnet where the static IP belongs.
Does this fulfill your requirements?
I did not try with IPv6 and especially with auto-addition of SLAAC
IPv6 addresses to the DNS zone, though.
> Thanks for your help.
>
> David
Amicalement,
--
Albert.
More information about the Dnsmasq-discuss
mailing list