IPv6 Unicast Address Maximum Linux Kernel Setting

How to display and modify the IPv6 Unicast Address Maximum kernel setting on Linux

Unicast Address Number

This setting defines the maximum number of global unicast IPv6 addresses that can be assigned to a single interface.

You can check the current setting like so:

$ sysctl net.ipv6.conf.default.max_addresses
net.ipv6.conf.default.max_addresses = 16

Note: The default keyword changes the interface default setting for any interface that does not have a custom setting specified (even if it matches the default setting). You can replace it with either a specific interface name (so the setting applies only to that interface) or the keyword all to configure all interfaces at once (ignoring interface specific custom settings).

Dynamic Configuration

To change the running configuration, use this command with your desired value:

$ sysctl -w sysctl net.ipv6.conf.default.max_addresses=NN

You can confirm like so:

$ sysctl net.ipv6.conf.default.max_addresses

Permanent Configuration

To make this setting persistent across reboots, edit the /etc/sysctl.conf file like so, save and quit:

$ vi /etc/sysctl.conf

net.ipv6.conf.default.max_addresses = NN

:wq

You can then reboot to check the setting persists, or alternatively, run this command to load them:

$ sysctl -p /etc/sysctl.conf

Confirm with this:

$ sysctl net.ipv6.conf.default.max_addresses