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.
On small screens, swipe sideways or focus the diagram and use the arrow keys.
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.
On small screens, swipe sideways or focus the diagram and use the arrow keys.
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.
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. Hellos from link-local addresses. Each router sends hellos to FF02::5 (all OSPF routers) from its fe80:: address on the router links.
- 2. LAN prefixes advertised, no hellos. The LAN interfaces run OSPFv3 so their /64s are advertised, but they are passive.
- 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.
| Router | Interface | IPv6 address | Link-local | Connects to |
|---|---|---|---|---|
| R1 (1.1.1.1) | Gi0/0 | 2001:db8:acad:1::1/64 | fe80::1 | LAN 1 |
| Gi0/1 | 2001:db8:acad:12::1/64 | R2 | ||
| Gi0/2 | 2001:db8:ffff::2/64 | ISP (2001:db8:ffff::1) | ||
| R2 (2.2.2.2) | Gi0/0 | 2001:db8:acad:12::2/64 | fe80::2 | R1 |
| Gi0/1 | 2001:db8:acad:23::1/64 | R3 | ||
| Gi0/2 | 2001:db8:acad:2::1/64 | LAN 2 | ||
| R3 (3.3.3.3) | Gi0/0 | 2001:db8:acad:23::2/64 | fe80::3 | R2 |
| Gi0/1 | 2001:db8:acad:3::1/64 | LAN 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:
On small screens, swipe sideways or focus the diagram and use the arrow keys.
On small screens, swipe sideways or focus the diagram and use the arrow keys.
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.
On small screens, swipe sideways or focus the diagram and use the arrow keys.
ipv6 unicast-routingenables IPv6 forwarding between interfaces.router-idsupplies a predictable OSPF name. Set a different one on each router.ipv6 ospf 1 area 0selects 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 10000uses 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.
On small screens, swipe sideways or focus the diagram and use the arrow keys.
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-pointR1. 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 0R2: 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 0R3, 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.
On small screens, swipe sideways or focus the diagram and use the arrow keys.
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 0On 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.
On small screens, swipe sideways or focus the diagram and use the arrow keys.
R1#show ipv6 ospf | include ID|Reference Routing Process "ospfv3 1" with ID 1.1.1.1 Reference bandwidth unit is 10000 mbps
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
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
show ipv6 ospf neighbor detail to see its link-local address.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
When OSPFv3 does not come up
On small screens, swipe sideways or focus the diagram and use the arrow keys.
- IOS refuses
ipv6 router ospf.ipv6 unicast-routingis 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. Anetworkhabit 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 mtuor 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:
On small screens, swipe sideways or focus the diagram and use the arrow keys.
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 0Alternative 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
ipv6 unicast-routing, thenipv6 router ospf <id>.- A unique 32-bit
router-id; required on a router with no IPv4 address. ipv6 ospf <id> area 0on 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
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?
show ipv6 route ospf on R3 shows O 2001:DB8:ACAD:1::/64 [110/30] via FE80::2, GigabitEthernet0/0. What is FE80::2?
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?
Which command enables OSPFv3 for the networks on interface Gi0/1?
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.