OSPF (Open Shortest Path First) – Full
Configuration Guide
1. Basic Topology
Simple 3-router topology with Area 0 (Backbone) and Area 1 (Internal).
2. IP Addressing Plan
R1: G0/0 [Link]/30 (Area 0), G0/1 [Link]/24 (Area 1)
R2: G0/0 [Link]/30 (Area 0)
R3: G0/0 [Link]/24 (Area 1)
3. Single-Area Configuration
R1:
router ospf 1
router-id [Link]
network [Link] [Link] area 0
network [Link] [Link] area 0
R2:
router ospf 1
router-id [Link]
network [Link] [Link] area 0
R3:
router ospf 1
router-id [Link]
network [Link] [Link] area 0
4. Multi-Area Configuration
R1 (ABR):
router ospf 1
router-id [Link]
network [Link] [Link] area 0
network [Link] [Link] area 1
R2 (Area 0):
router ospf 1
router-id [Link]
network [Link] [Link] area 0
R3 (Area 1):
router ospf 1
router-id [Link]
network [Link] [Link] area 1
5. Passive Interfaces
router ospf 1
passive-interface default
no passive-interface GigabitEthernet0/0
6. OSPF Authentication
Simple: ip ospf authentication-key cisco123
ip ospf authentication
MD5: ip ospf message-digest-key 1 md5 mysecurekey
ip ospf authentication message-digest
7. OSPF Cost Control
ip ospf cost 50
or
auto-cost reference-bandwidth 1000
8. DR/BDR Election
R1: ip ospf priority 255 (Always DR)
R2: ip ospf priority 0 (Never DR)
9. External Route Redistribution
ip route [Link] [Link] [Link]
router ospf 1
redistribute static subnets
10. Default Route Advertisement
ip route [Link] [Link] [Link]
router ospf 1
default-information originate
11. Verification Commands
show ip ospf neighbor
show ip ospf interface
show ip ospf database
show ip route ospf
12. Summary
OSPF is a fast, link-state, open-standard routing protocol using Dijkstra’s SPF algorithm.
Supports multiple areas, authentication, DR/BDR, and external route redistribution.