[Dnsmasq-discuss] [PATCH] DHCPv6: Add support for more than one hardware address per IPv6 address

Pali Rohár pali.rohar at gmail.com
Sat Jan 16 15:00:17 GMT 2016


On Friday 15 January 2016 22:48:31 Simon Kelley wrote:
> On 01/01/16 21:29, Pali Rohár wrote:
> > On Friday 01 January 2016 21:23:36 Simon Kelley wrote:
> >> On 23/12/15 21:10, Pali Rohár wrote:
> >>> This patch allows to assign one IPv6 address for more config
> >>> entries specified by MAC address. This is similar function as
> >>> for IPv4 addresses in DHCPv4 server code part.
> >> 
> >> This needs some thinking about: DHCPv6 is different from DHCPv4
> >> in that clients are not, at all, identified by MAC address,
> >> rather by client-id and IAID.
> > 
> > I know and this is absolutely uncomfortable for me. One client has
> > 
> >  different DUID across different operating systems. Also different
> > 
> > across OS reinstalling... Also if I want to connect new device I
> > need to instruct people how to set stable DUID across all OS...
> > Just not usable for normal usage of "any" device.
> > 
> > For identifying computer/device I need some stable identifier and
> > DHCPv6 DUID is *not* stable in current implementation of major
> > usage OS.
> > 
> > MAC address of network card is stable. And so this identifier is
> > what I prefer to use. dnsmasq has for it support and I'm happy for
> > it! And when I configure both DHCPv4 and DHCPv6 one configuration
> > line MAC,ipv4,ipv6 is really nice for having "clean"
> > configuration.
> > 
> >> In addition, DHCPv6 handles multiple addresses and leases per
> >> client.
> > 
> > When using just DUID I have problem here. My laptop has both Wifi
> > and wired ethernet and with DUID information I'm not able to
> > configure dnsmasq for stable ipv6 addresses.
> > 
> >> What's important? To be able to specify more than on MAC address,
> >> any one of which can be matched, or to have a single IPv6 address
> >> which is removed from one IAID to another if the MAC addresses
> >> are paired?
> > 
> > For specified laptops, I have special configuration. All network
> > interfaces (one wifi, one wired ethernet) on those laptops is
> > assigned same IP address. Operating system is configured in special
> > way that when both interfaces are active it send packets *only* via
> > ethernet.
> > 
> > So it allows me to have active TCP connections and allows me to
> > switch between wifi/ethernet without dropping it.
> > 
> > DHCPv4 in dnsmasq has already support for assigning one ip address
> > to more MAC addresses (more clients) and this my patch add support
> > for it too.
> 
> That makes sense. I think if you can organise for both interfaces to
> send the same CLID and IAID, then both will get the same address.

I cannot do that. It is limitation of ISC dhclient which I'm using. 
Already tried to do that, not possible.

> Actually, one way to make this work may be to have ONE DHCP client,
> and make it configure both interfaces, or copy  the address from one
> interface to the other.

For classic "desktop" linux solution it is again not possible. Whole 
network configuration is done by NetworkManager which just do not 
support something like this...

> I think you can configure a stable address not matter which interface
> actually does the DHCP transaction with
> 
> dhcp-host=<mac1><IP-address>
> dhcp-host=<mac2><IP-address>
> 
> without needing any patches to the code.

If IP-address from first line is same as from second line, then dnsmasq 
refuse to assign same address to both mac1 and mac2 addresses. Already 
tried that.

> The way you're using the IPv4 multiple mac address feature is
> interesting, It was intended to work when only one interface is
> active at any time.

I know but, if you start thinking how "stealing" that lease work when 
both interfaces are active, then is no reason why it should not work (in 
case you have correct working DHCPv4 client).

Anyway I know lot of people who use this "multiple mac address feature". 
So it is really useful feature.

> Extending this to DHCPv6 doesn't really work,
> because DHCPv6 doesn't use the MAC address to identify interfaces,
> as I said in my previous reply.

But dnsmasq has already support for identifying IPv6 clients via its mac 
address (in case there is no DHCPv6 relay) since commit 89500e3. And 
this my patch is working fine on my network.

-- 
Pali Rohár
pali.rohar at gmail.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/attachments/20160116/2d2fffa5/attachment.sig>


More information about the Dnsmasq-discuss mailing list