Stateless Autoconfiguration: IPv4 Link-Local, IPv6 SLAAC and Duplicate Address Detection
How hosts configure addresses with no server: IPv6 SLAAC from Router Advertisements, EUI-64, stable-privacy and temporary interface IDs, address lifetimes, Duplicate Address Detection catching a real conflict, and IPv4 link-local addresses, tested in a lab.
kvi5hnuCode Sprout team member15 min readOn this page
DHCP needs a server that tracks every address. Stateless autoconfiguration needs no such server: each host builds its own address from information it can learn on the link, and checks that nobody else is using it. IPv6 does this routinely with SLAAC (Stateless Address Autoconfiguration, RFC 4862). IPv4 has a much more limited version, link-local addressing (RFC 3927), which is what produces the 169.254.x.x addresses you see when DHCP fails.
IPv6 SLAAC in four steps
The figure shows the four steps in order, and the list below explains each.

- Link-local address. As soon as an interface comes up, the host forms a link-local address:
fe80::/64plus a 64-bit interface identifier (IID). It checks the address is unique with Duplicate Address Detection (DAD, below) and can then talk to other nodes on the link. - Find the routers. The host sends a Router Solicitation (RS) to
ff02::2, all routers, rather than waiting for the next periodic Router Advertisement (RA). Routers answer with an RA listing the link's prefixes. - Build global addresses. For each prefix in the RA with the A (autonomous) flag set, and a length of 64 bits, the host combines the prefix with an IID.
- Check and use them. It runs DAD on each new address, then starts using it. The router's link-local address becomes a default router, for as long as the RA's router lifetime says.
The lab ran radvd, a router advertisement daemon, on a router with the prefix 2001:db8:1::/64, and brought up a client's interface. Here's what the client saw, from the router's side of the link:
0.000 fe80::ff:fe00:101 -> ff02::1 Router Advertisement
1.516 :: -> ff02::1:ff00:c01 Neighbor Solicitation (DAD) for fe80::ff:fe00:c01
2.540 fe80::ff:fe00:c01 -> ff02::2 Router Solicitation
2.540 fe80::ff:fe00:101 -> fe80::ff:fe00:c01 Router Advertisement
2.980 :: -> ff02::1:ff00:c01 Neighbor Solicitation (DAD) for 2001:db8:1::ff:fe00:c01
3.500 :: -> ff02::1:ffe1:d44a Neighbor Solicitation (DAD) for 2001:db8:1:0:a62c:e2cd:f1e1:d44a
The sequence matches the steps: DAD for the link-local address, an RS and the router's reply, then DAD for each global address. The client used two IIDs for the prefix (explained below), so two global addresses were checked.
The RA, decoded by rdisc6, a tool that sends an RS and prints the answer:
Hop limit : 64 ( 0x40)
Stateful address conf. : No
Stateful other conf. : Yes
Mobile home agent : No
Router preference : medium
Neighbor discovery proxy : No
Router lifetime : 30 (0x0000001e) seconds
Reachable time : unspecified (0x00000000)
Retransmit time : unspecified (0x00000000)
Prefix : 2001:db8:1::/64
On-link : Yes
Autonomous address conf.: Yes
Valid time : 86400 (0x00015180) seconds
Pref. time : 14400 (0x00003840) seconds
Recursive DNS server : 2001:db8:2::53
DNS server lifetime : 30 (0x0000001e) seconds
DNS search list : example.com
DNS search list lifetime: 30 (0x0000001e) seconds
Source link-layer address: 02:00:00:00:01:01
from fe80::ff:fe00:101
The fields that matter for autoconfiguration:
- Stateful address conf. is the M flag, and Stateful other conf. the O flag (article 31). Here M is off, so addresses come from SLAAC, and O is on, so a DHCPv6 server may have more settings.
- Router lifetime 30 seconds: how long the router may be used as a default router. 0 would mean "I'm a router, but not a default router."
- The Prefix option, with On-link (the L flag: the prefix is directly reachable) and Autonomous (the A flag: use it for SLAAC), and the two lifetimes.
- RDNSS and DNSSL (RFC 8106): the DNS server and search list, so the host can resolve names without any DHCPv6.
- The router's Source link-layer address, so hosts don't need Neighbor Discovery to find its MAC address.
The client ended up with these addresses. valid_lft and preferred_lft are the remaining valid and preferred lifetimes (explained under "Lifetimes and address states" below), and proto kernel_ra means the kernel created the address from an RA:
inet6 2001:db8:1:0:a62c:e2cd:f1e1:d44a/64 scope global temporary dynamic
valid_lft 86395sec preferred_lft 14395sec
inet6 2001:db8:1::ff:fe00:c01/64 scope global dynamic mngtmpaddr proto kernel_ra
valid_lft 86395sec preferred_lft 14395sec
inet6 fe80::ff:fe00:c01/64 scope link proto kernel_ll
valid_lft forever preferred_lft forever
And these routes, including a default route learned from the RA (proto ra) via the router's link-local address. Its expires 24sec is the 30-second router lifetime counting down, refreshed by every RA, and metric is the route's cost, used to choose between otherwise equal routes:
2001:db8:1::/64 proto kernel metric 256 expires 86394sec pref medium
fe80::/64 proto kernel metric 256 pref medium
default via fe80::ff:fe00:101 proto ra metric 1024 expires 24sec hoplimit 64 pref medium
Choosing the interface identifier
The 64-bit interface identifier can be made in several ways, and the choice matters for privacy.
Modified EUI-64
The original method builds the IID from the MAC address: flip the U/L bit (the second-lowest bit of the first byte) and insert ff:fe in the middle. For the lab client's MAC address:
MAC 02:00:00:00:0c:01 -> flip U/L bit, insert ff:fe -> 0000:00ff:fe00:0c01
The flip in binary: the first byte 02 is 00000010, and flipping its second-lowest bit gives 00000000, or 00. That gave its addresses fe80::ff:fe00:c01 and 2001:db8:1::ff:fe00:c01 (the leading zeros are dropped). EUI-64 addresses are easy to recognize by the ff:fe in the middle. Their problem is that the IID is the same on every network, so a device can be tracked as it moves between networks, and the MAC address reveals the device's manufacturer. RFC 8064 recommends against using them for global addresses.
Stable, semantically opaque IIDs
RFC 7217 computes the IID as a hash of the prefix, the interface, a network identifier and a secret key. The result is stable on one network, so the address doesn't change every time the machine reboots, but different on every network, and says nothing about the hardware. Linux calls it stable-privacy, and it's the default on most desktop distributions. The lab switched a second host to this mode (addr_gen_mode=2 with a stable_secret):
inet6 2001:db8:1:0:1c1e:63d9:bdbc:27e5/64 scope global dynamic mngtmpaddr stable-privacy proto kernel_ra
Temporary addresses
For outgoing connections, hosts can also use temporary addresses (RFC 8981, which replaced RFC 4941). Each has a random IID, a short preferred lifetime, and is replaced regularly, typically daily, so a server can't link a host's connections over time by its address. Source address selection prefers them for outgoing connections (article 28, rule 7). The lab client had use_tempaddr=2 (generate and prefer them), so it got one: the address marked temporary above. The address it was derived alongside is marked mngtmpaddr, meaning "temporary addresses are managed for this one."
Modern systems use stable IIDs for addresses others connect to and temporary ones for connections the host makes out.
Lifetimes and address states
Every SLAAC address has two lifetimes, copied from the prefix option in the RA:

- Tentative: DAD is still running. The address can't be used yet.
- Preferred: usable for any communication, until the preferred lifetime runs out (here 14,400 seconds).
- Deprecated: existing connections may keep using it, but new ones shouldn't (rule 3 of source selection, article 28), until the valid lifetime runs out (here 86,400 seconds).
- Invalid: the address is removed.
Each new RA resets the lifetimes, so on a stable network addresses never expire. To renumber a network, an operator starts advertising a new prefix and advertises the old one with a preferred lifetime of 0: hosts immediately deprecate the old addresses, move new connections to the new prefix, and let old connections finish. To protect against forged RAs that try to cut lifetimes, RFC 4862 limits how much an RA can shorten a prefix's valid lifetime: it can't reduce it below 2 hours unless the previous value was already lower.
Duplicate Address Detection
Before using any address, whether from SLAAC, DHCPv6 or manual configuration, an IPv6 host runs DAD:
- It joins the solicited-node multicast group of the address:
ff02::1:fffollowed by the address's last 24 bits. Forfe80::ff:fe00:c01, the last 24 bits are00:0c:01, so the group isff02::1:ff00:c01, the destination you saw in the first capture. - It sends a Neighbor Solicitation (NS) for the address, from the unspecified address
::(it can't use the address it's testing) to that group. - If a Neighbor Advertisement (NA) for the address comes back, or another NS for it from
::(someone else is testing the same address at the same moment), the address is a duplicate. Otherwise, after a second (RetransTimer, with one NS by default), it's unique.
In the lab, a second host was configured by hand with the client's EUI-64 address, then the client's interface was restarted:
:: -> ff02::1:ff00:c01 NS target fe80::ff:fe00:c01
:: -> ff02::1:ff00:c01 NS target 2001:db8:1::ff:fe00:c01
2001:db8:1::ff:fe00:c01 -> ff02::1 NA target 2001:db8:1::ff:fe00:c01
IPv6: eth0: IPv6 duplicate address 2001:db8:1::ff:fe00:c01 used by 02:00:00:00:0d:01 detected!
The client tested its link-local address (no answer, so it's fine) and then its global address. This time the other host answered with an NA from that very address, to all nodes. The kernel logged the conflict, naming the MAC address of the other host, and the client gave up the address:
inet6 2001:db8:1:0:309c:bd91:6c1:c2e1/64 scope global temporary dynamic
inet6 fe80::ff:fe00:c01/64 scope link proto kernel_ll
The EUI-64 global address is gone. The random temporary address had no conflict, passed its own DAD, and survives. A host that loses its link-local address to DAD should stop using IPv6 on the interface, since that suggests two interfaces with the same IID, which happens with duplicated MAC addresses, for example in cloned virtual machines.
DAD delays every new address by about a second. Optimistic DAD (RFC 4429) lets a host use a new address for limited purposes while the check runs, and many mobile devices use it to connect faster. Enhanced DAD (RFC 7527) solves a different problem: on some links a host hears its own NS looped back and wrongly thinks its address is taken, so the NS carries a nonce (a random value chosen for each attempt) to tell its own messages from others'.
IPv4 link-local addresses
IPv4 has no Router Advertisements and no prefix to build from, so its stateless method can only give a host an address that's valid on the local link. RFC 3927 reserves 169.254.0.0/16 for this. A host that gets no answer from DHCP picks an address in 169.254.1.0 to 169.254.254.255 (the first and last /24 are reserved), using a pseudo-random number seeded from its MAC address so it tends to pick the same address each time. Then it checks the address with ARP:
- Probe: send three ARP requests for the address with a sender IP of
0.0.0.0, one to two seconds apart. Using0.0.0.0means the probes don't pollute other hosts' ARP caches. - If any reply comes back, or another host probes for the same address, pick a different address and start over. After ten conflicts, slow down to one attempt a minute.
- If nothing comes back, announce the address with two gratuitous ARPs (article 22) and start using it, while keeping watch for conflicts.
The lab checked two addresses with arping -D, which sends exactly such probes. One was already used by another host on the link:
Unicast reply from 169.254.23.7 [02:00:00:00:0B:01] 0.521ms
Sent 1 probes (1 broadcast(s))
exit status 1
The other was free:
Sent 2 probes (2 broadcast(s))
Received 0 response(s)
The probe itself:
Ethernet 02:00:00:00:0a:01 -> ff:ff:ff:ff:ff:ff
sender MAC 02:00:00:00:0a:01, sender IP 0.0.0.0
target MAC ff:ff:ff:ff:ff:ff, target IP 169.254.23.7
The sender IP is 0.0.0.0, as required. (RFC 5227 says the target hardware address should be all zeros. This arping puts the broadcast address there, which receivers ignore.) After the probe found the address free, the host could use it to reach its neighbor directly:
64 bytes from 169.254.23.7: icmp_seq=1 ttl=64 time=0.055 ms
169.254.0.0/16 dev eth0 proto kernel scope link src 169.254.99.1
The full RFC 3927 procedure (choosing the address, probing and announcing) is done by tools such as avahi-autoipd or NetworkManager on Linux, and is built into Windows, which calls it Automatic Private IP Addressing (APIPA), and macOS.
Link-local IPv4 addresses have strict limits:
- They're only valid on one link. Routers must not forward packets to or from
169.254.0.0/16, so a host with only a link-local address can't reach the Internet. - They're a fallback. A host keeps trying DHCP and switches to a DHCP address as soon as one is available. Seeing a
169.254address on a computer usually means "DHCP failed." - They're for small ad hoc networks, like two laptops connected by a cable, or a printer on a network with no DHCP server, usually together with multicast DNS for names.
Common questions
Why does my computer have so many IPv6 addresses?
A typical host has a link-local address, a stable global address for each prefix (for incoming connections), one or more temporary addresses (for outgoing connections, rotated daily, with older ones lingering as deprecated until their connections close), and maybe a DHCPv6 address and a ULA (unique local address, IPv6's private range, article 11). That's normal and expected in IPv6.
Do SLAAC addresses require a /64?
Yes. SLAAC builds the address from the prefix plus a 64-bit IID, so it works only with 64-bit prefixes. A router advertising a /56 or /80 with the A flag will not lead to SLAAC addresses. That's one reason every IPv6 LAN is a /64.
Can someone see my MAC address in my IPv6 address?
Only if your device uses EUI-64 IIDs for its global addresses. Current Windows, macOS, iOS, Android and most Linux distributions use stable-privacy or random IIDs plus temporary addresses instead. If you see ff:fe in the middle of your global address, your system is using EUI-64.
What happens if a rogue host sends Router Advertisements?
Hosts will happily configure addresses from its prefix and use it as a default router, sending their traffic through it. Switches defend against this with RA Guard (RFC 6105), which drops RAs from ports not connected to real routers, the IPv6 counterpart of DHCP snooping (articles 30 and 33).
Why did my machine get a 169.254 address even though the network has a DHCP server?
The DHCP exchange failed: the server didn't answer in time, a VLAN or cable problem blocked it, or the pool was full. The host fell back to a link-local address and will usually keep retrying DHCP in the background. Check the cable or Wi-Fi association and the server's logs.
Is DAD really needed if addresses are random?
The chance of two random 64-bit IIDs colliding on one link is tiny, but duplicates do happen for other reasons: cloned virtual machines, manually configured addresses, or two hosts with the same MAC address. DAD catches those, as the lab showed with a manually configured duplicate.
Summary
- SLAAC builds IPv6 addresses with no server: form a link-local address, solicit an RA, combine each autonomous /64 prefix with an interface identifier, run DAD, and use the address. The default route comes from the RA.
- The RA carries the M and O flags, the router lifetime, prefixes with L and A flags and lifetimes, and DNS options (RDNSS and DNSSL).
- IIDs can be EUI-64 (from the MAC, now discouraged), stable-privacy (RFC 7217: stable per network, different across networks) or temporary (RFC 8981: random and rotated, preferred for outgoing connections).
- Addresses go tentative → preferred → deprecated → invalid, driven by the prefix's preferred and valid lifetimes, which every RA refreshes.
- DAD sends an NS from
::to the solicited-node group. An NA for the address means it's a duplicate, as the lab's conflict showed. - IPv4 link-local addresses (169.254/16) are a last-resort, link-only fallback when DHCP fails, checked with ARP probes from
0.0.0.0and announced with gratuitous ARPs.
Practice questions
1. What is the modified EUI-64 interface identifier for the MAC address 00:00:5e:00:53:2a?
Answer
Flip the U/L bit of the first byte: 00 becomes 02. Insert the bytes ff and fe between the third and fourth bytes. Written as an IPv6 IID, that's 0200:5eff:fe00:532a, giving the link-local address fe80::200:5eff:fe00:532a.
2. A host is testing the address 2001:db8:1::abcd:1234. To which multicast address does it send its DAD Neighbor Solicitation, and from which source address?
Answer
To the solicited-node group ff02::1:ffcd:1234 (ff02::1:ff plus the last 24 bits, cd:1234), from the unspecified address ::.
3. An RA advertises the prefix 2001:db8:5::/64 with the A flag set and a preferred lifetime of 0. What does a host that already has an address in that prefix do?
Answer
It marks the address deprecated immediately. Existing connections continue to work until the valid lifetime runs out, but new connections use another address, for example one from a new prefix being advertised at the same time. That's how graceful renumbering works.
4. A router sends an RA with a router lifetime of 0 but a valid prefix with the A flag. What do hosts do?
Answer
They still configure addresses from the prefix with SLAAC, but they don't use this router as a default router. A router lifetime of 0 means "not a default router." Without another router, hosts can talk on the link but have no default route.
5. A laptop shows the address 169.254.77.12. What does it tell you, and can the laptop reach a web server on the Internet?
Answer
It's an IPv4 link-local address, so the laptop didn't get a DHCP lease and configured itself. It can reach other hosts on the same link that also use link-local (or are configured for 169.254/16), but not the Internet: routers don't forward 169.254 traffic, and the laptop has no default router.
6. Why does an IPv4 link-local ARP probe use a sender IP address of 0.0.0.0?
Answer
The host doesn't own the address yet. If it put the candidate address in the sender field and the address turned out to belong to someone else, every host that heard the probe would update its ARP cache with the wrong MAC address for that address. Using 0.0.0.0 avoids breaking the real owner's traffic.
Previous: DHCPv6: Stateful and Stateless Configuration and Prefix Delegation
Next: Configuration and DNS Together: Dynamic DNS Updates and Attacks on Configuration

More in TCP/IP Course
Quiz: TCP/IP Delicate Details
Twenty-five questions on the details that catch out experienced engineers: sequence numbers for SYN and FIN, TIME_WAIT versus tcp_fin_timeout, Karn's algorithm, socket buffer doubling, even and odd ephemeral ports, IPv6 checksums and fragmentation, negative DNS caching, and capture filter traps.
Quiz: TCP/IP Interview Questions
Thirty-three networking questions of the kind asked in developer, SRE and network engineering interviews: what happens when you load a URL, TCP versus UDP, handshakes, closing and TIME_WAIT, subnetting, NAT, DNS, MTU problems, congestion, TLS and QUIC, and debugging slow or failing connections.
Quiz: TCP/IP Course Final Exam (All Parts)
The final exam for the TCP/IP course: thirty questions across all fourteen parts, from packets and addressing through Ethernet, ARP, IP, DHCP, NAT, ICMP, UDP, DNS, TCP connections, reliability, congestion control, security, QUIC and troubleshooting.
Quiz: Modern Transports and Troubleshooting (TCP/IP Part 14)
Review modern transports and troubleshooting: QUIC packets, handshakes, 0-RTT, streams and connection migration, HTTP/3, Multipath TCP, SCTP multihoming, and a layered method for diagnosing real network faults.
Discussion
Sign in to ask a question or share what you learned.