Date created: 01/28/20 08:47:42. Last modified: 02/13/20 07:57:26

IPv6 Addressing

References:

https://en.wikipedia.org/wiki/Unique_local_address

 

IPv6 LLAs and ULAs

Originally in RFC3513 "Internet Protocol Version 6 (IPv6) Addressing Architecture" which was later superseded by RFC4291 "IP Version 6 Addressing Architecture", fe80::/10 (fe80:: to febf::) was assigned for link local addresses.

 

RFC4193 "Unique Local IPv6 Unicast Addresses" reserves fc00::/7 for ULAs (unique local addresses).

Originally fec0::/10 was allocated by IANA but later deprecated in RFC3897 "Deprecating Site Local Addresses".

fc00::/7 (fc00:: to fdff::) is divided into two parts, fc00::/8 (fc00:: to fcff::) and fd00::/8 (fd00:: to fdff::) with fc00::/8 being undefined.

fd00::/8 is defined for /48 prefixes, formed by setting the forty bits of the prefix following "fd" to a randomly generated bit string. This results in the format fdxx:xxxx:xxxx::/48.

 

Ubuntu IPv6 Address Assignment

By default Ubuntu 18 uses RFC4941 "Privacy Extensions for Stateless Address Autoconfiguration in IPv6" for ULA  auto assignment.

This can be configured using the following options:

# Enabled by default
$ cat /proc/sys/net/ipv6/conf/wlp3s0/use_tempaddr
2

# 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.

# Disable on all interfaces
sudo sysctl net.ipv6.conf.all.use_tempaddr=0
# or disable on a specific interface:
sudo sysctl net.ipv6.conf.wlp3s0.use_tempaddr=0


# If privacy extensions are desired the preferred and valid lifetimes can be set with the following options:

# Preferred lifetime (in seconds) for temporary addresses. Default: 86400 (1 day)
$ cat /proc/sys/net/ipv6/conf/wlp3s0/temp_prefered_lft
86400

# Valid lifetime (in seconds) for temporary addresses. Default: 604800 (7 days)
$ cat /proc/sys/net/ipv6/conf/wlp3s0/temp_valid_lft
604800

 

Neighbor Discovery Protocol

A host will send a multicast Neighbor Solicitation message all-zeros source IPv6 address "::" to the IPv6 all nodes IPv6 multicast destination address, ff02::1. The frame will have a destination MAC address in the IPv6 multicast MAC range (33:33:00:00:00:00 through to 33:33:FF:FF:FF:FF), with the lowest 32-bits set to the lowest 32-bits of the destination IPv6 address. The source MAC address is the unicast MAC of the sending host.

The destination IPv6 address used is ff02::1:ff37:77b9. The destination MAC address becomes 33:33:ff:37:77:b9.

A Router Solicitation message is sent from the host to the all routers IPv6 multicast destination address, ff02::2. The source IPv6 address in the Router Solicitation message is the host's self assigned link local IPv6 address. The destination IPv6 multicast MAC address contains the lowest 32-bits of the destination IPv6 address and become 33:33:00:00:00:02. The source MAC address is the unicast MAC of the sending host.