SLAAC, DHCPv6 and prefix delegation

An IPv6 host can build its own address from an advertised prefix, or ask a server, and a third mechanism hands out whole networks. Router advertisements decide: the M flag, managed, says addresses come from DHCPv6; the O flag, other, says other settings do; both are off by default, and the A flag sits in the prefix information. Stateless DHCPv6 tracks nothing; stateful assigns and tracks addresses.

In Daveth Pro (Network)7 min video · lab: Services

By , founder of Daveth · Updated

Opening frame of the video walkthrough of SLAAC, DHCPv6 and prefix delegation

Watch this lesson

7 min · Video walkthrough

In Daveth Pro (Network)

The full 7 min walkthrough is in Daveth Pro (Network). See what the plan opens

Upcoming practical lab

Lab C16: Services

What the lab covers

What this page answers

What are the M and O flags in IPv6 router advertisements?

M, the managed address configuration flag, says addresses are available via DHCPv6; set with ipv6 nd managed-config-flag. O, the other configuration flag, says other information such as DNS is; set with ipv6 nd other-config-flag. Neither is set by default. Read it in “Three flags, and the one you get without asking”

What is stateless DHCPv6?

DHCPv6 that hands out parameters such as DNS servers without keeping any per-client state, because no address is allocated: the host builds its own address with SLAAC. Read it in “The pool with nothing in it”

What is DHCPv6 prefix delegation?

A DHCPv6 extension through which a delegating router, such as an ISP's, assigns whole prefixes to a requesting router for use within the customer's network. Read it in “Handing out networks rather than addresses”

Who decides how a host gets its address?

IPv4 had one answer: ask a server. IPv6 has two. The host can build its own address from a prefix somebody advertised, or it can ask a server. And a third mechanism hands out whole networks rather than addresses.

A branch router, two VLANs, one host on each. Nothing is configured yet, so this is what the hosts have.

This course's reading: what each host ended up with. Computed from the model, not taken from a command's output.

host    built its own           was given               other configuration
HOST-A  –                       –                       none
HOST-B  –                       –                       none

HOST-A  no address, and nobody to ask for one
HOST-B  no address, and nobody to ask for one

Which one a host uses is decided by three flags in a router advertisement, set on a router the host doesn't administer. 4.5.a.ii established that hosts learn from those advertisements. 4.2.c.i showed RA Guard filtering on flags called M and O without saying what they mean. This is where both are paid off.

Three flags, and the one you get without asking

When set, it indicates that addresses are available via Dynamic Host Configuration Protocol [DHCPv6].

That is M, the managed address configuration flag, set on IOS by ipv6 nd managed-config-flag.

When set, it indicates that other configuration information is available via DHCPv6. Examples of such information are DNS-related information or information on other servers within the network.

That is O, set by ipv6 nd other-config-flag. Both commands have the same default: the flag is not set in IPv6 router advertisements. The third flag lives somewhere else:

When set indicates that this prefix can be used for stateless address configuration as specified in [ADDRCONF].

That is A, and it isn't in the same place as the other two. M and O are flags in the Router Advertisement header; A is a flag in the Prefix Information option carried inside it. So A belongs to a prefix, and a router can advertise two prefixes and mean different things by them.

And on IOS, A is on unless you turn it off. “By default, prefixes configured as addresses on an interface using the ipv6 address command and additional prefixes configured using the ipv6 nd prefix command are advertised in router advertisements.” And by default “All prefixes will be advertised as an autoconfiguration prefix (for example, the A-bit will be set in the advertisement).”

BRANCH# configure terminal
BRANCH(config)# interface GigabitEthernet0/0/1.10
BRANCH(config-if)# ipv6 address 2001:db8:aaaa:10::1/64
BRANCH(config-if)# end

This course's reading: what each link is advertising. Computed from the model, not taken from a command's output.

link      flags           prefix advertised         what that asks for
VLAN 10   M=0 O=0 A=1     2001:db8:aaaa:10::/64     SLAAC only
VLAN 20   M=0 O=0 A=0     none                      nothing offered

no link has both M and O set

So what did that one line do? It advertised the prefix with A set, and nothing else. HOST-A builds its own address and asks nobody for anything, because nobody told it there was anyone to ask. It has an address and no DNS.

The pool with nothing in it

