DHCPv6 vs SLAAC: What the M and O Flags Do, Packet by Packet

This walkthrough uses captures from the late Nick Russo's free packet-capture library, preserved by the Internet Archive. Three are in the Network Services archive, netsrv_pcap.zip, under netsrv_pcap/dhcp/: dhcp_v6_flags_m.pcapng, dhcp_v6_flags_o.pcapng, and dhcp_v6_flags_mo.pcapng. The baseline is in the ICMP archive, icmp_pcap.zip, as icmp_pcap/ipv6/nd_rsra.pcapng. The rest of the library is listed on his job aid page. We decoded the captures with VisualEther, which turns a Wireshark PCAP into a sequence diagram with a plain-English caption on every message.

An IPv6 host can get its address in two ways. With SLAAC (Stateless Address Autoconfiguration), the host builds its own address from a prefix the router announces. With DHCPv6, a server hands the address out and keeps a record of it, much as DHCP does for IPv4. Two bits in the router's Router Advertisement, the M and O flags, tell hosts which to use: M says "get your address from DHCPv6", and O says "get other settings, such as DNS servers, from DHCPv6".

Whichever method supplies the address, the Router Advertisement always supplies the default gateway and the on-link prefix. DHCPv6 has no option for either.

This article follows the same client, a Cisco router named R4, through three captures in which only the flags change, plus a two-frame baseline from another lab:

  1. M=0, O=0, the baseline. Pure SLAAC; the router offers no DHCPv6 at all.
  2. M=0, O=1. SLAAC for the address, and stateless DHCPv6 for the DNS servers.
  3. M=1, O=0. Stateful DHCPv6: the server assigns the address too.
  4. M=1, O=1. The same as M alone, packet for packet.

Each of the three main captures is drawn as an annotated sequence diagram. Each participant gets a lane, each message is an arrow numbered as in Wireshark, and each carries a caption saying what it does. Every diagram comes as an interactive viewer, an HTML page, and a printable PDF. In the viewer and the HTML page, clicking any message opens its full Wireshark field tree.

💡 Read the walkthrough and a diagram side by side: open the interactive diagram in a split-screen window, or open the HTML version in a new tab and snap the two windows side by side. Each section below links its own diagram.

What is the difference between DHCPv6 and SLAAC?

SLAAC lets a host make its own address: it takes the 64-bit prefix from a Router Advertisement and appends a 64-bit interface identifier it chooses itself (RFC 4862 section 5.5.3). No server is involved, and nothing records which host has which address. DHCPv6 (RFC 8415) has a server assign the address and keep a lease for it, which gives the network operator a record of who holds what.

Both are needed in practice, because each piece of a host's configuration has its own source:

SettingSLAAC networkStateful DHCPv6 network
AddressHost builds it from the RA prefixDHCPv6 server assigns it (IA_NA)
On-link prefix and lengthRA prefix option, L flagRA prefix option, L flag
Default gatewayRA source, if router lifetime > 0RA source, if router lifetime > 0
DNS serversStateless DHCPv6 (O flag) or RA RDNSS optionDHCPv6 reply

A few terms used throughout:

DHCPv6 clients send to ff02::1:2, the multicast group that every DHCPv6 relay agent and server joins. Clients use UDP port 546, and servers and relays use 547 (RFC 8415 section 7).

What do the M and O flags in a Router Advertisement mean?

The M (Managed address configuration) flag means addresses are available from DHCPv6. The O (Other configuration) flag means other configuration, such as DNS servers, is available from DHCPv6. RFC 4861 section 4.2 defines both, and adds: "If the M flag is set, the O flag is redundant and can be ignored because DHCPv6 will return all available configuration information."

A third flag decides whether SLAAC is allowed. It lives not in the RA header but in each Prefix Information option: the A (autonomous) flag. A host forms a SLAAC address from a prefix only when A is set (RFC 4862 section 5.5.3). The prefix's L (on-link) flag says that addresses in the prefix are reachable directly on this link, without going through a router.

MOPrefix AWhat the router is saying
001SLAAC only. No DHCPv6.
011SLAAC for addresses, DHCPv6 for other settings (stateless DHCPv6).
10 or 10DHCPv6 for addresses and settings; no SLAAC.
10 or 11DHCPv6 is available, and SLAAC is allowed too. A host may end up with both addresses.

The flags are advice, not commands. RFC 4862 dropped the text that told hosts how to act on them (its appendix C), so what a host does with M and O is up to its implementation and configuration. Captures 1 and 3 show that.

