Course contents

Module 3: Configure and VerifyLesson 3.3 (3 of 3 in this module)11 of 29 in the OSPF course

Beyond CCNA (optional). This topic is not on the CCNA 200-301 exam. It is useful at work and in later study; skip it if you are preparing for the exam. (The v1.1 exam covers single-area OSPFv2 only (3.4); OSPFv3 is not listed.)

Configuring single-area OSPFv3 for IPv6

Your routers already know the IPv4 networks. How will they learn the new IPv6 LANs without a separate list of static routes? Let's configure OSPFv3 on the same three-router network.

Intermediate · 13 min read

Why does working IPv4 not give us IPv6 routes?

IPv6 is a different IP address family from IPv4. A working IPv4 route does not tell a router how to reach an IPv6 destination. OSPFv3 (Open Shortest Path First version 3) can learn IPv6 routes while the existing OSPFv2 process continues learning IPv4 routes.

Two protocols, two sets of routes
Two protocols, two sets of routesOSPFv2 carries IPv4 prefixes. OSPFv3 carries IPv6 prefixes. IPv4 working says nothing about IPv6.OSPFv2IPv4 prefixes onlyNetwork statementsOSPFv3IPv6 prefixesEnabled on interfacesvs

On small screens, swipe sideways or focus the diagram and use the arrow keys.

They share design ideas but run as separate processes.

We want a PC on LAN 1 to reach the server on LAN 3, 2001:db8:acad:3::10. R1 connects LAN 1, R2 is the middle router, and R3 connects the server. The 2001:db8::/32 addresses are documentation examples, not a live internet service.

A neighbour relationship proves that routers can exchange OSPF information; a usable end-to-end connection also needs routes, host gateways and a return path.

Read the addresses before starting the process

A prefix is an address block, such as 2001:db8:acad:1::/64. The /64 says that the first 64 bits identify that network. A link-local address, such as fe80::2, is used only on one connected link. Routers do not forward it to another link.

Three kinds of address
Three kinds of addressNeighbours talk over link-local addresses. Global addresses are what routes carry. The router ID is still a 32-bit value.Link-localfe80::...neighbour next hopGlobal unicast2001:db8:...routes carry theseRouter ID32-bit, set withrouter-id

On small screens, swipe sideways or focus the diagram and use the arrow keys.

Set the router ID by hand when no IPv4 address exists.

The router ID, such as 2.2.2.2, names R2 inside OSPF. It is a 32-bit identifier written like an IPv4 address. It is neither R2's IPv6 interface address nor the next hop a packet uses. An area groups OSPF links that share detailed topology information; all internal interfaces in this lesson use area 0.

The three routers from the OSPF lab already route IPv4 with OSPFv2. The company now adds IPv6 to every LAN and router link, and static IPv6 routes would bring back all the work OSPF removed. The answer is OSPFv3, alongside the existing OSPFv2. The addresses below are dual-stack: each interface keeps its IPv4 address as well.

Gi0/2Gi0/1Gi0/0:12::/64Gi0/1Gi0/0:23::/64Gi0/0Gi0/2Gi0/1ISPIPv6 2001:db8:ffff::1R1IPv6 fe80::1R2IPv6 fe80::2R3IPv6 fe80::3LAN 1IPv6 :1::/64LAN 2IPv6 :2::/64LAN 3IPv6 :3::/64

Device key: ISP (network / service) · R1, R2, R3 (router) · LAN 1, LAN 2 (computer) · LAN 3 (server)

Lines show the example’s network connections. Thick links: uplinks/WAN, as labelled. Read the numbered steps for traffic direction and changes.

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.

  • ISP: IPv6 2001:db8:ffff::1
  • R1: IPv6 fe80::1
  • R2: IPv6 fe80::2
  • R3: IPv6 fe80::3
  • LAN 1: IPv6 :1::/64
  • LAN 2: IPv6 :2::/64
  • LAN 3: IPv6 :3::/64
  1. 1. Hellos from link-local addresses. Each router sends hellos to FF02::5 (all OSPF routers) from its fe80:: address on the router links.
  2. 2. LAN prefixes advertised, no hellos. The LAN interfaces run OSPFv3 so their /64s are advertised, but they are passive.
  3. 3. Routes point at link-local next hops. R3 reaches 2001:db8:acad:1::/64 at cost 30, via R2's link-local address fe80::2.
