OSPFv2 and OSPFv3 Configuration
OSPFv2 and OSPFv3 are link-state routing protocols used in CCNP Enterprise environments. OSPFv2 operates over IPv4 networks, while OSPFv3 extends OSPF functionality to IPv6 networks, though it can also support IPv4. Both protocols share fundamental concepts but differ in implementation details. OSP… OSPFv2 and OSPFv3 are link-state routing protocols used in CCNP Enterprise environments. OSPFv2 operates over IPv4 networks, while OSPFv3 extends OSPF functionality to IPv6 networks, though it can also support IPv4. Both protocols share fundamental concepts but differ in implementation details. OSPFv2 uses 32-bit Router IDs and exchanges routing information through LSAs (Link-State Advertisements). Configuration involves enabling OSPF on interfaces, defining network areas, and setting Router IDs. OSPFv3 uses the same Router ID format but employs different packet types and operates directly over IPv6. In OSPFv3, configuration is typically interface-based rather than network-based, and Hello and Dead intervals must match for adjacency. Both protocols support multiple areas: Area 0 (backbone), standard areas, stub areas, and totally stubby areas, each reducing routing table size through summarization. Key configuration steps include: enabling OSPF process, configuring Router ID, activating interfaces in specific areas, and adjusting timers if needed. Cost metrics default to 10^8 divided by bandwidth but are manually adjustable. Authentication differs between versions: OSPFv2 uses MD5 or simple authentication, while OSPFv3 uses IPSec. Virtual links connect non-backbone areas through transit areas, maintaining contiguity. OSPF Priority and Hello intervals influence DR/BDR election in broadcast networks. OSPFv3 eliminates some address family limitations by supporting multiple instances. Both versions require careful network design, summarization at area boundaries, and monitoring with commands like show ip ospf neighbor and show ipv6 ospf neighbor. Understanding passive interfaces, default routes, and redistribution is crucial for enterprise deployments. Proper configuration ensures optimal convergence times, reduced bandwidth utilization, and reliable inter-area routing in complex enterprise networks supporting both IPv4 and IPv6 infrastructure requirements.
OSPFv2 and OSPFv3 Configuration Guide for CCNP ENCOR
Why OSPFv2 and OSPFv3 Configuration is Important
Open Shortest Path First (OSPF) is one of the most widely deployed Interior Gateway Protocols (IGPs) in modern enterprise networks. Understanding OSPFv2 and OSPFv3 configuration is critical because:
- Industry Standard Protocol: OSPF is used extensively in large-scale networks due to its scalability and open standards nature
- IPv4 and IPv6 Support: OSPFv2 handles IPv4 routing while OSPFv3 supports both IPv4 and IPv6, making knowledge of both essential for modern networks
- Convergence and Efficiency: Proper OSPF configuration ensures fast convergence times and optimal path selection
- Network Stability: Misconfigured OSPF can cause routing loops, black holes, and network instability
- Exam Requirement: OSPF configuration is a core topic in the CCNP ENCOR exam and directly impacts your certification success
What is OSPFv2 and OSPFv3?
OSPFv2 is an Interior Gateway Protocol defined in RFC 2328 that uses the Shortest Path First (SPF) algorithm to calculate the best path to destinations. It is designed specifically for IPv4 networks and operates at Layer 3 of the OSI model.
OSPFv3 is the evolved version of OSPF, defined in RFC 5340, specifically designed for IPv6 networks, though it can also support IPv4 in address families mode. It addresses limitations of OSPFv2 and provides better support for modern networking requirements.
Key Characteristics of OSPFv2:
- Classless routing protocol supporting Variable Length Subnet Masks (VLSM)
- Administrative Distance of 110
- Metric based on cost (inverse of bandwidth: 100,000,000 / bandwidth)
- Unicast routing for IPv4
- Uses multicast addresses 224.0.0.5 and 224.0.0.6
- Uses Hello packets for neighbor discovery and keepalive
Key Characteristics of OSPFv3:
- Supports both IPv4 and IPv6 using Address Family concept
- Administrative Distance of 110 (same as OSPFv2)
- Same SPF algorithm as OSPFv2
- Uses IPv6 multicast addresses FF02::5 and FF02::6
- Simplified protocol design with fewer packet types
- Better support for multiple routing instances
- Link-local addresses used for neighbor adjacencies in IPv6
How OSPF Works: Fundamental Concepts
OSPF Areas and Hierarchy
OSPF divides networks into logical areas to improve scalability:
- Area 0 (Backbone): The core area to which all other areas must connect; all inter-area traffic must pass through Area 0
- Regular Areas: Standard areas connected to the backbone
- Stub Areas: Areas that receive a default route instead of external routes, reducing LSDB size
- Totally Stubby Areas: Stub areas that also don't receive summary routes from other areas
- NSSA (Not So Stubby Areas): Allows redistribution of external routes within the area while still blocking external routes from other areas
Router Types
- Internal Router: All interfaces belong to the same area
- Area Border Router (ABR): Connects multiple areas and participates in the backbone
- Backbone Router: Has at least one interface in Area 0
- Autonomous System Border Router (ASBR): Redistributes routes from other routing protocols or autonomous systems
OSPF Neighbor States
Routers progress through several states before becoming fully adjacent neighbors:
- Down: No Hello packets have been received from the neighbor
- Init: Hello packet received but bidirectional communication not established
- 2-Way: Bidirectional communication established; DR/BDR election occurs at this state
- ExStart: Neighbors begin exchanging Database Description (DD) packets
- Exchange: DD packets being exchanged to synchronize LSDB
- Loading: Link State Request (LSR) packets sent to retrieve missing LSAs
- Full: Neighbors fully synchronized; routing information exchanged
Link State Database (LSDB) and SPF Algorithm
Each OSPF router maintains a complete topology database of the network. When a change occurs, routers flood Link State Advertisements (LSAs) throughout the network. The SPF algorithm (Dijkstra's algorithm) calculates the shortest path tree with the router as the root, determining the best routes to all destinations.
Hello Protocol and Timers
OSPF uses Hello packets to:
- Discover neighbors on directly connected networks
- Maintain neighbor relationships
- Perform DR/BDR election on broadcast networks
Default timers:
- Hello interval: 10 seconds (broadcast networks), 30 seconds (non-broadcast)
- Dead interval: 40 seconds (broadcast networks), 120 seconds (non-broadcast)
If a router does not receive a Hello from a neighbor within the Dead interval, the neighbor is declared down.
OSPFv2 Configuration
Basic OSPFv2 Configuration Steps
Step 1: Enable OSPF Process
Enable OSPF with a process ID (1-65535, locally significant):
Router(config)# router ospf 1
Step 2: Configure Router ID
Set the Router ID (required for OSPF operation):
Router(config-router)# router-id 1.1.1.1
The router ID is selected in this order:
- Manually configured router-id
- Highest IP address on loopback interfaces
- Highest IP address on active interfaces
Step 3: Define Networks to Advertise
Use the network command with wildcard mask:
Router(config-router)# network 192.168.1.0 0.0.0.255 area 0
This command advertises networks matching the subnet via the specified area. All interfaces matching the network statement become OSPF interfaces.
Step 4: Configure Interface Parameters (Optional but Recommended)
Router(config-if)# ip ospf cost 50 - Manually set interface cost
Router(config-if)# ip ospf hello-interval 5 - Change Hello interval
Router(config-if)# ip ospf dead-interval 20 - Change Dead interval
Router(config-if)# ip ospf priority 200 - Influence DR election
Router(config-if)# ip ospf network point-to-point - Force point-to-point mode
Router(config-if)# ip ospf authentication-key password123 - Enable simple authentication
Router(config-if)# ip ospf message-digest-key 1 md5 password123 - Enable MD5 authentication
Common OSPFv2 Configuration Examples
Example 1: Basic Two-Router OSPF Network
Router1:
router ospf 1
router-id 1.1.1.1
network 10.0.0.0 0.0.0.255 area 0
network 10.1.1.0 0.0.0.255 area 0
Router2:
router ospf 1
router-id 2.2.2.2
network 10.0.0.0 0.0.0.255 area 0
network 10.2.2.0 0.0.0.255 area 0
Example 2: Multi-Area OSPF with ABR
Area Border Router (ABR):
router ospf 1
router-id 3.3.3.3
network 10.0.0.0 0.0.0.255 area 0
network 10.1.0.0 0.0.0.255 area 1
Example 3: OSPF with Stub Area
ABR:
router ospf 1
network 10.0.0.0 0.0.0.255 area 0
network 10.1.0.0 0.0.0.255 area 1
Area 1 Router:
router ospf 1
network 10.1.0.0 0.0.0.255 area 1
area 1 stub
Verifying OSPFv2 Configuration
show ip ospf - Display OSPF process information
show ip ospf neighbor - List OSPF neighbors and their states
show ip ospf database - Display Link State Database
show ip route ospf - Show OSPF-learned routes
show ip ospf interface - Display OSPF interface parameters
show ip ospf interface brief - Quick interface overview
OSPFv3 Configuration
OSPFv3 vs OSPFv2 Key Differences
- IPv6 Native Support: OSPFv3 is designed for IPv6 from the ground up
- Address Family: Modern OSPFv3 uses address-family concept to support multiple protocols
- Link-Local Addresses: Neighbor relationships use link-local addresses in IPv6
- No Wildcard Masks: Uses prefix length notation instead
- Simplified Configuration: Configuration is done at interface level for IPv6
- Multiple Instances: Better support for multiple OSPF instances on same network
Basic OSPFv3 Configuration Steps
Step 1: Enable IPv6 and Configure Interface Addresses
Router(config)# ipv6 unicast-routing
Router(config-if)# ipv6 address 2001:db8:1::1/64
Step 2: Enable OSPFv3 Process
Router(config)# ipv6 router ospf 1
Step 3: Configure Router ID (Required for OSPFv3)
Router(config-rtr)# router-id 1.1.1.1
Note: Router ID must be an IPv4-formatted address even for IPv6 networks.
Step 4: Enable OSPF on Interfaces
Router(config-if)# ipv6 ospf 1 area 0
This is the primary difference from OSPFv2 – interfaces are explicitly enabled for OSPF rather than using a network command.
Step 5: Configure Interface Parameters (Optional)
Router(config-if)# ipv6 ospf cost 50 - Set interface cost
Router(config-if)# ipv6 ospf hello-interval 5 - Change Hello interval
Router(config-if)# ipv6 ospf dead-interval 20 - Change Dead interval
Router(config-if)# ipv6 ospf priority 200 - Influence DR election
Router(config-if)# ipv6 ospf authentication ipsec spi 256 md5 password123 - Enable IPsec authentication
OSPFv3 with Address Families (Modern Configuration)
Modern OSPFv3 supports address families for both IPv4 and IPv6:
Router(config)# router ospfv3 1
Router(config-router)# router-id 1.1.1.1
Router(config-router)# address-family ipv6 unicast
Router(config-router-af)# network 2001:db8:1::/48 area 0
Router(config-router)# address-family ipv4 unicast
Router(config-router-af)# network 192.168.1.0 0.0.0.255 area 0
OSPFv3 Configuration Example
Router A:
ipv6 unicast-routing
interface GigabitEthernet0/0
ipv6 address 2001:db8:1::1/64
ipv6 ospf 1 area 0
!
ipv6 router ospf 1
router-id 1.1.1.1
Router B:
ipv6 unicast-routing
interface GigabitEthernet0/0
ipv6 address 2001:db8:1::2/64
ipv6 ospf 1 area 0
!
ipv6 router ospf 1
router-id 2.2.2.2
Verifying OSPFv3 Configuration
show ipv6 ospf - Display OSPFv3 process information
show ipv6 ospf neighbor - List OSPFv3 neighbors
show ipv6 ospf database - Display LSDB
show ipv6 route ospf - Show OSPFv3-learned routes
show ipv6 ospf interface - Display OSPF interface parameters
Advanced OSPF Configuration Topics
Area Types and Configuration
Stub Area: Blocks external LSAs (Type 5), receives summary route from ABR
Router(config-router)# area 1 stub
Totally Stubby Area: Blocks both external and summary LSAs
Router(config-router)# area 1 stub no-summary
NSSA (Not So Stubby Area): Allows Type 7 LSAs for external route redistribution
Router(config-router)# area 1 nssa
NSSA Totally Stubby: Combines NSSA with totally stubby
Router(config-router)# area 1 nssa no-summary
Route Redistribution
Redistribute routes from other protocols into OSPF:
Router(config-router)# redistribute bgp 65000 metric 100 metric-type 2
Key parameters:
- metric: Cost assigned to redistributed routes
- metric-type 1: Type 1 external (additive metric)
- metric-type 2: Type 2 external (fixed metric, default)
- subnets: Include subnet routes (important!)
Route Summarization
Inter-area summarization (on ABR):
Router(config-router)# area 1 range 10.1.0.0 255.255.0.0
External route summarization (on ASBR):
Router(config-router)# summary-address 10.0.0.0 255.0.0.0
Authentication
OSPFv2 Simple Authentication:
Router(config-if)# ip ospf authentication-key cisco123
Router(config-router)# area 0 authentication
OSPFv2 MD5 Authentication:
Router(config-if)# ip ospf message-digest-key 1 md5 cisco123
Router(config-router)# area 0 authentication message-digest
OSPFv3 IPsec Authentication:
Router(config-if)# ipv6 ospf authentication ipsec spi 256 md5 cisco123
Common OSPF Configuration Issues and Troubleshooting
Neighbors Not Forming
- Check network connectivity: Ensure IP connectivity between neighbors
- Verify Hello/Dead timers match: Timers must be identical between neighbors
- Check network type: Broadcast vs point-to-point must be compatible
- Verify area match: Both routers must be in the same area
- Check authentication: Authentication passwords must match if enabled
- Verify subnet masks: Neighbors must be on the same subnet
Command: show ip ospf neighbor detail
Routes Not Being Advertised
- Verify network command: Network statement must match the interface IP
- Check interface status: Interface must be up and running
- Verify area configuration: Interface should be configured for an area
- Check passive interfaces: Passive interfaces don't form neighbors
- Verify cost calculation: Cost must be positive integer
Command: show ip ospf database self-originate
Suboptimal Routing
- Check interface costs: Verify cost reflects desired path
- Verify SPF calculation: Review LSDB for topology accuracy
- Check for equal-cost paths: OSPF performs ECMP for equal costs
- Review summarization: May be hiding more specific routes
Command: show ip ospf interface | include cost
Exam Tips: Answering Questions on OSPFv2 and OSPFv3 Configuration
General Exam Strategy
- Understand the Scenario: Carefully read the scenario to understand network requirements (areas, redundancy, scalability)
- Identify Router Types: Determine which routers are Internal, ABR, Backbone, or ASBR routers
- Look for Area Types: Questions often involve stub, totally stubby, or NSSA areas
- Consider Scalability: Larger networks require hierarchical design with multiple areas
- Time Management: Configuration questions can be lengthy; allocate time carefully
Common Question Patterns
Pattern 1: Network Connectivity and Neighbor Formation
Question type: "Routers are configured with OSPF but neighbors are not forming. What is the most likely cause?"
Approach:
- Check Hello and Dead timer mismatches (most common)
- Verify network command configuration
- Look for passive interface settings
- Check area mismatches
- Review authentication settings
Tip: Timer mismatches are the #1 cause of neighbor formation failures in exam scenarios.
Pattern 2: Route Propagation Across Areas
Question type: "A network in Area 1 is not being received in Area 2. What configuration is missing?"
Approach:
- Verify ABR exists connecting both areas
- Check if stub area is blocking summary routes
- Verify network commands in Area 1
- Review LSDB on ABR
- Check for range commands that may be suppressing routes
Tip: Remember that all inter-area traffic must traverse Area 0. If no path through Area 0 exists, inter-area routing fails.
Pattern 3: IPv4 vs IPv6 Configuration
Question type: "Configure OSPF for both IPv4 and IPv6 networks on the same router."
Approach:
- For OSPFv2 (IPv4): Use traditional network commands in router ospf mode
- For OSPFv3 (IPv6): Use interface-level configuration with ipv6 ospf commands
- For modern OSPFv3: Use address-family mode to support both
- Remember Router ID must be IPv4 format for both
Tip: Exam may ask to identify which protocol/version supports which features. OSPFv3 is more scalable but OSPFv2 remains prevalent.
Pattern 4: Area Type Selection
Question type: "Which area type reduces the LSDB size while still allowing external route redistribution?"
Approach:
- Stub Area: Blocks external LSAs, receives default route
- Totally Stubby: Blocks both external and summary LSAs
- NSSA: Blocks external (Type 5) but allows Type 7 for redistribution
- NSSA Totally Stubby: Similar to NSSA but also blocks summary routes
- The answer is NSSA when external redistribution is required
Tip: Create a mental matrix of area types with their characteristics. This is frequently tested.
Configuration Question Approach
Step 1: Identify Current State - What is already configured?
Step 2: Identify Goal State - What needs to happen?
Step 3: Identify Missing Configuration - What commands are needed?
Step 4: Determine Correct Router - Which router(s) need changes?
Step 5: Verify Command Syntax - Is the syntax correct for the IOS version?
Key Syntax to Remember
OSPFv2 Network Command (Wildcard Mask):
network 192.168.1.0 0.0.0.255 area 0
- The wildcard mask has 0s where bits must match and 1s for don't-care bits
- This is the INVERSE of subnet mask (opposite bits)
OSPFv3 Interface Configuration (IPv6):
ipv6 ospf 1 area 0
- Done at interface level, not in router config
- No wildcard mask needed
Router ID Configuration (Both Versions):
router-id 1.1.1.1
- Must be in dotted decimal format
- Must be unique within the OSPF domain
Critical Concepts to Understand for Exam
1. Hello and Dead Intervals: Must match between neighbors. Default is 10/40 for broadcast, 30/120 for non-broadcast.
2. Cost Calculation: Cost = 100,000,000 / bandwidth in bps. Understand why faster links have lower costs.
3. SPF Algorithm: Each router calculates its own SPF tree. Different routers may have different best paths based on their location in the topology.
4. LSDB Synchronization: All routers in an area must have identical LSDB in the Full state.
5. Area 0 Requirement: Multi-area designs require Area 0 as the backbone. All other areas must connect to Area 0 directly or via an ABR.
6. Router ID Selection: Process: Manual > Loopback highest IP > Interface highest IP
7. Neighbor Adjacency Requirements: Same subnet, same Hello/Dead timers, same authentication, same area, compatible network types
Exam Question Red Flags
- Passive Interface: If neighbors aren't forming, check if interface is passive
- Network Command Accuracy: Wildcard mask mistakes are common error sources
- Area Type Confusion: Be precise about what each area type blocks
- Timers Mismatch: Always verify Hello/Dead timer values in questions
- Missing Router ID: OSPFv3 requires explicit router ID (even for IPv6)
- Authentication Overlooked: Don't miss authentication configuration requirements
Practice Question Example
Scenario: "You have configured OSPF on Router A (Area 0) and Router B (Area 1). Router B is configured with 'area 1 stub'. Routes from Area 0 are being advertised to Area 1, but routes from Area 1 are not being received in Area 0. What is the most likely cause?"
Analysis:
- Area 1 is a stub area – this doesn't prevent inbound advertising to Area 0
- Check if Router B has the network command configured for its internal network
- Check if Router A (ABR) has the network command for Area 1 interface
- Verify both routers have compatible network commands
- Check LSDB on both routers
Answer: Router B is likely not advertising its networks to OSPF. Verify the network command or area command on Router B's interface facing the Area 1 network is configured.
Study Tips for Exam Success
- Use GNS3 or Cisco Packet Tracer: Practice configuring OSPF networks with multiple areas
- Review RFC 2328: Focus on areas, LSA types, and neighbor state machine
- Memorize Timer Values: Default hello/dead intervals are frequently tested
- Draw Network Diagrams: For complex questions, sketch the network to understand area relationships
- Practice Verification Commands: Be comfortable with show commands to verify configuration
- Compare OSPFv2 and OSPFv3: Create side-by-side comparison of features and commands
- Study Past Questions: CCNP exam simulators and study materials often repeat themes
- Understand Why, Not Just How: Understand why OSPF makes routing decisions, not just the commands
Final Exam Readiness Checklist
- ☐ Can configure basic OSPFv2 with network commands
- ☐ Can configure OSPFv3 with interface-level commands
- ☐ Can configure multi-area OSPF with ABR
- ☐ Can identify and fix neighbor formation issues
- ☐ Can explain and configure stub, totally stubby, and NSSA areas
- ☐ Can perform route summarization for inter-area traffic
- ☐ Can configure and verify OSPF authentication
- ☐ Can troubleshoot OSPF routing issues using show commands
- ☐ Can compare OSPFv2 and OSPFv3 features and use cases
- ☐ Can configure modern OSPFv3 with address families
- ☐ Understand Router ID selection process
- ☐ Can calculate OSPF cost and explain metric usage
🎓 Unlock Premium Access
CCNP Enterprise (ENCOR) + ALL Certifications
- 🎓 Access to ALL Certifications: Study for any certification on our platform with one subscription
- 2873 Superior-grade CCNP Enterprise (ENCOR) practice questions
- Unlimited practice tests across all certifications
- Detailed explanations for every question
- ENCOR 350-401: 5 full exams plus all other certification exams
- 100% Satisfaction Guaranteed: Full refund if unsatisfied
- Risk-Free: 7-day free trial with all premium features!