All three main captures carry the same RA apart from the flags: prefix fc00:10:2:4::/64 with A and L set, a 30-day valid lifetime, a 7-day preferred lifetime, and a router lifetime of 1800 s. So SLAAC is allowed in all three. What the client does next is up to it.

Baseline: M=0, O=0, pure SLAAC

The two-frame baseline comes from a different lab, with the prefix fc00:10:1:4::/64. R4 (fe80::4) sends a Router Solicitation, and R1 (fe80::1) answers 0.66 ms later.

sequenceDiagram accTitle: Router Solicitation and Router Advertisement with M and O clear accDescr: R4 sends a Router Solicitation from fe80::4 to the all-routers group. R1 answers 0.66 milliseconds later with a Router Advertisement with M and O clear, router lifetime 1800 seconds, MTU 1500, and prefix fc00:10:1:4::/64 with the A and L flags set. The capture ends there. participant R4 as R4 (host) participant R1 as R1 (router) R4->>R1: [1] Router Solicitation (to ff02::2) R1->>R4: [2] Router Advertisement, M=0 O=0, prefix fc00:10:1:4::/64 A=1 L=1 Note over R4: builds a SLAAC address, uses R1 as default router
The pure-SLAAC baseline, from a different lab (icmp_pcap/ipv6/nd_rsra). Frame numbers are in brackets.

This RA's options are a source link-layer address, an MTU of 1500, and the prefix. There is no RDNSS option and no hint to use DHCPv6. A host on this link gets an address and a default route, but nothing tells it a DNS server. Here the RA was sent unicast to fe80::4; RFC 4861 section 6.2.6 allows that, though the usual reply is a multicast to all nodes, as in the other captures.

Capture 1: the M flag, stateful DHCPv6

In all three captures, R4 is the client and R2 (fe80::2) is both the router sending RAs and the DHCPv6 server. This one has 19 frames over 3.8 seconds. The RA has M set and O clear.

sequenceDiagram accTitle: Stateful DHCPv6 with the M flag accDescr: R4 sends a Router Solicitation, then 0.45 seconds later a DHCPv6 Solicit to ff02::1:2. R2 replies with an Advertise offering an address. 1.10 seconds later R4 sends a Request. R2 then multicasts a Router Advertisement with M set and replies to the Request with a Reply committing the address. R4 runs Duplicate Address Detection on the new address, then pings fc00::2. participant R4 as R4 (client) participant R2 as R2 (router and DHCPv6 server) R4->>R2: [1] Router Solicitation R4->>R2: [2] Solicit, IA_NA, requests DNS (to ff02::1:2) R2->>R4: [3] Advertise fc00:10:2:4:9939:4fb3:359b:162a R4->>R2: [4] Request (to ff02::1:2) R2->>R4: [5] Router Advertisement, M=1 O=0 R2->>R4: [6] Reply, address and DNS servers Note over R4: [7] DAD probe for the leased address, then pings
Capture 1 at a glance. DHCPv6 starts before the RA arrives. Frame numbers are in brackets.

What does each message do?

Frame 1: Router Solicitation. R4 asks for an RA from its link-local address fe80::a8bb:ccff:fe00:420. That address is EUI-64: the MAC aa:bb:cc:00:04:20 with ff:fe in the middle and one bit flipped (aa becomes a8).

Frame 2: Solicit. 0.45 s later R4 multicasts a DHCPv6 Solicit. It carries an IA_NA, asking for an address, and an Option Request option asking for options 23 (DNS servers) and 24 (domain search list), both defined in RFC 3646. RFC 8415 section 18.2.1 says a client should delay its first Solicit by a random 0 to 1 s, so that many hosts powering up together don't transmit at once.

Frame 3: Advertise. R2 answers in 0.42 ms with an offer: the address fc00:10:2:4:9939:4fb3:359b:162a, renewal timer T1 of 43200 s and rebinding timer T2 of 69120 s, the DNS servers 2001:4860:4860::8888 and ::8844, and the search domain njrusmc.net. T1 and T2 are 0.5 and 0.8 of the address's 86400 s preferred lifetime, the values RFC 8415 section 21.4 recommends. The interface identifier is random-looking because the server chose it; RFC 8415 section 13.1 leaves the choice to the server's policy and advises against predictable addresses.

Frame 4: Request. R4 asks for the offered address, with a new transaction ID, still by multicast. It names R2 by the Server Identifier from the Advertise, so any other server that hears the Request knows it lost.

