You are not logged in.

#1 2017-11-28 15:21:18

tsh
Member
From: Munich
Registered: 2014-07-25
Posts: 41
Website

IPv6 temporary address lifetime

Hi!

I am using NetworkManager to manage IPv6 on an Ethernet interface. Route advertisements are available on the link. I enabled temporary IPv6 addresses to be preferred for the interface by setting ipv6.ip6-privay=2 in NetworkManager configuration. I am aware that these addresses are generated by NetworkManager in userspace and not by the kernel.

Now I observe that temporary addresses are being generated, and their valid and preferred lifetimes are reset when route advertisements are received:

# ip -6 addr show dev enp1s0
3: enp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 state UP qlen 1000
    inet6 2001:xxxx:xxxx:xx:a980:3690:b795:b4ac/64 scope global temporary dynamic 
       valid_lft 86396sec preferred_lft 14396sec
    inet6 2001:xxxx:xxxx:xx:b06a:c26f:43df:b906/64 scope global temporary deprecated dynamic 
       valid_lft 86396sec preferred_lft 0sec
    inet6 2001:xxxx:xxxx:xx:xxx:xxxx:xxxx:xxxx/64 scope global dynamic mngtmpaddr noprefixroute 
       valid_lft 86396sec preferred_lft 14396sec
    inet6 fe80::xxxx:xxxx:xxxx:xxxx/64 scope link 
       valid_lft forever preferred_lft forever

The preferred lifetime is being reset to 14400, which is what the route announcement assigns.

But why is the preferred lifetime also being reset on the temporary dynamic address? I observed today that the second temporary address got deprecated exactly after a day.  So, what setting can I tweak to frequently generate a temporary address?

Last edited by tsh (2017-11-29 10:32:55)

Offline

#2 2017-12-05 17:54:59

ghen
Member
From: Belgium
Registered: 2010-08-31
Posts: 121

Re: IPv6 temporary address lifetime

tsh wrote:

I enabled temporary IPv6 addresses to be preferred for the interface by setting ipv6.ip6-privay=2 in NetworkManager configuration. I am aware that these addresses are generated by NetworkManager in userspace and not by the kernel.

The temporary addresses are actually generated/managed by the kernel, NetworkManager merely toggles the related settings on the interface via sysctl net.ipv6.conf.<interface>.use_tempaddr = 0 or 1.

Temporary address lifetime is also controlled by sysctl's:
net.ipv6.conf.<interface>.temp_prefered_lft = 86400
net.ipv6.conf.<interface>.temp_valid_lft = 604800
(these are the default values)

Last edited by ghen (2017-12-05 17:55:49)

Offline

Board footer

Powered by FluxBB