1

1) On Ubuntu / Debian systems, how do you change the temporary ipv6 address interval? The time duration it takes before the system generates and changes the ipv6 addresses?

2) How do you manually trigger the creation of new ipv6 addresses and delete the "old" ones?

2

You don't manually trigger the creation of new temporary addresses. These are created at fixed intervals, which you can tune with two sysctls beginning with net.ipv6.conf.<interface>.:

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)

The preferred lifetime is how long a temporary address lasts before a new one is generated. But it remains on the system for a while longer, in a deprecated state, in case any connections were still using it. New connections can't use the deprecated address, though. The valid lifetime controls when it will finally be removed from the interface.

Note that for temporary addresses to be generated and function properly, use_tempaddr must be set to 1 or 2, and the router and network design must allow hosts to self-assign IPv6 addresses via autoconfiguration. (This is almost always the case, but there are some oddball networks and routers out there, and the possibility of misconfiguration...)

use_tempaddr - INTEGER
  Preference for Privacy Extensions (RFC3041).
    <= 0 : disable Privacy Extensions
    == 1 : enable Privacy Extensions, but prefer public
           addresses over temporary addresses.
    >  1 : enable Privacy Extensions and prefer temporary
           addresses over public addresses.
  Default:  0 (for most devices)
       -1 (for point-to-point devices and loopback devices)
-2

Your question is vague. You might want to consider updating it.

Client machines don't determine IP addresses. The DHCP server on the network does. The client requests an address from the server and assigns itself the IP it was given. This is called a DHCP lease. The timer on the lease is determined by the DHCP server. Once the lease expires, the next request by the client renew the lease. However, you will almost always be given the same address. There is no way to specify a different address. Generally speaking the address would only change if there were more clients requesting IPs than were in the DHCP pool.

  • 1
    The question mentions IPv6, which has a vastly different address configuration mechanism (SLAAC) in which the client does choose its own address suffix (or any number of suffixes, if it wants). – grawity Nov 8 '18 at 4:56

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.