Stateless Adress Autoconfiguration allows a node on the link to automatically configure global IPv6 addresses by appending its interface identifier (64 bits) to the prefix (64 bits) advertised by the router.

Lets assume I have a server with the global IPv6 Adress


Now i want to add another global IPv6 address to the same interface by changing just the interface identifier and keeping the prefix. e.g.


How can i do that using SLAAC, where the interface identifier is automatically appended to the network prefix? I am currently using Ubuntu.

(This is similar to what the IPv6 Privacy Extension does, but i want to control adding and removing temporary IPv6 addresses myself.)

  • "i want to control adding and removing temporary IPv6 addresses myself.)" How is this different from manually configuring an IPv6 address, e.g., ip -6 addr add 2001:0db8:85a3:08d3::1234/64 dev enp0x0 ? – user4556274 Jul 31 '16 at 13:24
  • @user4556274 Ideally I want to just request a new temporary global IPv6 and remove it after some time (without the help of another server). Adding a static IP is not really "autoconfig". But this might be my only option. – fl0cke Jul 31 '16 at 14:03
  • There's no server involved in privacy extensions. That's not to say it's completely local operation, because you still have to check if any other machine on the subnet uses that address, but (if more than one machine on the net uses privacy extensions) there's no way around that. – Henrik Jul 31 '16 at 15:47

At the moment, I'm not aware of any method for manually causing the system to switch to a new temporary address.

However, you can tune the time period in which a temporary address is used and cause the system to create them more frequently.

From the kernel documentation:

temp_valid_lft - INTEGER
    valid lifetime (in seconds) for temporary addresses.
    Default: 604800 (7 days)

temp_prefered_lft - INTEGER
    Preferred lifetime (in seconds) for temporary addresses.
    Default: 86400 (1 day)

(Yes, the misspelling is intentional...)

So, let us say you want the system to start using a new temporary address every 10 minutes. You will then set:

sysctl net.ipv6.conf.all.temp_prefered_lft=600
sysctl net.ipv6.conf.default.temp_prefered_lft=600

The other sysctl, temp_valid_lft, allows some extra time for existing connections using a temporary address to finish up. You can also reduce this, especially if you don't anticipate long running connections. Here I reduce it to 1 hour:

sysctl net.ipv6.conf.all.temp_valid_lft=3600
sysctl net.ipv6.conf.default.temp_valid_lft=3600

Privacy Extensions are exactly what you're looking for. You just want to have some manual control over them. You can manipulate the expiration and generation by using the ip address command. The ip-address man page says:

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.

  • If I understand correctly, this allows me to set an IP address as the template for temporary addresses generated by Privacy Extensions in a network without stateless auto-configuration. I'm afraid thats not what I'm looking for. I want to trigger the generation of temporary addresses myself, e.g. something like ip addr add temporary which gives me a new temporary ip address using auto-configuration. I don't really care which one, just a new one! – fl0cke Jul 31 '16 at 15:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.