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.
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. 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. 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:
| Device | Interface | Global address | Link-local |
|---|---|---|---|
| R1 | Gi0/0 (LAN) | 2001:db8:acad:1::1/64 | fe80::1 |
| R1 | Gi0/1 (to R2) | 2001:db8:acad:12::1/64 | fe80::1 |
| R2 | Gi0/1 (to R1) | 2001:db8:acad:12::2/64 | fe80::2 |
| R2 | Gi0/0 (server LAN) | 2001:db8:acad:2::1/64 | fe80::2 |
| Server | NIC | 2001:db8:acad:2::10/64 | automatic |
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 autoconfigoripv6 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.
- 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
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:
- Start with the MAC
00 1A 2B · 3C 4D 5E - Insert FF FE after the first 24 bits
00 1A 2B FF FE 3C 4D 5E - Flip the U/L bit: 00 XOR 02 = 02
02 1A 2B FF FE 3C 4D 5E
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-routingGlobal 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 shutdownA 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-64Alternative: give only the /64 prefix and let the router fill in the interface ID from its MAC.
interface GigabitEthernet0/2
ipv6 address autoconfig defaultClient 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 enableIPv6 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 shutdownR1. 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 shutdownR2. 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
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
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.
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:
R1#show ipv6 interface GigabitEthernet0/0 | include subnet 2001:DB8:ACAD:1:21A:2BFF:FE3C:4D5E, subnet is 2001:DB8:ACAD:1::/64 [EUI]
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
ping works for both versions. ping ipv6 <address> also works.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
When hosts get only a link-local address
| Symptom | Likely cause | Check / fix |
|---|---|---|
| PCs on the LAN only have a FE80 address | Missing or unusable RAs, or host autoconfiguration disabled | Check 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 forwarded | Same: the router behaves as a host | show running-config | include unicast-routing |
| An address is marked [DUP], log shows %IPV6_ND-4-DUPLICATE | DAD found another device using it | Fix the addressing plan, then shutdown / no shutdown to rerun DAD. |
| Two routers on a link can't ping | Different prefixes or lengths typed on each end | Compare the "subnet is" line on both routers. |
| SLAAC hosts don't get an address | Prefix is not a /64 | SLAAC needs a /64 to fill a 64-bit interface ID. Use /64 on LANs. |
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
/lengthform. - Using
eui-64with 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 addressto replace the old one. It is added. Remove the old one withno 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
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?
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?
show ipv6 interface lists FF02::1 but not FF02::2. What does that tell you?
You want an interface to have IPv6 with only a link-local address and no global address. Which command?
You configure ipv6 address 2001:db8:acad:1::5/64 on an interface that already has 2001:db8:acad:1::1/64. What happens?