Octet

How does anycast work in IPv6, and what is the subnet-router anycast address?

Show the answer

Say this first

An anycast address is an ordinary unicast address configured on more than one node. Nothing in the address marks it as anycast; routing delivers each packet to the nearest instance. Nodes skip DAD for it. The subnet-router anycast address is the subnet prefix with an all-zero interface ID, for example 2001:db8:acad:10::, and it reaches any one router on that subnet.

Go deeper

How it works

Several nodes advertise or are configured with the same address. Routing protocols pick the best path, so each client reaches the closest one by metric. That is how DNS resolvers, root servers and CDNs spread load and survive site failures, in IPv4 and IPv6 alike.

On Cisco

Cisco IOS
interface Loopback53
 ipv6 address 2001:db8:acad:ff::53/128 anycast

The anycast keyword tells IOS to skip DAD for this address. The loopback is then redistributed or advertised from every site that hosts the service.

Subnet-router anycast

RFC 4291 reserves the address with the interface ID all zeros on every subnet, and routers must answer to it. It is rarely used directly, but it explains two things:

  • Why you should not assign prefix:: to a host on a /64.
  • Why /127 links were once discouraged: one of the two addresses is the subnet-router anycast address. RFC 6164 settles it by saying routers do not use subnet-router anycast on /127 links.

What anycast is not

The "anycast gateway" in data center fabrics is a different idea: the same gateway IP and MAC on every leaf switch, each serving its own locally attached hosts.

Traps

  • Saying anycast addresses come from a special prefix.
  • Confusing anycast with multicast. Anycast reaches one receiver, multicast reaches all that joined.
How did you do?Book 4.2 IP Version 6