Frame 5: Router Advertisement. Now the RA arrives: M set, O clear, router lifetime 1800 s, prefix fc00:10:2:4::/64 with A and L set.

Frame 6: Reply. R2 commits the lease, 0.56 ms after the RA: 86400 s preferred, 172800 s valid, with the same DNS servers. From the RS to a committed lease took 1.55 s.

Frame 7: DAD. 11.9 ms after the Reply, R4 checks that the new address is unique. It sends a Neighbor Solicitation from :: to the address's solicited-node multicast group, ff02::1:ff9b:162a, built from the address's last 24 bits. Nobody answers, so the address is R4's. RFC 8415 section 18.2.10.1 requires DAD on DHCPv6 addresses, just as RFC 4862 section 5.4 does for SLAAC.

Frames 8 to 19: ping. R4 pings fc00::2, an address on R2, five times. The first reply takes 20.3 ms because R2 must first resolve R4's new address with a Neighbor Solicitation (frames 9 and 10); the rest take 0.30 ms or less.

Here is the RA from frame 5 as Wireshark decodes it. Open the flags and the Prefix Information option to see M, O, L, and A:

📡 [00005] Frame 5 ICMPv6 Router Advertisement 2020-08-12T14:03:18.319212Z 🔀 R2 (router, DHCPv6 server) → 📡 All-nodes ff02::1
frame : Frame 5: Packet, 118 bytes on wire (944 bits), 118 bytes captured (944 bits) on interface -, id 0
Section number : 1
Interface id : 0 (-)
Interface name : -
Encapsulation type : Ethernet (1)
Arrival Time : Aug 12, 2020 19:33:18.319212000 India Standard Time
UTC Arrival Time : Aug 12, 2020 14:03:18.319212000 UTC
Epoch Arrival Time : 1597240998.319212000
Time shift for this packet : 0.000000000 seconds
Time delta from previous captured frame : 361.000 microseconds
Time delta from previous displayed frame : 361.000 microseconds
Time since reference or first frame : 1.552394000 seconds
Frame Number : 5
Frame Length : 118 bytes (944 bits)
Capture Length : 118 bytes (944 bits)
Frame is marked : False
Frame is ignored : False
Protocols in frame : eth:ethertype:ipv6:icmpv6
Character encoding : ASCII (0)
eth : Ethernet II, Src: aa:bb:cc:00:02:20, Dst: 33:33:00:00:00:01
Destination : 33:33:00:00:00:01
Destination (resolved) : 33:33:00:00:00:01
Destination OUI : 33:33:00
.... ..1. .... .... .... .... = LG bit : Locally administered address (this is NOT the factory default)
.... ...1 .... .... .... .... = IG bit : Group address (multicast/broadcast)
Address : 33:33:00:00:00:01
Address (resolved) : 33:33:00:00:00:01
Address OUI : 33:33:00
.... ..1. .... .... .... .... = LG bit : Locally administered address (this is NOT the factory default)
.... ...1 .... .... .... .... = IG bit : Group address (multicast/broadcast)
Source : aa:bb:cc:00:02:20
Source (resolved) : aa:bb:cc:00:02:20
Source OUI : aa:bb:cc
.... ..1. .... .... .... .... = LG bit : Locally administered address (this is NOT the factory default)
.... ...0 .... .... .... .... = IG bit : Individual address (unicast)
Address : aa:bb:cc:00:02:20
Address (resolved) : aa:bb:cc:00:02:20
Address OUI : aa:bb:cc
.... ..1. .... .... .... .... = LG bit : Locally administered address (this is NOT the factory default)
.... ...0 .... .... .... .... = IG bit : Individual address (unicast)
Type : IPv6 (0x86dd)
Stream index : 3
ipv6 : Internet Protocol Version 6, Src: fe80::2, Dst: ff02::1
0110 .... = Version : 6
0110 .... = Version : 6 [This field makes the filter match on "ip.version == 6" possible]
.... 1110 0000 .... .... .... .... .... = Traffic Class : 0xe0 (DSCP: CS7, ECN: Not-ECT)
.... 1110 00.. .... .... .... .... .... = Differentiated Services Codepoint : Class Selector 7 (56)
.... .... ..00 .... .... .... .... .... = Explicit Congestion Notification : Not ECN-Capable Transport (0)
.... 0000 0000 0000 0000 0000 = Flow Label : 0x00000
Payload Length : 64
Next Header : ICMPv6 (58)
Hop Limit : 255
Source Address : fe80::2
Address Space : Link-Local Unicast
Special-Purpose Allocation : Link-Local Unicast
Source : True
Destination : True
Forwardable : False
Globally Reachable : False
Reserved-by-Protocol : True
Source or Destination Address : fe80::2
Address Space : Link-Local Unicast
Special-Purpose Allocation : Link-Local Unicast
Source : True
Destination : True
Forwardable : False
Globally Reachable : False
Reserved-by-Protocol : True
Source Host : fe80::2
Source or Destination Host : fe80::2
Destination Address : ff02::1
Address Space : Multicast
.... .... 0000 .... = Multicast Flags : 0x0
.... .... 0... .... = Reserved : 0
.... .... .0.. .... = Rendezvous Point (RP) : False
.... .... ..0. .... = Network Prefix : False
.... .... ...0 .... = Transient : False
.... .... .... 0010 = Multicast Scope : Link-Local scope (0x2)
Source or Destination Address : ff02::1
Address Space : Multicast
.... .... 0000 .... = Multicast Flags : 0x0
.... .... 0... .... = Reserved : 0
.... .... .0.. .... = Rendezvous Point (RP) : False
.... .... ..0. .... = Network Prefix : False
.... .... ...0 .... = Transient : False
.... .... .... 0010 = Multicast Scope : Link-Local scope (0x2)
Destination Host : ff02::1
Source or Destination Host : ff02::1
Stream index : 3
icmpv6 : Internet Control Message Protocol v6
Type : Router Advertisement (134)
Code : 0
Checksum : 0xa82f [correct]
Checksum Status : Good
Cur hop limit : 64
Flags : 0x80, Managed address configuration, Prf (Default Router Preference): Medium
1... .... = Managed address configuration : Set
.0.. .... = Other configuration : Not set
..0. .... = Home Agent : Not set
...0 0... = Prf (Default Router Preference) : Medium (0)
.... .0.. = ND Proxy : Not set
.... ..0. = SNAC Router : Not set
.... ...0 = Reserved : 0
Router lifetime (s) : 1800
Reachable time (ms) : 0
Retrans timer (ms) : 0
ICMPv6 Option (Source link-layer address : aa:bb:cc:00:02:20)
Type : Source link-layer address (1)
Length : 1 (8 bytes)
Link-layer address : aa:bb:cc:00:02:20
Source Link-layer address : aa:bb:cc:00:02:20
ICMPv6 Option (MTU : 1500)
Type : MTU (5)
Length : 1 (8 bytes)
Reserved
MTU : 1500
ICMPv6 Option (Prefix information : fc00:10:2:4::/64)
Type : Prefix information (3)
Length : 4 (32 bytes)
Prefix Length : 64
Flag : 0xc0, On-link Flag (L), Autonomous Address Configuration Flag (A)
1... .... = On-link Flag (L) : Set
.1.. .... = Autonomous Address Configuration Flag (A) : Set
..0. .... = Router Address Flag (R) : Not set
...0 .... = DHCPv6-PD Preferred Flag (P) : Not set
.... 0000 = Reserved : 0
Valid Lifetime : 2592000 (30 days)
Preferred Lifetime : 604800 (7 days)
Reserved
Prefix : fc00:10:2:4::
Rendered from a Wireshark PCAP by VisualEther.

