OSPF configuration using Packet Tracer
In Packet Tracer, you can configure an Open Shortest Path First (OSPF) dynamic
routing protocol to allow routers to exchange routing information. Here's how to
configure OSPF in a simple topology.
Scenario
Three routers (Router2, Router3, Router4, Router5)
Router2: [Link]/24 (Directly connected)
Router3: [Link]/24 (Directly connected)
Router4: [Link]/24 (Directly connected)
Router5: [Link]/24 (Directly connected)
Use OSPF Area 0 for routing.
Steps to Configure OSPF
1. Assign IP Addresses
Configure IP addresses for each router's interfaces.
Router2:
interface GigabitEthernet0/0
ip address [Link] [Link]
no shutdown
interface Serial0/0/0
ip address [Link] [Link]
no shutdown
Router3:
interface GigabitEthernet0/0
ip address [Link] [Link]
no shutdown
interface Serial0/0/0
ip address [Link] [Link]
no shutdown
interface Serial0/0/1
ip address [Link] [Link]
no shutdown
Router4:
interface GigabitEthernet0/0
ip address [Link] [Link]
no shutdown
interface Serial0/0/0
ip address [Link] [Link]
no shutdown
interface Serial0/0/1
ip address [Link] [Link]
no shutdown
Router5:
interface GigabitEthernet0/0
ip address [Link] [Link]
no shutdown
interface Serial0/0/1
ip address [Link] [Link]
no shutdown
2. Enable OSPF on Each Router
Activate OSPF routing and specify the networks.
Router2:
router ospf 1
network [Link] [Link] area 1
network [Link] [Link] area 1
Router3:
router ospf 1
network [Link] [Link] area 1
network [Link] [Link] area 1
network [Link] [Link] area 1
Router4:
router ospf 1
network [Link] [Link] area 1
network [Link] [Link] area 1
network [Link] [Link] area 1
Router5:
router ospf 1
network [Link] [Link] area 1
network [Link] [Link] area 1
3. Verify OSPF Neighbors
After configuring OSPF, verify that neighboring routers form OSPF adjacencies.
Use the following command:
show ip ospf neighbor
4. Verify the Routing Table
Check if the routers have learned routes dynamically.
Command:
show ip route
You should see OSPF routes with an "O" flag in the routing table.
5. Test Connectivity
Ping devices in other networks from any router to confirm reachability.
Notes
The wildcard mask (e.g., [Link]) represents the range of IPs for a given
subnet.
OSPF Area 0 is the backbone area and is required for all OSPF implementations.
Ensure all interfaces are up using no shutdown