The stateless Dynamic Host Configuration Protocol for IPv6 (DHCPv6) feature allows DHCPv6 to be used for configuring a node with parameters that do not require a server to maintain any dynamic state for the node.

Stateless describes the server, not the host. There is no lease to track because nothing was allocated. The prefix delegation chapter draws the same line between the two: Stateless configuration parameters do not require a server to maintain any dynamic state for individual clients, such as Domain Name System (DNS) server addresses and domain search list options.

It does not need to contain a prefix pool.
BRANCH# configure terminal
BRANCH(config)# ipv6 dhcp pool BRANCH-INFO
BRANCH(config-dhcp)# dns-server 2001:db8:1::10
BRANCH(config-dhcp)# domain-name example.com
BRANCH(config-dhcp)# exit
BRANCH(config)# interface GigabitEthernet0/0/1.10
BRANCH(config-if)# ipv6 dhcp server BRANCH-INFO
BRANCH(config-if)# ipv6 nd other-config-flag
BRANCH(config-if)# end

The pool prompt is the IOS XE 17.x router guides' (config-dhcp)#. The Catalyst 9300 17.9 guide prints (config-dhcpv6)# for the same command. This page's routers take the router guides' form.

RA messages sent from this interface will inform clients that they should use DHCPv6 for “other” (for example, nonaddress) configuration information.

So what does the pool on BRANCH hand out?

This course's computation of show ipv6 dhcp pool on BRANCH, drawn in the layout of the cited samples; not a device capture.

BRANCH# show ipv6 dhcp pool
DHCPv6 pool: BRANCH-INFO
  DNS server: 2001:DB8:1::10
  ! A pool that hands out a DNS server and no addresses.
  Domain name: example.com
! No Active clients line is drawn for a pool with no addresses: no sample shows one.

This course's reading: what each host ended up with. Computed from the model, not taken from a command's output.

host    built its own           was given               other configuration
HOST-A  2001:db8:aaaa:10::a1a1  –                       2001:db8:1::10
HOST-B  –                       –                       none

HOST-A  an address and its other configuration
HOST-B  no address, and nobody to ask for one

Stateful, and the case a three-row table hides

The DHCPv6 Stateful option, also known as managed mode, operates similarly to DHCPv4 in that it assigns unique addresses to each client instead of the client generating the last 64 bits of the address as in SLAAC.

VLAN 20 is configured the way that chapter's stateful example does it: a pool with an address prefix, and both flags on the interface.

BRANCH# configure terminal
BRANCH(config)# ipv6 dhcp pool VLAN20-POOL
BRANCH(config-dhcp)# address prefix 2001:db8:aaaa:20::/64 lifetime 86400 86400
BRANCH(config-dhcp)# dns-server 2001:db8:1::10
BRANCH(config-dhcp)# domain-name example.com
BRANCH(config-dhcp)# exit
BRANCH(config)# interface GigabitEthernet0/0/1.20
BRANCH(config-if)# ipv6 address 2001:db8:aaaa:20::1/64
BRANCH(config-if)# ipv6 nd managed-config-flag
BRANCH(config-if)# ipv6 nd other-config-flag
BRANCH(config-if)# ipv6 dhcp server VLAN20-POOL
BRANCH(config-if)# end

Both flags are set in the published example. Before reading on: what does O add, once M is set?

If the M flag is set, the O flag is redundant and can be ignored because DHCPv6 will return all available configuration information.

Nothing a host needs. M already sends the host to DHCPv6, and that exchange returns everything the pool has, DNS included. The example isn't wrong to set both; the second flag is just redundant.

Now read what that pool actually hands over, because there is something not in it. An address prefix, a DNS server, a domain name. No gateway. Even on VLAN 20, where M is set and the address came from the server, the router HOST-B sends its traffic to came from the advertisement, not from the exchange that gave it the address. So the two mechanisms are not alternatives for everything: the server can address a host completely and the host still depends on the router advertisement to know where the exit is.

This course's reading: what each host ended up with. Computed from the model, not taken from a command's output.

host    built its own           was given               other configuration
HOST-A  2001:db8:aaaa:10::a1a1  –                       2001:db8:1::10
HOST-B  2001:db8:aaaa:20::b2b2  2001:db8:aaaa:20::d2    2001:db8:1::10

HOST-A  an address and its other configuration
HOST-B  two addresses, which is not a fault