Did the M flag trigger the DHCPv6 exchange?

No. R4 sent its Solicit at 0.45 s and had its offer at 0.45 s, more than a second before the capture's only RA, at 1.55 s. R4 started DHCPv6 because it was configured to, most likely with Cisco IOS's ipv6 address dhcp, not because of the M flag. The RA only confirmed what the client was already doing.

This matters when you debug. A host that never sends a Solicit may be ignoring M, and a host that sends one may not need M at all. Check the client's configuration as well as the router's flags.

R4 is a router acting as a client: every Neighbor Advertisement it sends has the Router flag set. A PC or phone may treat the flags differently.

Why does the client wait a second before sending Request?

The Advertise arrives 0.42 ms after the Solicit, but the Request follows 1.10 s later. The wait is required. RFC 8415 section 18.2.1 says a client must collect Advertise messages until its first retransmission timeout (just over 1 s) has passed, in case a better server answers. Only an Advertise with preference 255 ends the wait early, and R2's Advertise carries no Preference option at all. Capture 3 shows the same pause.

Did the client also form a SLAAC address?

There is no sign of one, although the RA's A flag allowed it. No DAD probe goes out for the EUI-64 address fc00:10:2:4:a8bb:ccff:fe00:420, and every ping uses the DHCPv6 address. On Cisco IOS, SLAAC needs a separate ipv6 address autoconfig. Many host operating systems would form both addresses on this link.