The same three routers carry IPv6. Short diagram labels such as :12::/64 expand to 2001:db8:acad:12::/64; full addresses and port names are in the table.
RouterInterfaceIPv6 addressLink-localConnects to
R1 (1.1.1.1)Gi0/02001:db8:acad:1::1/64fe80::1LAN 1
Gi0/12001:db8:acad:12::1/64R2
Gi0/22001:db8:ffff::2/64ISP (2001:db8:ffff::1)
R2 (2.2.2.2)Gi0/02001:db8:acad:12::2/64fe80::2R1
Gi0/12001:db8:acad:23::1/64R3
Gi0/22001:db8:acad:2::1/64LAN 2
R3 (3.3.3.3)Gi0/02001:db8:acad:23::2/64fe80::3R2
Gi0/12001:db8:acad:3::1/64LAN 3

Setting one static link-local address per router (fe80::1, fe80::2, fe80::3) is optional, but it makes neighbour and routing output far easier to read than the EUI-64 values IOS would generate. A link-local address only has to be unique on its own link, so reusing it on every interface of one router is fine.

What stays the same and what changes

The main OSPF ideas remain familiar: neighbours, the states up to Full, LSAs and the database, SPF, cost, areas, the DR/BDR election and passive interfaces. The differences are mostly about how it attaches to IPv6:

OSPFv2 against OSPFv3
OSPFv2 against OSPFv3Most concepts carry over. A few mechanisms change.StaysAreas, LSAs of types 1 to 5, DR election, timers, SPFChangesEnabled per interface; neighbours use link-local addressesChangesAuthentication uses IPsec rather than a field in the headerChangesLink and prefix information are separate LSAs

On small screens, swipe sideways or focus the diagram and use the arrow keys.

Knowing what stays the same keeps the lesson short.
What stays the same and what changes
What stays the same and what changes; OSPFv2 (IPv4); OSPFv3 (IPv6). Start the process: router ospf 1 ipv6 router ospf 1 (after ipv6 unicast-routing) Enable on interfaces: network statements or ip ospf 1 area 0 ipv6 ospf 1 area 0 on the interface only Router ID: 32 bits; chosen from IPv4 addresses if not set 32 bits; chosen from IPv4 addresses if not set, so it must be set on an IPv6-only router Hellos sent from: The interface's IPv4 address The interface's link-local address Multicast groups: 224.0.0.5 (all OSPF routers), 224.0.0.6 (DR and BDR) FF02::5 (all OSPF routers), FF02::6 (DR and BDR) Address comparison on these links: Broadcast IPv4 neighbours need compatible subnet addressing; point-to-point rules differ Global prefixes are not compared to form the adjacency; both routers still need a working link and valid link-local addresses Next hop in the routing table: The neighbour's IPv4 address The neighbour's link-local address and the exit interface Administrative distance: 110 110OSPFv2 (IPv4)OSPFv3 (IPv6)Start the processrouter ospf 1ipv6 router ospf 1 (after ipv6unicast-routing)Enable on interfacesnetwork statements or ip ospf 1 area0ipv6 ospf 1 area 0 on the interfaceonlyRouter ID32 bits; chosen from IPv4 addressesif not set32 bits; chosen from IPv4 addressesif not set, so it must be set on anIPv6-only routerHellos sent fromThe interface's IPv4 addressThe interface's link-local addressMulticast groups224.0.0.5 (all OSPF routers),224.0.0.6 (DR and BDR)FF02::5 (all OSPF routers), FF02::6(DR and BDR)Address comparison onthese linksBroadcast IPv4 neighbours needcompatible subnet addressing;point-to-point rules differGlobal prefixes are not compared toform the adjacency; both routersstill need a working link and validlink-local addressesNext hop in the routingtableThe neighbour's IPv4 addressThe neighbour's link-local addressand the exit interfaceAdministrative distance110110

On small screens, swipe sideways or focus the diagram and use the arrow keys.

Read each row across: the left box names the item, the others describe it.

The neighbour rules are otherwise the familiar ones: the same area, matching hello and dead timers, a unique router ID on each side, and a compatible MTU (maximum transmission unit, the largest packet allowed on the link) for database exchange to finish. OSPFv3 adds one more field that must match, the instance ID, which is 0 unless someone changes it.

What does each command change?

Enter the configuration blocks from global configuration mode, reached with configure terminal at the privileged R1# prompt. The blocks change the mode with interface and ipv6 router ospf. Their process number, 1, identifies a local process; it does not have to match the neighbouring router's process number.

