Course contents

Chapter 3: IPv6 ConfigurationLesson 6 of 6

Configuring IPv6 addresses on IOS

Enabling IPv6 routing, static global and link-local addresses, EUI-64, SLAAC on interfaces and verification.

Intermediate · 12 min read

Technical definition

IPv6 interface configuration is the set of IOS commands that gives an interface IPv6 addresses: a global unicast address set statically, built with EUI-64, or learned by SLAAC or DHCPv6, plus a link-local address that is created automatically. On a router, ipv6 unicast-routing must also be enabled before it forwards IPv6 packets.

Add IPv6 to the office LAN

Give R1 and R2 IPv6 addresses, enable routing, and check what PC1 learns from Router Advertisements. The example uses the documentation prefix 2001:db8::/32; it is not a public deployment prefix.

This lesson assumes you can read and shorten IPv6 addresses and know the address types. If not, start with IPv6 addressing and IPv6 address types. This lesson focuses on the IOS commands.

Diagram
The IPv6 lab used in this course
The IPv6 lab used in this course
2001:db8:acad:1::/642001:db8:acad:12::/642001:db8:acad:2::/64PC1SLAACR1Gi0/0 ::1 · Gi0/1 ::1R2Gi0/1 ::2 · Gi0/0 ::1ServerIPv6 2001:db8:acad:2::10

Device key: PC1 (computer) · R1, R2 (router)

Lines show the example’s network connections. The coloured path and envelope follow the current step; its text identifies the sender, receiver and traffic type.

Reading the addresses

IP labels identify interfaces or destinations. Subnet labels identify networks; /n is the prefix length. A router ID (RID) identifies a routing process and need not be a reachable interface.