Capture 2: the O flag, stateless DHCPv6

This capture has 16 frames over 12.4 seconds. The RA has M clear and O set.

sequenceDiagram accTitle: Stateless DHCPv6 with the O flag accDescr: R2 multicasts a Router Advertisement with M clear and O set. 1.10 seconds later R4 sends a DHCPv6 Information-request asking for DNS servers, a domain search list, and an information refresh time. R2 replies with the DNS servers and search list. R4 multicasts an unsolicited Neighbor Advertisement for its SLAAC address, then pings fc00::2. participant R4 as R4 (client) participant R2 as R2 (router and DHCPv6 server) R2->>R4: [1] Router Advertisement, M=0 O=1 R4->>R2: [2] Information-request, asks for 23 24 32 (to ff02::1:2) R2->>R4: [3] Reply, DNS servers and search domain Note over R4: [4] announces SLAAC address fc00:10:2:4:a8bb:ccff:fe00:420
Capture 2 at a glance. SLAAC for the address, two DHCPv6 messages for DNS. Frame numbers are in brackets.

What is stateless DHCPv6?

Stateless DHCPv6 gives a host configuration settings but no address, so the server keeps no per-client state. The host takes its address from SLAAC and asks DHCPv6 only for the rest, with a two-message exchange: Information-request and Reply (RFC 8415 sections 6.1 and 18.2.6). It used to have its own RFC, 3736, which RFC 8415 replaced.

Frame 1: Router Advertisement. M clear, O set, and the same prefix with A set. The capture starts here; any RS before it isn't in the file.

Frame 2: Information-request. 1.10 s later R4 asks for three options and carries no IA_NA, because it wants no address:

RFC 8415 section 18.2.6 requires a random 0 to 1 s delay before a first Information-request, which fits the 1.10 s gap after the RA.

Here is the Information-request as Wireshark decodes it:

❓ [00002] Frame 2 DHCPv6 Information-request 2020-08-12T14:08:36.069263Z 🖥 R4 (client) → 📡 DHCPv6 relays and servers ff02::1:2
frame : Frame 2: Packet, 96 bytes on wire (768 bits), 96 bytes captured (768 bits) on interface -, id 0
Section number : 1
Interface id : 0 (-)
Interface name : -
Encapsulation type : Ethernet (1)
Arrival Time : Aug 12, 2020 19:38:36.069263000 India Standard Time
UTC Arrival Time : Aug 12, 2020 14:08:36.069263000 UTC
Epoch Arrival Time : 1597241316.069263000
Time shift for this packet : 0.000000000 seconds
Time delta from previous captured frame : 1.101243000 seconds
Time delta from previous displayed frame : 1.101243000 seconds
Time since reference or first frame : 1.101243000 seconds
Frame Number : 2
Frame Length : 96 bytes (768 bits)
Capture Length : 96 bytes (768 bits)
Frame is marked : False
Frame is ignored : False
Protocols in frame : eth:ethertype:ipv6:udp:dhcpv6
Character encoding : ASCII (0)
eth : Ethernet II, Src: aa:bb:cc:00:04:20, Dst: 33:33:00:01:00:02
Destination : 33:33:00:01:00:02
Destination (resolved) : 33:33:00:01:00:02
Destination OUI : 33:33:00
.... ..1. .... .... .... .... = LG bit : Locally administered address (this is NOT the factory default)
.... ...1 .... .... .... .... = IG bit : Group address (multicast/broadcast)
Address : 33:33:00:01:00:02
Address (resolved) : 33:33:00:01:00:02
Address OUI : 33:33:00
.... ..1. .... .... .... .... = LG bit : Locally administered address (this is NOT the factory default)
.... ...1 .... .... .... .... = IG bit : Group address (multicast/broadcast)
Source : aa:bb:cc:00:04:20
Source (resolved) : aa:bb:cc:00:04:20
Source OUI : aa:bb:cc
.... ..1. .... .... .... .... = LG bit : Locally administered address (this is NOT the factory default)
.... ...0 .... .... .... .... = IG bit : Individual address (unicast)
Address : aa:bb:cc:00:04:20
Address (resolved) : aa:bb:cc:00:04:20
Address OUI : aa:bb:cc
.... ..1. .... .... .... .... = LG bit : Locally administered address (this is NOT the factory default)
.... ...0 .... .... .... .... = IG bit : Individual address (unicast)
Type : IPv6 (0x86dd)
Stream index : 1
ipv6 : Internet Protocol Version 6, Src: fe80::a8bb:ccff:fe00:420, Dst: ff02::1:2
0110 .... = Version : 6
0110 .... = Version : 6 [This field makes the filter match on "ip.version == 6" possible]
.... 1110 0000 .... .... .... .... .... = Traffic Class : 0xe0 (DSCP: CS7, ECN: Not-ECT)
.... 1110 00.. .... .... .... .... .... = Differentiated Services Codepoint : Class Selector 7 (56)
.... .... ..00 .... .... .... .... .... = Explicit Congestion Notification : Not ECN-Capable Transport (0)
.... 0000 0000 0000 0000 0000 = Flow Label : 0x00000
Payload Length : 42
Next Header : UDP (17)
Hop Limit : 255
Source Address : fe80::a8bb:ccff:fe00:420
Address Space : Link-Local Unicast
Special-Purpose Allocation : Link-Local Unicast
Source : True
Destination : True
Forwardable : False
Globally Reachable : False
Reserved-by-Protocol : True
Source or Destination Address : fe80::a8bb:ccff:fe00:420
Address Space : Link-Local Unicast
Special-Purpose Allocation : Link-Local Unicast
Source : True
Destination : True
Forwardable : False
Globally Reachable : False
Reserved-by-Protocol : True
Source Host : fe80::a8bb:ccff:fe00:420
Source or Destination Host : fe80::a8bb:ccff:fe00:420
Destination Address : ff02::1:2
Address Space : Multicast
.... .... 0000 .... = Multicast Flags : 0x0
.... .... 0... .... = Reserved : 0
.... .... .0.. .... = Rendezvous Point (RP) : False
.... .... ..0. .... = Network Prefix : False
.... .... ...0 .... = Transient : False
.... .... .... 0010 = Multicast Scope : Link-Local scope (0x2)
Source or Destination Address : ff02::1:2
Address Space : Multicast
.... .... 0000 .... = Multicast Flags : 0x0
.... .... 0... .... = Reserved : 0
.... .... .0.. .... = Rendezvous Point (RP) : False
.... .... ..0. .... = Network Prefix : False
.... .... ...0 .... = Transient : False
.... .... .... 0010 = Multicast Scope : Link-Local scope (0x2)
Destination Host : ff02::1:2
Source or Destination Host : ff02::1:2
Stream index : 1
udp : User Datagram Protocol, Src Port: 546, Dst Port: 547
Source Port : 546
Destination Port : 547
Source or Destination Port : 546
Source or Destination Port : 547
Length : 42
Checksum : 0x8890 [unverified]
Checksum Status : Unverified
Stream index : 0
Stream Packet Number : 1
Timestamps
Time since first frame : 0.000000000 seconds
Time since previous frame : 0.000000000 seconds
UDP payload (34 bytes)
dhcpv6 : DHCPv6
Message type : Information-request (11)
Transaction ID : 0xe3764e
Elapsed time
Option : Elapsed time (8)
Length : 2
Elapsed time : 0ms
Client Identifier
Option : Client Identifier (1)
Length : 10
DUID : 00030001aabbcc000400
DUID Type : link-layer address (3)
Hardware type : Ethernet (1)
Link-layer address : aa:bb:cc:00:04:00
Link-layer address (Ethernet) : aa:bb:cc:00:04:00
Option Request
Option : Option Request (6)
Length : 6
Requested Option code : DNS recursive name server (23)
Requested Option code : Domain Search List (24)
Requested Option code : Lifetime (32)
Rendered from a Wireshark PCAP by VisualEther.

Frame 3: Reply. R2 answers in 0.30 ms with the DNS servers and the search domain, but no Information Refresh Time. RFC 8415 section 21.23 covers that case: the client then uses the default of 86400 s, so R4 will ask again in a day. Unlike the stateful exchange, nothing here is leased, renewed, or released.

Frame 4: R4 announces its address. 0.45 s after the Reply, R4 multicasts an unsolicited Neighbor Advertisement for fc00:10:2:4:a8bb:ccff:fe00:420, the RA prefix plus its EUI-64 interface identifier. That is SLAAC. The Solicited flag is clear, as RFC 4861 section 7.2.6 requires for an unsolicited advertisement.