Three commands and their effect
Three commands and their effectEach configuration line has one job.ipv6 unicast-routingAllows the router to forward IPv6ipv6 router ospf 1 + router-idCreates the process and its identifieripv6 ospf 1 area 0 (interface)Enables the interface in an area

On small screens, swipe sideways or focus the diagram and use the arrow keys.

Check all three if IPv6 routes do not appear.
  • ipv6 unicast-routing enables IPv6 forwarding between interfaces.
  • router-id supplies a predictable OSPF name. Set a different one on each router.
  • ipv6 ospf 1 area 0 selects that interface for process 1 and area 0. Creating the process alone does not select every interface.
  • A passive interface contributes its eligible LAN prefix without sending Hellos or forming neighbours on the LAN. A Hello is the periodic message used to discover and maintain neighbours.
  • auto-cost reference-bandwidth 10000 uses a 10,000 Mb/s reference. With 1,000 Mb/s interface bandwidth and no manual cost, each link here costs 10. R3 reaches LAN 1 over three outgoing links, for total cost 30.

Configuring R1, R2 and R3

IPv6 routing has to be on before IOS accepts an OSPFv3 process. Then start the process, give it a router ID, and enable it on each interface. The IPv6 addresses are assumed to be in place already, as in the IPv6 configuration lesson.

Configuration order
Configuration orderEnable routing, create the process, enable interfaces.1 IPv6 routingipv6 unicast-routing2 Processipv6 router ospf 13 Interfacesipv6 ospf 1 area 04 Verifyneighbours then routes

On small screens, swipe sideways or focus the diagram and use the arrow keys.

Each router follows the same three steps.
ipv6 unicast-routing ipv6 route ::/0 2001:db8:ffff::1 ! ipv6 router ospf 1 router-id 1.1.1.1 auto-cost reference-bandwidth 10000 passive-interface GigabitEthernet0/0 default-information originate ! interface GigabitEthernet0/0 ipv6 ospf 1 area 0 interface GigabitEthernet0/1 ipv6 ospf 1 area 0 ipv6 ospf network point-to-point

R1. Gi0/2 towards the ISP has no ipv6 ospf command, so OSPFv3 never runs there. The static IPv6 default route is what default-information originate advertises.

ipv6 unicast-routing ! ipv6 router ospf 1 router-id 2.2.2.2 auto-cost reference-bandwidth 10000 passive-interface GigabitEthernet0/2 ! interface GigabitEthernet0/0 ipv6 ospf 1 area 0 ipv6 ospf network point-to-point interface GigabitEthernet0/1 ipv6 ospf 1 area 0 ipv6 ospf network point-to-point interface GigabitEthernet0/2 ipv6 ospf 1 area 0

R2: two point-to-point router links and one passive LAN.

ipv6 unicast-routing ! ipv6 router ospf 1 router-id 3.3.3.3 auto-cost reference-bandwidth 10000 passive-interface default no passive-interface GigabitEthernet0/0 ! interface GigabitEthernet0/0 ipv6 ospf 1 area 0 ipv6 ospf network point-to-point interface GigabitEthernet0/1 ipv6 ospf 1 area 0

R3, written passive-by-default, as in the OSPFv2 lab.

These routers are dual-stack, so even without router-id OSPFv3 would pick an ID from their IPv4 addresses, using the same rule as OSPFv2: the highest loopback address, otherwise the highest address on an active interface. It does not copy the ID set under router ospf; the two processes are configured separately. Setting the ID by hand keeps it predictable, and on a router with no IPv4 address it is required: the process does not start until a router ID is configured.

Point-to-point and broadcast links

A designated router (DR) coordinates part of the OSPF information exchange on a shared segment. The backup designated router (BDR) is ready to take over that role. These are OSPF roles, not the end hosts' default gateway. A point-to-point link has only two router endpoints, so it does not need those elected roles.

Network type on an IPv6 link
Network type on an IPv6 linkA point-to-point link needs no DR election. A broadcast link elects a DR and BDR.Point-to-pointNo electionFaster adjacencyipv6 ospf networkpoint-to-pointBroadcastDR and BDR electedDefault on Ethernetor

On small screens, swipe sideways or focus the diagram and use the arrow keys.

Match the type on both ends.

Network types work exactly as in OSPFv2. An Ethernet interface defaults to broadcast: the routers on the segment elect a DR and BDR (highest priority, then highest router ID; the election does not pre-empt). A link with only two routers gains nothing from that, so the lab sets ipv6 ospf network point-to-point on both ends: no election. Avoid assuming a guaranteed convergence time from that setting alone. The type must match on both ends, Use matching types as the intended design; some mismatches can appear partly up while the learned topology is wrong.