An IP address alone is not a URL. A web URL includes a scheme such as https://; an address on a router or printer does not imply a website.

  • PC1: SLAAC
  • R1: Gi0/0 ::1 · Gi0/1 ::1
  • R2: Gi0/1 ::2 · Gi0/0 ::1
  • Server: IPv6 2001:db8:acad:2::10
  1. 1. R1 advertises the LAN prefix. With ipv6 unicast-routing on, R1 sends Router Advertisements on Gi0/0. PC1 learns the prefix and its default gateway (R1's link-local address).
  2. 2. PC1 reaches the server. PC1 sends to R1. R1 forwards toward R2 once it has a route (the next lesson adds the static routes).

The addressing plan for the whole IPv6 course:

DeviceInterfaceGlobal addressLink-local
R1Gi0/0 (LAN)2001:db8:acad:1::1/64fe80::1
R1Gi0/1 (to R2)2001:db8:acad:12::1/64fe80::1
R2Gi0/1 (to R1)2001:db8:acad:12::2/64fe80::2
R2Gi0/0 (server LAN)2001:db8:acad:2::1/64fe80::2
ServerNIC2001:db8:acad:2::10/64automatic

Using fe80::1 on both R1 interfaces works in this lab because they connect to separate links. Link-local addresses must be unique on each link; two router interfaces attached to the same VLAN would share a link and could not reuse that address.

The handful of IPv6 interface commands

IPv6 on a Cisco router comes down to a few commands:

  • ipv6 unicast-routing (global): turns on IPv6 forwarding. It is off by default, unlike IPv4 routing, which is on.
  • ipv6 address <address>/<length> (interface): a static global unicast address. The prefix length is written with a slash, not as a mask.
  • ipv6 address <prefix>/64 eui-64: you give the first 64 bits, the router makes the interface ID from its MAC address.
  • ipv6 address fe80::1 link-local: sets the link-local address by hand instead of the automatic one.
  • ipv6 address autoconfig or ipv6 address dhcp: the interface acts as a client and gets its address with SLAAC or DHCPv6.
  • ipv6 enable: turns IPv6 on with only a link-local address and no global address.

Why IPv6 routing is a separate switch

Enabling IPv6 creates a link-local address for communication on the local link. It still needs a working interface and valid address state. Routers use link-local addresses to talk to their neighbours, and hosts use the router's link-local address as their default gateway.

ipv6 unicast-routing is a separate switch because a Cisco device can use IPv6 just as a host (for management, for example) without being a router. Turning it on changes three things: the router forwards IPv6 packets, it joins the all-routers group FF02::2, and on this Ethernet LAN it sends Router Advertisements (RAs), unless RA sending is suppressed. RAs are the messages that let hosts build their own address with SLAAC (Stateless Address Autoconfiguration).

What happens on the LAN once R1 is configured

Here is what happens on the LAN after you configure R1's Gi0/0 and a PC is plugged in. All of it uses ICMPv6 Neighbor Discovery (NDP) messages, IPv6's replacement for ARP.

Step 1 of 4 · DAD check (NS)
R1 Gi0/0
IPv6 2001:db8:acad:1::1
LAN
2001:db8:acad:1::/64
PC1
SLAAC client
PC1 is configured
Address:
2001:db8:acad:1:<interface ID>/64
Default gateway:
fe80::1 (R1 Gi0/0)
DNS:
Requires RDNSS, DHCPv6 options or separate configuration

Device key: R1 Gi0/0 (router) · PC1 (computer)

Arrows run from each message's sender to its receiver. Rows show message order, not separate cables or elapsed time to scale. Port numbers identify services or conversations, not physical switch sockets.

Reading the addresses

IP labels identify interfaces or destinations. Subnet labels identify networks; /n is the prefix length. A router ID (RID) identifies a routing process and need not be a reachable interface.

An IP address alone is not a URL. A web URL includes a scheme such as https://; an address on a router or printer does not imply a website.

  • R1 Gi0/0: IPv6 2001:db8:acad:1::1
  • PC1: SLAAC client
SLAAC on R1's LAN: the router checks its own address, then advertises the prefix.

The router configuration below does not advertise DNS servers. A SLAAC address and a default router do not establish that DNS resolution is configured.

How EUI-64 builds an interface ID

With eui-64, and for the automatic link-local address, IOS turns the 48-bit MAC address into a 64-bit interface ID. Take the MAC 001a.2b3c.4d5e:

Modified EUI-64 · 48 bits to 64 bits
  1. Start with the MAC
    00 1A 2B · 3C 4D 5E
  2. Insert FF FE after the first 24 bits
    00 1A 2B FF FE 3C 4D 5E
  3. Flip the U/L bit: 00 XOR 02 = 02
    02 1A 2B FF FE 3C 4D 5E
Interface ID: 021a:2bff:fe3c:4d5e

The seventh bit is the universal/local bit. Flipping it is why a MAC that starts with 00 gives an interface ID that starts with 02. With the prefix 2001:db8:acad:1::/64, the final address is 2001:db8:acad:1:21a:2bff:fe3c:4d5e (the leading zero of 021a is dropped when shortened).

Modified EUI-64 explains the IOS eui-64 option. SLAAC does not require a MAC-derived interface ID; hosts can use stable or temporary identifiers.

Addressing R1 and R2 on IOS

Commands are based on Cisco IOS / IOS XE documentation and haven't been run on a lab device here. Interface names vary by platform.

ipv6 unicast-routing

Global configuration. Without it the router will not forward IPv6 packets or send Router Advertisements.

interface GigabitEthernet0/0 ipv6 address 2001:db8:acad:1::1/64 ipv6 address fe80::1 link-local no shutdown

A static global address and a short, readable link-local address. The prefix length uses slash notation.

interface GigabitEthernet0/0 ipv6 address 2001:db8:acad:1::/64 eui-64

Alternative: give only the /64 prefix and let the router fill in the interface ID from its MAC.

interface GigabitEthernet0/2 ipv6 address autoconfig default

Client role, e.g. toward an ISP: build an address with SLAAC from the provider's RA. The 'default' keyword also installs a default route toward the advertising router. Use 'ipv6 address dhcp' to get the address from DHCPv6 instead.

interface GigabitEthernet0/3 ipv6 enable

IPv6 with only a link-local address. Useful on router-to-router links when routing protocols run over link-local addresses.

Full configuration for the lab

! R1 ipv6 unicast-routing ! interface GigabitEthernet0/0 description LAN ipv6 address 2001:db8:acad:1::1/64 ipv6 address fe80::1 link-local no shutdown ! interface GigabitEthernet0/1 description Link to R2 ipv6 address 2001:db8:acad:12::1/64 ipv6 address fe80::1 link-local no shutdown

R1. The IPv4 configuration stays as it was: this is dual stack.

! R2 ipv6 unicast-routing ! interface GigabitEthernet0/1 description Link to R1 ipv6 address 2001:db8:acad:12::2/64 ipv6 address fe80::2 link-local no shutdown ! interface GigabitEthernet0/0 description Server LAN ipv6 address 2001:db8:acad:2::1/64 ipv6 address fe80::2 link-local no shutdown

R2. Each router now knows its connected IPv6 networks. Routes to the far LANs come in the next lesson.

Reading show ipv6 interface and the neighbor table

Example output · based on Cisco documentation; exact format varies by platform and software version
R1#show ipv6 interface brief
GigabitEthernet0/0     [up/up]
    FE80::1
    2001:DB8:ACAD:1::1
GigabitEthernet0/1     [up/up]
    FE80::1
    2001:DB8:ACAD:12::1
GigabitEthernet0/2     [administratively down/down]
    unassigned
Each interface lists its link-local address first, then its global addresses. This sample prints hexadecimal letters in capitals; address text is case-insensitive. unassigned means IPv6 is not enabled on that interface.
Example output · based on Cisco documentation; exact format varies by platform and software version
R1#show ipv6 interface GigabitEthernet0/0
GigabitEthernet0/0 is up, line protocol is up
  IPv6 is enabled, link-local address is FE80::1
  No Virtual link-local address(es):
  Global unicast address(es):
    2001:DB8:ACAD:1::1, subnet is 2001:DB8:ACAD:1::/64
  Joined group address(es):
    FF02::1
    FF02::2
    FF02::1:FF00:1
  MTU is 1500 bytes
  ICMP error messages limited to one every 100 milliseconds
  ICMP redirects are enabled
  ICMP unreachables are sent
  ND DAD is enabled, number of DAD attempts: 1
  ND reachable time is 30000 milliseconds (using 30000)
  ND router advertisements are sent every 200 seconds
  ND router advertisements live for 1800 seconds
  ND advertised default router preference is Medium
  Hosts use stateless autoconfig for addresses.
FF02::1 is all nodes. FF02::2 (all routers) only appears because ipv6 unicast-routing is on. FF02::1:FF00:1 is the solicited-node group for both FE80::1 and 2001:DB8:ACAD:1::1, since they share the same last 24 bits. The last line says hosts on this LAN should use SLAAC.

With the EUI-64 version, the address is marked so you can tell:

Example output · based on Cisco documentation; exact format varies by platform and software version
R1#show ipv6 interface GigabitEthernet0/0 | include subnet
    2001:DB8:ACAD:1:21A:2BFF:FE3C:4D5E, subnet is 2001:DB8:ACAD:1::/64 [EUI]
Example output · based on Cisco documentation; exact format varies by platform and software version
R1#ping 2001:db8:acad:12::2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 2001:DB8:ACAD:12::2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/2 ms
IOS recognises an IPv6 address by its format, so ping works for both versions. ping ipv6 <address> also works.
Example output · based on Cisco documentation; exact format varies by platform and software version
R1#show ipv6 neighbors
IPv6 Address                              Age Link-layer Addr State Interface
2001:DB8:ACAD:12::2                         0 001a.2b3c.4d71  REACH Gi0/1
FE80::2                                     0 001a.2b3c.4d71  REACH Gi0/1
The IPv6 version of the ARP table, filled by Neighbor Solicitations and Advertisements. Both of R2's addresses map to the same MAC.

When hosts get only a link-local address

Diagram
When hosts get only a link-local address
When hosts get only a link-local address
SymptomLikely causeCheck / fix
PCs on the LAN only have a FE80 addressMissing or unusable RAs, or host autoconfiguration disabledCheck ipv6 unicast-routing, RA suppression, ICMPv6 filtering, host settings and an advertised /64 prefix with the autonomous flag.
The router can ping its neighbours but packets aren't forwardedSame: the router behaves as a hostshow running-config | include unicast-routing
An address is marked [DUP], log shows %IPV6_ND-4-DUPLICATEDAD found another device using itFix the addressing plan, then shutdown / no shutdown to rerun DAD.
Two routers on a link can't pingDifferent prefixes or lengths typed on each endCompare the "subnet is" line on both routers.
SLAAC hosts don't get an addressPrefix is not a /64SLAAC needs a /64 to fill a 64-bit interface ID. Use /64 on LANs.
Read each row across: the left box names the item, the others describe it.

Slips that come from IPv4 habits

  • Forgetting ipv6 unicast-routing. Everything looks configured, but nothing is routed and hosts get no RAs.
  • Typing a mask, as in IPv4. IPv6 uses only the /length form.
  • Using eui-64 with a full address. Give only the prefix (2001:db8:acad:1::/64 eui-64); the router supplies the last 64 bits.
  • Expecting a new ipv6 address to replace the old one. It is added. Remove the old one with no ipv6 address <address>/<length>.
  • Giving a host the router's global address as its gateway and wondering why the routing table shows a FE80 gateway. Hosts using SLAAC always learn the link-local address. Both work.

Test yourself on IPv6 addressing commands

Predict · scenario 1

R1's LAN interface has ipv6 address 2001:db8:acad:1::1/64, but PCs on the LAN only get FE80 addresses. What is most likely missing?

Predict · scenario 2

An interface with MAC 0200.1111.2222 is configured with ipv6 address 2001:db8:1:1::/64 eui-64. Which interface ID does it get?

Predict · scenario 3

show ipv6 interface lists FF02::1 but not FF02::2. What does that tell you?

Predict · scenario 4

You want an interface to have IPv6 with only a link-local address and no global address. Which command?

Predict · scenario 5

You configure ipv6 address 2001:db8:acad:1::5/64 on an interface that already has 2001:db8:acad:1::1/64. What happens?

References