Configure OSPFv2 Single Area on Cisco Router (Point to Point – Serial Interface)

Configure OSPFv2 Single Area on Cisco Router (Point to Point – Serial Interface)

When working with Cisco routers in networking, configuring OSPFv2 (Open Shortest Path First version 2) in a single area is a common and important skill. This tutorial walks you through setting up OSPFv2 for a simple point-to-point serial interface topology.

Dynamic Routing – OSPFv2 (IPv4)

  1. Configure OSPFv2 Single Area on Cisco Router (Multiaccess – Ethernet Interface)
  2. Configure OSPFv2 Single Area on Cisco Router (Point to Point – Serial Interface)

Topology Overview

OSPFv2 Single Area on Cisco Router (Point to Point – Serial Interface) Topology
OSPFv2 Single Area on Cisco Router (Point to Point – Serial Interface) Topology

The topology consists of two routers (R1 and R2) connected via a serial interface (S0/1/0 on R1 and S0/1/1 on R2). Each router also has two Ethernet networks connecting to PCs:

  • Router R1:
    • Ethernet Network 1: 192.168.10.0/24
    • Ethernet Network 2: 192.168.20.0/24
    • Serial Network: 192.168.30.0/30
  • Router R2:
    • Ethernet Network 1: 192.168.40.0/24
    • Ethernet Network 2: 192.168.50.0/24
    • Serial Network: 192.168.30.0/30

The PCs in each network are assigned static IP addresses for communication.

Objective

The goal is to configure OSPFv2 in a single area (area 0) so that all networks connected to the routers can communicate with one another.


Configuration Steps

Step 1: Configure Router R1

  1. Assign Hostname:
    Router>enable
    Router#configure terminal
    Router(config)#hostname R1
    
  2. Configure Gigabit Ethernet Interfaces:
    R1(config)#interface gigabitEthernet 0/0/1
    R1(config-if)#no shutdown
    R1(config-if)#ip address 192.168.10.1 255.255.255.0
    R1(config-if)#exit
    
    R1(config)#interface gigabitEthernet 0/0/2
    R1(config-if)#no shutdown
    R1(config-if)#ip address 192.168.20.1 255.255.255.0
    R1(config-if)#exit
    
  3. Configure Serial Interface:
    R1(config)#interface serial 0/1/0
    R1(config-if)#no shutdown
    R1(config-if)#ip address 192.168.30.1 255.255.255.252
    R1(config-if)#exit
    
  4. Enable OSPFv2 and Advertise Networks:
    R1(config)#router ospf 1
    R1(config-router)#network 192.168.10.0 0.0.0.255 area 0
    R1(config-router)#network 192.168.20.0 0.0.0.255 area 0
    R1(config-router)#network 192.168.30.0 0.0.0.255 area 0
    R1(config-router)#exit
    

Step 2: Configure Router R2

  1. Assign Hostname:
    Router>enable
    Router#configure terminal
    Router(config)#hostname R2
    
  2. Configure Gigabit Ethernet Interfaces:
    R2(config)#interface gigabitEthernet 0/0/1
    R2(config-if)#no shutdown
    R2(config-if)#ip address 192.168.40.1 255.255.255.0
    R2(config-if)#exit
    
    R2(config)#interface gigabitEthernet 0/0/2
    R2(config-if)#no shutdown
    R2(config-if)#ip address 192.168.50.1 255.255.255.0
    R2(config-if)#exit
    
  3. Configure Serial Interface:
    R2(config)#interface serial 0/1/1
    R2(config-if)#no shutdown
    R2(config-if)#ip address 192.168.30.2 255.255.255.252
    R2(config-if)#exit
    
  4. Enable OSPFv2 and Advertise Networks:
    R2(config)#router ospf 1
    R2(config-router)#network 192.168.30.0 0.0.0.255 area 0
    R2(config-router)#network 192.168.40.0 0.0.0.255 area 0
    R2(config-router)#network 192.168.50.0 0.0.0.255 area 0
    R2(config-router)#exit
    

Verification

After completing the configurations, verify the OSPF neighbor relationship and routing table.

  1. Check OSPF Neighbors: On both routers, use the following command:
    R1#show ip ospf neighbor
    
  2. Verify the Routing Table: Check the routes learned via OSPF:
    R1#show ip route
    
  3. Test Connectivity: Use the ping command from any PC to verify connectivity with devices in other networks.

Conclusion

By following this tutorial, you have successfully configured OSPFv2 in a single area for a Cisco router network with a point-to-point serial interface. This setup ensures dynamic routing and seamless communication between all connected networks.