Copyright (c) 2026 MindMesh Academy. All rights reserved. This content is proprietary and may not be reproduced or distributed without permission.
4.4.5. OSPF Configuration
Basic Configuration:
Router(config)# router ospf 1
Router(config-router)# router-id 1.1.1.1
Router(config-router)# network 192.168.1.0 0.0.0.255 area 0
Router(config-router)# network 10.0.0.0 0.255.255.255 area 0
Router(config-router)# passive-interface GigabitEthernet0/1
Interface-level Configuration (alternative):
Router(config)# interface GigabitEthernet0/0
Router(config-if)# ip ospf 1 area 0
Key OSPF Commands:
| Command | Purpose |
|---|---|
network ... area 0 | Enable OSPF on interfaces |
passive-interface | Stop sending Hellos (but still advertise network) |
default-information originate | Advertise default route into OSPF |
ip ospf cost | Manually set interface cost |
Verification:
Router# show ip ospf neighbor
Router# show ip ospf interface brief
Router# show ip ospf database
Router# show ip route ospf
Router# show ip protocols
Example show ip ospf neighbor output:
Neighbor ID Pri State Dead Time Address Interface
2.2.2.2 1 FULL/DR 00:00:32 192.168.1.2 Gi0/0
3.3.3.3 1 FULL/BDR 00:00:35 192.168.1.3 Gi0/0
⚠️ Exam Trap: OSPF uses wildcard masks in the network command, not subnet masks. Wildcard = inverse of subnet mask (0.0.0.255 = 255.255.255.0).