3

ip -6 addr

Prints a whole lot of actual addresses:

    inet6 <addr>/128 scope global dynamic noprefixroute 
       valid_lft 999612sec preferred_lft 394812sec
    inet6 <addr>/64 scope global dynamic mngtmpaddr noprefixroute 
       valid_lft 1002639sec preferred_lft 397839sec
    inet6 <addr>/64 scope link 
       valid_lft forever preferred_lft forever

By now I now that global means it's globally recognized. But I have two global - which is my actual valid ipv6 address?

On another host, I have three:

/128 scope global dynamic noprefixroute
/64 scope global temporary dynamic
/64 scope global dynamic mngtmpaddr noprefixroute
  1. What does each mean? What are these differences for just the global scope?

I am trying to set a fixed IP for my RPi, editing /etc/dhcpcd.conf.

  1. Is actually the scope link the correct in this case?
  2. What happens if I put the global one?

1 Answer 1

4

The address that is scope global and not mngtmpaddr will be the one you want.

Link-local addresses (scope link) starting fe80:: required by the IPv6 standard. However using them for anything requires you to also specify which interface they are connected to, they cannot be routed at all, and this usually means recording them in any configuration file is likely to be a mistake. (I can't think of any context where it isn't).

I believe the mngtmpaddr address is there for generating temporary IPv6 address for privacy. See man ip-address (here).:

mngtmpaddr

(IPv6 only) make the kernel manage temporary addresses created from this one as template on behalf of Privacy Extensions (RFC3041). For this to become active, the use_tempaddr sysctl setting has to be set to a value greater than zero. The given address needs to have a prefix length of 64. This flag allows to use privacy extensions in a manually configured network, just like if stateless auto-configuration was active.

So the DCHP6 allocated address will be the other one.

2
  • On my other box there are 3 global...what's "dynamic" vs "temporary"? Commented Nov 18, 2022 at 0:17
  • 1
    All three say dynamic, they are not statically set on the host. I believe the temporary one is exactly what it says. Most likely it was created for privacy by randomly generating the last 64 bits. RFC3041 Commented Nov 18, 2022 at 0:55

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.