Frames 5 to 16: ping. R4 pings fc00::2 from its SLAAC address. R2 still sends a Neighbor Solicitation for that address before replying: the unsolicited advertisement didn't create a cache entry, because a node that has no entry for the target discards it (RFC 4861 section 7.2.5). The first reply takes 19.2 ms; the rest take about 0.1 to 0.2 ms.

Where is the DAD probe?

This capture has none. RFC 4862 section 5.4 requires DAD on every new unicast address unless it is turned off, so R4 should have sent a Neighbor Solicitation from :: for its SLAAC address. The capture may have missed it, or R4 may have skipped it; the trace can't tell. Capture 3 is also missing a probe for its DHCPv6 address, while capture 1 shows one. When you debug DAD itself, capture on the client's own port, from before the interface comes up.

Capture 3: both M and O set

This capture has 18 frames over 27.4 seconds. This time R2 answers the RS in 0.34 ms, so the RA comes first and the DHCPv6 exchange follows.

sequenceDiagram accTitle: DHCPv6 with both M and O flags set accDescr: R4 sends a Router Solicitation. R2 answers 0.34 milliseconds later with a Router Advertisement with M and O both set. 0.43 seconds later R4 sends a Solicit asking for DNS servers and a search list. R2 sends an Advertise offering an address. 1.05 seconds later R4 sends a Request, and R2 sends a Reply committing the address with the DNS servers. participant R4 as R4 (client) participant R2 as R2 (router and DHCPv6 server) R4->>R2: [1] Router Solicitation R2->>R4: [2] Router Advertisement, M=1 O=1 R4->>R2: [3] Solicit, IA_NA, requests DNS (to ff02::1:2) R2->>R4: [4] Advertise fc00:10:2:4:c559:9256:f326:e8e9 R4->>R2: [5] Request (to ff02::1:2) R2->>R4: [6] Reply, address and DNS servers
Capture 3 at a glance. The DHCPv6 messages match capture 1 option for option. Frame numbers are in brackets.

What happens when both M and O are set?

Nothing different from M alone. Compare the two captures message by message:

Only the address differs (...c559:9256:f326:e8e9 this time), because the server picks a new one for each lease.

That is what RFC 4861 section 4.2 means by calling O redundant when M is set: a stateful exchange returns all the settings anyway. It also shows who decides what the client gets. A DHCPv6 server answers the client's Option Request with whatever it is configured to return (RFC 8415 section 18.3.9). The server ignores the flags, which only tell clients which exchange to run.

Again there is no sign of a SLAAC address, and again R4 waits just over a second (1.05 s) between Advertise and Request. The pings, 25.9 s after the Reply, come from the DHCPv6 address.

The three captures side by side

Where each piece of R4's configuration came from, under each flag setting:

RA flagsAddress fromDNS servers fromDefault router fromDHCPv6 messagesRA to first ping
M=0, O=0 (baseline, other lab)SLAACNowhere: no DHCPv6, no RDNSSRA (fe80::1)NoneCapture ends at the RA
M=0, O=1 (capture 2)SLAAC, EUI-64Stateless DHCPv6RA (fe80::2)Information-request, Reply12.35 s
M=1, O=0 (capture 1)DHCPv6 IA_NADHCPv6, because the client askedRA (fe80::2)Solicit, Advertise, Request, Reply2.22 s (DHCPv6 began before the RA)
M=1, O=1 (capture 3)DHCPv6 IA_NADHCPv6RA (fe80::2)Solicit, Advertise, Request, Reply27.40 s

The first-ping times mostly measure when someone typed ping, not how fast configuration finished. The protocol timings are short: from the RS to a committed DHCPv6 lease took 1.55 s in capture 1 and 1.48 s in capture 3, most of it the random start delay and the one-second wait for Advertises. In capture 2 the stateless DHCPv6 Reply arrived 1.10 s after the RA.

In every capture, the first ping reply took about 20 ms (19.2 to 21.6 ms) and the rest under half a millisecond. The difference is R2 resolving R4's new address with a Neighbor Solicitation before it can answer.

Why doesn't DHCPv6 give a default gateway?

Because in IPv6 the routers announce themselves. Any router sending an RA with a nonzero router lifetime becomes a default router candidate for that long (RFC 4861 section 4.2), so a separate DHCPv6 option was never defined. RFC 8415 has no default-router option.

