Sub topic 20
OSPFv3: What Changes for IPv6
This chapter assumes you know OSPFv2 from the earlier chapters: Hello packets, the neighbor state machine, DR/BDR election, LSA types 1 to 5, areas, and SPF cost. You should also know IPv6 basics: link-local addresses (fe80::/10), multicast groups, and prefix notation.
OSPFv3 is the version of OSPF defined in RFC 5340 for IPv6. The algorithm is the same as in OSPFv2: neighbors form adjacencies, flood LSAs into a link-state database, and each router runs SPF. The changes are in how the protocol attaches to interfaces, how addresses are carried, and how packets are secured.
What stays the same
- The five packet types (Hello, Database Description, Link State Request, Link State Update, Link State Acknowledgment).
- The neighbor state machine from Down to Full.
- DR and BDR election with priority and router ID tie-breaking.
- Areas, the backbone, and the ABR and ASBR roles.
- SPF, with the same default cost formula (reference bandwidth divided by interface bandwidth).
- Stub, totally stubby, and NSSA area types.
- The router ID, which is still a 32-bit value written in dotted-decimal form.
What changes
| Feature | OSPFv2 | OSPFv3 |
|---|---|---|
| Address family | IPv4 | IPv6 (and IPv4 with address families, RFC 5838) |
| Enabled by | `network` statement or per-interface command, matched to an IPv4 subnet | Per-interface command only |
| Scope of operation | Per IP subnet | Per link |
| Packet source address | Interface IPv4 address | Link-local IPv6 address |
| Multicast groups | 224.0.0.5 (all SPF routers), 224.0.0.6 (DRs) | FF02::5 and FF02::6 |
| Authentication | Fields in the OSPF header | Removed from the header. Uses IPsec (AH or ESP), or the authentication trailer from RFC 7166 |
| Router ID | Falls back to the highest interface IPv4 address | Must be set by hand if the router has no IPv4 address |
| Neighbor identification | By interface address on broadcast links | By router ID on all link types |
| Process and database | Separate | Separate from OSPFv2, with its own LSDB |
OSPFv3 runs over IPv6 as next header 89, the same protocol number OSPFv2 uses over IPv4.
Per-link operation
OSPFv2 ties adjacency to a shared subnet. Two routers whose interface addresses sit in different subnets will not become neighbors. OSPFv3 talks over link-local addresses, so two routers on the same link can form an adjacency even if their global prefixes differ. Several IPv6 prefixes can also share one link. A configured global prefix is not needed for adjacency, but it is needed if you want to advertise that prefix.
The Hello packet also drops the network mask field. It adds an Interface ID, which neighbors use to refer to the sending interface. An Instance ID field lets several OSPFv3 instances run on one link.
The router ID
OSPFv3 never derives a router ID from IPv6 addresses. On a router with no IPv4 address, the process will not start cleanly until you configure one. Set router-id explicitly on every OSPFv3 router.
LSA changes
OSPFv2 router and network LSAs carry both topology and IPv4 prefixes. OSPFv3 separates the two. Type 1 and Type 2 LSAs now describe topology only, with no addresses. Prefixes move into new LSAs. This means a prefix change does not force a full SPF run, only a recalculation of routes.
| LSA function | OSPFv3 name | Flooding scope |
|---|---|---|
| Router (Type 1) | Router LSA | Area |
| Network (Type 2) | Network LSA | Area |
| Summary (Type 3) | Inter-Area-Prefix LSA | Area |
| ASBR summary (Type 4) | Inter-Area-Router LSA | Area |
| External (Type 5) | AS-External LSA | Whole AS |
| New (Type 8) | Link LSA | Link-local |
| New (Type 9) | Intra-Area-Prefix LSA | Area |
Each router originates a Link LSA for each link. It advertises the router's link-local address and the IPv6 prefixes configured on that link. The DR collects these and describes the prefixes of a multi-access segment in an Intra-Area-Prefix LSA.
The flooding scope is now encoded in the LSA type. The three scopes are link-local, area, and AS. A router that does not understand an LSA type can still flood it based on scope, which makes the protocol easier to extend.
Configuring OSPFv3
This configuration mirrors the OSPFv2 example from the configuration chapter. It uses IOS-style syntax with the traditional OSPFv3 commands. Newer IOS releases also offer an ospfv3 address-family syntax.
ipv6 unicast-routing
!
ipv6 router ospf 1
router-id 1.1.1.1
auto-cost reference-bandwidth 10000
passive-interface GigabitEthernet0/2
!
interface GigabitEthernet0/0
ipv6 address 2001:db8:12::1/64
ipv6 ospf 1 area 0
ipv6 ospf network point-to-point
!
interface GigabitEthernet0/1
ipv6 address 2001:db8:13::1/64
ipv6 ospf 1 area 0
ipv6 ospf cost 20
!
interface GigabitEthernet0/2
ipv6 address 2001:db8:100::1/64
ipv6 ospf 1 area 0Compare it with OSPFv2:
- There is no
networkstatement. Theipv6 ospf 1 area 0line on each interface both enables OSPFv3 and assigns the area. ipv6 unicast-routingmust be on, or the router will not forward IPv6 or run the routing protocol.- The passive interface still advertises its prefix but sends no Hellos.
- Cost, network type, and priority commands carry the
ipv6 ospfprefix.
Verifying and troubleshooting
The verification commands follow the OSPFv2 pattern with ipv6 in place of ip:
show ipv6 ospf neighbor
show ipv6 ospf interface brief
show ipv6 ospf database
show ipv6 route ospfNeighbors are listed by router ID. The neighbor address shown is the link-local address, such as FE80::2, so expect that rather than a global address.
Most stuck-adjacency causes carry over from OSPFv2. These still need to match: area ID, Hello and dead intervals, and the Instance ID. Authentication must also be consistent. Two checks are specific to IPv6:
- Confirm
ipv6 unicast-routingis enabled and that each interface has a link-local address. Enabling IPv6 on an interface creates one. - Confirm that each router has a unique router ID. Duplicate IDs cause neighbors to flap or never reach Full.
A subnet mismatch no longer blocks an adjacency, but the neighbor's prefixes will not be reachable if the links lack matching routable prefixes.
Exercise
Two routers share a link. R1 has 2001:db8:12::1/64 and R2 has 2001:db8:99::2/64 on that link. Both run OSPFv3 in area 0 with matching timers. Would the adjacency form, and what changes in the LSDB compared with OSPFv2 for the same prefixes?
Show answer
Yes, the adjacency can form. OSPFv3 uses link-local addresses on the link, so the global prefixes do not need to match. In OSPFv2 the mismatched subnets would stop neighbors forming. The prefixes appear in Link LSAs and Intra-Area-Prefix LSAs, not in the Router LSA, which carries topology only.
Exercise
Why does an IPv6-only router often fail to start an OSPFv3 process until you configure router-id?
Show answer
OSPFv3 takes its router ID from an IPv4 address, and an IPv6-only router has none. The router ID is 32 bits and is never derived from IPv6 addresses, so it must be configured by hand.