Ospf Cheat Sheet
Overview
Type | Link-State |
---|---|
Algorithm | Dijkstra |
Metric | Cost |
AD | 110 |
Standard | RFC 2328, 2740 |
Protocols | IP |
Transport | IP/89 |
Authentication | Plaintext, MD5 |
Router ID Selection
- Configured with
router-id
command. - If not manually configured, selects the highest IP address on any loopback interface in “up/up” state.
- If no loopback interfaces, selects the highest IP address on any non-loopback interface in “up/up” state.
OSPF Network Types
- Broadcast: Default for Ethernet networks.
- Non-Broadcast Multi-Access (NBMA): Used for networks like Frame Relay.
- Point-to-Point: Direct connection between two routers.
- Point-to-Multipoint: One router connected to multiple routers.
OSPF Packet Types
- Hello: Establishes and maintains neighbor relationships.
- Database Description (DBD): Summarizes the database contents.
- Link-State Request (LSR): Requests specific link-state records.
- Link-State Update (LSU): Sends link-state records.
- Link-State Acknowledgment (LSAck): Acknowledges receipt of link-state records.
Link State Advertisements
- Router Link (Type1)
- Network Link (Type2)
- Network Summary (Type 3)
- ASBR Symmary (Type 4)
- External Link (Type 5)
- NSSA External Link (Type 7)
OSPF States
- Down: No Hello packets received.
- Init: Hello packets received but no bidirectional communication.
- 2-Way: Bidirectional communication established.
- ExStart: Beginning of database exchange.
- Exchange: Routers exchange DBD packets.
- Loading: LSR packets sent to neighbors.
- Full: Routers are fully adjacent.
OSPF Area Types
- Backbone Area (Area 0): Central area to which all other areas connect.
- Stub Area: Does not receive external routes.
- Totally Stubby Area: Only receives default route from ABR.
- Not-So-Stubby Area (NSSA): Allows external routes but restricts certain types. Useful Commands show ip ospf neighbor: Displays OSPF neighbor information. show ip ospf: Displays general OSPF information. show ip protocols: Displays routing protocol information.
Cisco IOS Configuration Examples
Basic OSPF Configuration
router ospf 1
router-id 1.1.1.1
network 192.168.2.0 0.0.0.255 area 0
Configuring OSPF Authentication
interface GigabitEthernet0/0
ip ospf authentication message-digest
ip ospf message-digest-key 1 md5 YOUR_PASSWORD
Last updated on