DHCPv6 gives no prefix length either. The IA Address option carries an address and its two lifetimes, nothing else, and RFC 8415 section 21.6 forbids the client from assuming any prefix length but /128 from it. Only an RA prefix with the L flag makes a prefix on-link. RFC 5942 section 4 says it plainly: assigning an address, by SLAAC, by DHCPv6, or by hand, doesn't by itself make its prefix on-link.

So a DHCPv6-only network still needs RAs. Without them a host holds an address but has no route off the link and doesn't even know which other addresses share its link.

How does a host get DNS servers in IPv6?

There are two ways, and a network can offer both:

The baseline shows the gap between the two: with M and O clear and no RDNSS option, a host gets an address and a route but no resolver. Once it has one, our DNS walkthrough shows what the resolver does with a query.

Which method a host supports varies. Android, for example, has long relied on SLAAC and RDNSS and shipped without a DHCPv6 client for addresses, so on a DHCPv6-only network an Android phone may get no address at all. Offering RDNSS beside DHCPv6 covers more clients.

Troubleshooting: why did a host get no address, route, or DNS server?

Capture the client's port from before its interface comes up, then check these in order:

  1. No default route? Look for an RA with a nonzero router lifetime. DHCPv6 can't fix this.
  2. No global address? Check the RA's prefix option: A set for SLAAC, and a /64 prefix (RFC 4862 needs prefix plus interface identifier to total 128 bits). For DHCPv6, look for a Solicit; if there is none, the client isn't running DHCPv6, whatever M says.
  3. Solicit but no Advertise? The server or relay isn't on the path. A server on another subnet needs a relay agent on the client's link, listening on ff02::1:2.
  4. An address, but no DNS? Check whether the client asked for option 23 and whether the Reply contains it, or whether the RA carries RDNSS.
  5. An address that never comes up? Look for a DAD probe from ::; a Neighbor Advertisement answering it means the address is a duplicate.

On Cisco IOS, the router side is ipv6 nd managed-config-flag (M) and ipv6 nd other-config-flag (O), and the client side is ipv6 address dhcp or ipv6 address autoconfig. The IPv4 side of DHCP, including relay agents and lease renewal, is in How DHCP Works, Packet by Packet.

Frequently asked questions

Can a host have both a SLAAC and a DHCPv6 address? Yes. When M is set and the prefix's A flag is set too, the router allows both. These captures' client used only DHCPv6, but many hosts would form both.

Does the M flag turn off SLAAC? No. Only clearing the A flag in the prefix option stops SLAAC for that prefix.

What is the difference between stateful and stateless DHCPv6? Stateful DHCPv6 assigns addresses (IA_NA) with a four-message exchange, and the server keeps a lease per client. Stateless DHCPv6 gives only settings such as DNS servers, with two messages, and keeps no state.

Why do DHCPv6 addresses look random? The server chooses the interface identifier. RFC 8415 section 13.1 advises servers against predictable addresses. A SLAAC address on many modern hosts looks random too, from RFC 7217 stable identifiers or RFC 8981 temporary addresses, while these Cisco clients use the older MAC-based EUI-64 form.

Which ports and addresses does DHCPv6 use? Clients send from UDP port 546 to ff02::1:2, port 547. In these captures the server replies by unicast to the client's link-local address.

Is DHCPv6 the same protocol as DHCP for IPv4? No. It does the same job with different messages: Solicit, Advertise, Request, and Reply instead of Discover, Offer, Request, and ACK. It also never assigns a gateway or subnet mask. RFC 8415 defines it, replacing RFC 3315, RFC 3736, and five other RFCs.

Takeaways

  1. M and O say where to get configuration; A says whether SLAAC is allowed. M means addresses from DHCPv6, O means other settings from DHCPv6, and the prefix's A flag allows SLAAC independently of both.
  2. The default gateway and on-link prefix always come from the RA. DHCPv6 has no option for either, so every IPv6 network needs RAs.
  3. O adds nothing when M is set. Captures 1 and 3 are identical in every DHCPv6 option. The server answers the client's Option Request, not the flags.
  4. The flags are hints. Capture 1's client started DHCPv6 before it saw any RA and ignored the A flag. Check the client's configuration, not just the router's.
  5. Stateless DHCPv6 is two messages. Information-request and Reply, with no IA_NA and no lease.
  6. DNS can come from DHCPv6 or from the RA's RDNSS option. With neither, a host has an address and a route but no resolver.