And why does HOST-B hold two addresses? Because its link still advertises a prefix with A set. The interface address put the prefix in the advertisement, and setting M didn't touch A. So the host was told to build an address and to ask for one, and it did both.

It is possible for hosts to obtain address information using both stateless autoconfiguration and DHCPv6 since both may be enabled at the same time. Hosts may use stateful and stateless address autoconfiguration simultaneously.

The chapter's example removes the SLAAC half with one more line: the prefix, with no-advertise.

BRANCH# configure terminal
BRANCH(config)# interface GigabitEthernet0/0/1.20
BRANCH(config-if)# ipv6 nd prefix 2001:db8:aaaa:20::/64 no-advertise
BRANCH(config-if)# end

There is a second way that keeps the prefix in the advertisement and clears only A. Its no-autoconfig keyword Indicates to hosts on the local link that the specified prefix cannot be used for IPv6 autoconfiguration. The prefix will be advertised with the A-bit clear.

And how many addresses is the pool serving now?

This course's computation of show ipv6 dhcp pool on BRANCH, drawn in the layout of the cited samples; not a device capture.

BRANCH# show ipv6 dhcp pool
DHCPv6 pool: BRANCH-INFO
  DNS server: 2001:DB8:1::10
  Domain name: example.com
DHCPv6 pool: VLAN20-POOL
  Address allocation prefix: 2001:DB8:AAAA:20::/64 valid 86400 preferred 86400 (1 in use, 0 conflicts)
! One address in use: the host's, and the only one it now holds. This line is the Catalyst 9300 17.9 sample's; the router sample has no address pool, so its indentation here follows the router sample's other lines.
  DNS server: 2001:DB8:1::10
  Domain name: example.com
Active clients: 1

This course's reading: what each host ended up with. Computed from the model, not taken from a command's output.

host    built its own           was given               other configuration
HOST-A  2001:db8:aaaa:10::a1a1  –                       2001:db8:1::10
HOST-B  –                       2001:db8:aaaa:20::d2    2001:db8:1::10

HOST-A  an address and its other configuration
HOST-B  an address and its other configuration

The models, and the row most tables leave out

FlagsConfigured byModelAddress comes fromServer keeps state?
M=0 O=0 A=1an interface addressSLAAC onlythe host builds itno server involved
M=0 O=1 A=1+ other-config-flagSLAAC + stateless DHCPv6the host builds itnone allocated
M=1 O=1 A=1+ managed-config-flagstateful DHCPv6 + SLAACbothfor the one it gave
M=1 O=1 A=0+ nd prefix no-advertisestateful DHCPv6a serverleases and bindings

Read the second row carefully, because it is the one people misread. The host gets its address without asking anyone, then asks a DHCPv6 server for everything except an address.

And the third row is the one most versions of this table don't have. Setting M on a link that advertises a prefix doesn't replace SLAAC; it adds a server address beside it. Stateful-only takes a fourth line.

Handing out networks rather than addresses

Both VLANs above are numbered from prefixes somebody typed. That works, and it is what the third mechanism exists to stop.

Extensions to DHCPv6 also enable prefix delegation, through which an ISP can automate the process of assigning prefixes to a customer for use within the customer’s network. A prefix-delegating router (DHCPv6 server) selects prefixes to be assigned to a requesting router (DHCPv6 client) upon receiving a request from the client.

In IPv4 a branch gets one public address and translates everything behind it. With delegation it receives a whole prefix, here 2001:db8:1200::/48 carved out of the provider's 2001:db8:1200::/40, the chapter's own example values.

That difference is worth stating plainly before the commands. A landlord who assigns a tenant a whole floor is not deciding which room the tenant's staff sit in. The provider hands over a /48 and stops there; how that /48 is cut into VLANs is the branch's decision and nobody else's. The comparison ends there, because the next part has no equivalent: the floor can be taken back and replaced with a different one, and every room number inside it changes with no work by the tenant, which is what the configuration below is arranged to achieve.

ISP# configure terminal
ISP(config)# ipv6 local pool client-prefix-pool1 2001:db8:1200::/40 48
ISP(config)# ipv6 dhcp pool dhcp-pool
ISP(config-dhcp)# prefix-delegation pool client-prefix-pool1 lifetime 1800 600
ISP(config-dhcp)# exit
ISP(config)# interface GigabitEthernet0/0/0
ISP(config-if)# ipv6 dhcp server dhcp-pool
ISP(config-if)# end