dhcpcd-discuss

Re: Distinguish IPv6 address added via SLAAC and DHCPv6

feedback

Fri Sep 13 12:56:10 2019

Thanks for the 'ip token' suggestion.
Didn't know about that feature so I learned something new.

But for non-server IPv6 devices it doesn't help quite as much if you have no control over every device to be sure that everyone uses a unique token. Maybe UUIDs could work, but I currently prefer the hook-script solution.

Thanks anyway.



On 2019-09-11 23:56, Kirth Gersen wrote:
ACHTUNG: Diese Mail kommt von einem externen Absender. Bitte behandeln Sie alle Dateianhänge und Links mit besonderer Vorsicht. Im Zweifel wenden Sie sich bitte an die IT.
On Linux machines, you can use 'ip token set ...' to set the lower part of the SLAAC addresses allowing you to distinguish them.

 

Le mer. 11 sept. 2019 à 21:48, Roy Marples <roy@xxxxxxxxxxxx> a écrit :
Hi Andreas

On 11/09/2019 19:15, feedback@xxxxxxxxxxxxx wrote:
> due to some constraints from an external software protocol I need to
> group IPv6 addresses per network interface in link-local, manual-set,
> slaac- and dhcpv6-based addresses (I know, don't ask...).
>
> I have done some research if this is possible after interface
> configuration via dhcpcd.
>
> * link-local addresses can be filtered out by being 'scope=link'
> * manual-set addresses can be filtered out by being permanent and not
> 'dynamic' and also because we set them manually of course
>
> Unfortunately slaac- and dhcpv6-based addresses are indistinguishable as
> far as I can see because they share the same attributes by being
> 'scope=global' and 'dynamic'. I know of no other address flags which
> would make a difference.
> Did I miss something obvious here?
>
> If it's not possible after interface configuration, I thought about
> using my user-defined dhcpcd.enter-hook (or hacking dhcpcd directly?) to
> save 'incoming' slaac/dhcpv6 addresses in seperate text files and
> compare them later with the interface configuration.
> Maybe someone has done a similar approach (I doubt it ;-)) or a better
> solution around dhcpcd?

You've already worked out all you can from what the kernel provides.
So to get more you need to hook into dhcpcd.

You can do this either by a dhcpcd-run-hooks(8) hook such as
/etc/dhcpcd.exit-hook OR by talking to the unpriviledged dhcpcd socket.
See the dhcpcd-run-hooks(8) man page for the former or the libdhcpcd
code [1] for the latter.

The only thing you can't work out here are static addresses defined in
dhcpcd.conf.

Good luck!

Roy

[1]
https://roy.marples.name/cgit/dhcpcd-ui.git/tree/src/libdhcpcd/dhcpcd.c#n1290



References:
Distinguish IPv6 address added via SLAAC and DHCPv6feedback
Re: Distinguish IPv6 address added via SLAAC and DHCPv6Roy Marples
Re: Distinguish IPv6 address added via SLAAC and DHCPv6Kirth Gersen
Archive administrator: postmaster@marples.name