Cisco IOS XR OSPF Configuration
OSPF configuration for Cisco IOS XR routers. Interface-based (no network command), supports BFD, multi-area, redistribution, and point-to-point links for SP environments.
What is it?
OSPF on IOS XR uses the same RFC 2328 protocol as IOS/IOS-XE, but the configuration model is completely different. IOS XR uses interface-based OSPF configuration — there is no 'network' command. Instead, you enable OSPF directly under each interface within the OSPF process hierarchy: 'router ospf 1 > area 0 > interface GigE0/0/0/0'. This approach makes the configuration more explicit and easier to audit. In service provider environments, OSPF runs as the IGP underlay, providing loopback reachability for iBGP, MPLS LDP, and Segment Routing. BFD is always recommended on IOS XR OSPF links for sub-second failure detection.
When to use
- ·As the IGP underlay in MPLS service provider networks (loopback reachability for LDP/SR)
- ·PE-to-P router routing in MPLS core networks
- ·Any IOS XR network requiring dynamic routing with fast convergence
- ·When BFD is required for sub-second link failure detection on P2P links
- ·Multi-area designs with hierarchical routing in large SP networks
When NOT to use
- ·Connecting to external autonomous systems — use BGP for inter-AS routing
- ·Very simple networks with 2-3 routers — static routes are sufficient and simpler
- ·When IS-IS is already deployed as IGP — mixing OSPF and IS-IS in the same network adds complexity
How it compares
Prerequisites
- →Interfaces must have 'ipv4 address' configured and be in 'no shutdown' state before adding to OSPF
- →Loopback0 with a /32 address should be configured as the router-id source
- →BFD requires the interface hardware to support it — verify with 'show bfd session'
- →If redistributing BGP, the route-policy PASS-ALL must be defined before the redistribute statement
Config Generator
Set to 100000 for 100G environments
Verification commands
show ospf neighborShow all OSPF neighbors and adjacency state
ExpectedAll neighbors should be FULL. 2WAY only on broadcast segments for non-DR/BDR.
show ospf interface briefList all OSPF-enabled interfaces with area and network type
ExpectedCorrect area assignment, P2P type for core links, cost reflects bandwidth
show route ospfShow OSPF routes in the routing table
ExpectedAll loopbacks and connected prefixes from OSPF neighbors visible, marked 'O'
show ospf databaseView the LSDB to verify all Router LSAs are present
ExpectedRouter LSAs from all routers in the area, no missing entries
Debug commands
debug ospf eventsLive OSPF event debugging for adjacency issues
WarningUse only in non-production or during a maintenance window. Run 'undebug all' to stop.
show bfd sessionVerify BFD sessions are Up for all OSPF neighbors with BFD enabled
WarningBFD Down will cause OSPF adjacency to drop immediately. Verify BFD timers match.
Common mistakes & fixes
Further learning
Recommended books to go deeper on this topic.
OSPF: Anatomy of an Internet Routing Protocol
John T. Moy · Addison-Wesley · The protocol from its author: LSA types, flooding, SPF and the design reasoning behind them
Routing TCP/IP, Volume 1
Jeff Doyle & Jennifer Carroll · Cisco Press · The definitive OSPF and IS-IS reference — essential for CCNP/CCIE
CCNP Enterprise Core ENCOR 350-401 Official Cert Guide
Brad Edgeworth et al. · Cisco Press · OSPF single-area, multi-area, LSA types, route summarization