interface GigabitEthernet0/0 ipv6 ospf priority 0

On a broadcast segment, priority 0 means this router never becomes DR or BDR. The default is 1; the highest priority wins, then the highest router ID.

DR and BDR listen on FF02::6 as well as FF02::5, the IPv6 versions of 224.0.0.6 and 224.0.0.5. The DR/BDR lesson covers the election in detail; nothing in it changes for OSPFv3.

Verifying OSPFv3

The show commands are the OSPFv2 ones with ip replaced by ipv6.

Three verification commands
Three verification commandsCheck neighbours, then interfaces, then routes.show ipv6 ospf neighborNeighbour state should be FULLshow ipv6 ospf interface briefArea, cost and state of each interfaceshow ipv6 route ospfRoutes learned, marked O

On small screens, swipe sideways or focus the diagram and use the arrow keys.

Move left to right: each layer depends on the one before.
Example output written for this lesson, based on Cisco IOS documentation
R1#show ipv6 ospf | include ID|Reference
 Routing Process "ospfv3 1" with ID 1.1.1.1
 Reference bandwidth unit is 10000 mbps
The router ID in use and the reference bandwidth, the same two lines worth checking as in OSPFv2.
Example output written for this lesson, based on Cisco IOS documentation
R2#show ipv6 ospf interface brief
Interface    PID   Area            Intf ID    Cost  State Nbrs F/C
Gi0/2        1     0               5          10    DR    0/0
Gi0/1        1     0               4          10    P2P   1/1
Gi0/0        1     0               3          10    P2P   1/1
The column that held the IPv4 address and mask now shows an interface ID, a number the router uses to identify its own interface in OSPFv3. Everything else reads as before: area, cost, state and Full/total neighbours.
Example output written for this lesson, based on Cisco IOS documentation
R2#show ipv6 ospf neighbor
            OSPFv3 Router with ID (2.2.2.2) (Process ID 1)

Neighbor ID     Pri   State           Dead Time   Interface ID    Interface
3.3.3.3           0   FULL/  -        00:00:33    3               GigabitEthernet0/1
1.1.1.1           0   FULL/  -        00:00:37    4               GigabitEthernet0/0
Two Full neighbours, no DR role on point-to-point links. There is no Address column: the neighbour is known by its router ID and its own interface ID. Use show ipv6 ospf neighbor detail to see its link-local address.
Example output written for this lesson, based on Cisco IOS documentation
R3#show ipv6 route ospf
OE2 ::/0 [110/1], tag 1
     via FE80::2, GigabitEthernet0/0
O   2001:DB8:ACAD:1::/64 [110/30]
     via FE80::2, GigabitEthernet0/0
O   2001:DB8:ACAD:2::/64 [110/20]
     via FE80::2, GigabitEthernet0/0
O   2001:DB8:ACAD:12::/64 [110/20]
     via FE80::2, GigabitEthernet0/0
Each route takes two lines. [110/30] is distance 110 and cost 30, as in OSPFv2. The next hop is R2's link-local address FE80::2 with the exit interface, because a link-local address only means something on one link. The default route shows as OE2, an external type 2 route.

When OSPFv3 does not come up

Why OSPFv3 does not come up
Why OSPFv3 does not come upCommon causes sit at the interface level.No neighbourNot enabledinterface missingfrom the processMismatcharea, timers ornetwork typeNo link-localor IPv6 disabledon the interface

On small screens, swipe sideways or focus the diagram and use the arrow keys.

Compare both ends of the link.
  • IOS refuses ipv6 router ospf. ipv6 unicast-routing is missing.
  • The process does not start. No router ID and no IPv4 address to take one from. Add router-id.
  • An interface is missing from the brief output. It has no ipv6 ospf 1 area 0. A network habit from OSPFv2 does nothing here.
  • No neighbour on a router link. The same suspects as OSPFv2: passive interface, area mismatch, different timers, duplicate router IDs or mismatched network types. Different global prefixes on the two ends are not a cause in OSPFv3.
  • Stuck in EXSTART or EXCHANGE. An MTU mismatch is one possibility, as in OSPFv2. Compare ipv6 mtu or the interface MTU on both ends.

The address-family style on IOS XE

Newer IOS and IOS XE releases also accept a second way of writing OSPFv3, with address families, which can carry IPv4 as well as IPv6 in one process:

Traditional and address-family syntax
Traditional and address-family syntaxNewer IOS XE configures OSPFv3 under router ospfv3 with an address family.Traditionalipv6 router ospf 1ipv6 ospf 1 area 0Address-familyrouter ospfv3 1address-family ipv6 unicastor

On small screens, swipe sideways or focus the diagram and use the arrow keys.

The address-family style also carries IPv4 in the same process.
router ospfv3 1 router-id 1.1.1.1 address-family ipv6 unicast passive-interface GigabitEthernet0/0 exit-address-family ! interface GigabitEthernet0/1 ospfv3 1 ipv6 area 0

Alternative syntax excerpt only, not a complete replacement for the three-router configuration. Feature support and verification syntax depend on the IOS XE release. Use one command family consistently; the lab uses classic ipv6 router ospf syntax.

One deeper difference, useful later but not needed for the CCNA: in OSPFv3 the router and network LSAs no longer carry prefixes. Two new LSA types do that job: the link LSA (type 8) and the intra-area-prefix LSA (type 9). Adding or changing a prefix therefore leaves the router LSAs, and so the shape of the map, unchanged.

Remember: OSPFv3 is enabled on the interface (ipv6 ospf 1 area 0), needs ipv6 unicast-routing and a router ID, uses link-local addresses for neighbours and next hops, and sends hellos to FF02::5. DR/BDR election and network types are unchanged from OSPFv2.

OSPFv3 in five lines

What every OSPFv3 router needs
  • ipv6 unicast-routing, then ipv6 router ospf <id>.
  • A unique 32-bit router-id; required on a router with no IPv4 address.
  • ipv6 ospf <id> area 0 on every interface that takes part; there is no network command.
  • Neighbours meet on link-local addresses and FF02::5; routes point at the neighbour's fe80:: address.
  • Passive interfaces, cost, network types and DR/BDR work as in OSPFv2.

Short practice: distinguish three different numbers

On R2, read show ipv6 ospf neighbor and show ipv6 route ospf. Point out a router ID, an IPv6 destination prefix and a link-local next hop. Explain why 3.3.3.3 names R3 while FE80::2 on R3's route names its next hop, R2. Then check the exit interface: a link-local value alone does not identify which link to use.

Test yourself on OSPFv3

Predict · scenario 1

An IPv6-only router already has ipv6 unicast-routing enabled. You configure ipv6 router ospf 1 and ipv6 ospf 1 area 0 on two interfaces, but no router ID. What happens?

Predict · scenario 2

show ipv6 route ospf on R3 shows O 2001:DB8:ACAD:1::/64 [110/30] via FE80::2, GigabitEthernet0/0. What is FE80::2?

Predict · scenario 3

R2 Gi0/1 has 2001:db8:acad:23::1/64 and R3 Gi0/0 has 2001:db8:acad:99::2/64 by mistake. Everything else matches. Do they become OSPFv3 neighbours?

Predict · scenario 4

Which command enables OSPFv3 for the networks on interface Gi0/1?

Predict · scenario 5

Four routers share one Ethernet segment running OSPFv3 with default settings. Router IDs are 1.1.1.1, 2.2.2.2, 3.3.3.3 and 4.4.4.4, all start at the same time. Which becomes DR?

Technical references

The protocol model follows RFC 5340. Classic commands follow Cisco's OSPFv3 configuration example and its IPv6 command reference. Outputs are documentation-based teaching examples, not results from a physical router test.

FAQ

Do I need OSPFv3 to route IPv6?
No. Static IPv6 routes and other routing protocols are alternatives. This lesson extends the single-area OSPF concepts to IPv6. Choose a routing method that fits the size and change rate of the network.
Why does OSPFv3 have no network command?
OSPFv3 is enabled on each interface with ipv6 ospf <process> area <area>. An interface can carry several IPv6 prefixes plus a link-local address, so matching addresses with wildcards no longer makes sense; the interface itself is what joins OSPF, and its eligible IPv6 prefixes can be advertised. Link-local addresses remain local to the link; prefix-suppression and other options can change what is advertised.
Why is the router ID still an IPv4-style number?
The router ID is a 32-bit name for the router, not an address. OSPFv3 kept the same 32-bit format, so it is still written like 1.1.1.1. On a router with no IPv4 address at all, OSPFv3 cannot choose one by itself, so you must configure it.
Can OSPFv2 and OSPFv3 run on the same router?
Yes. They are separate processes with separate databases. A dual-stack network usually runs OSPFv2 for IPv4 and OSPFv3 for IPv6 side by side, over the same links.