Configure OSPFv2 Single Area on Cisco Router (Multiaccess – Ethernet Interface)

Configure OSPFv2 Single Area on Cisco Router (Multiaccess – Ethernet Interface)

In this tutorial, we will explore how to configure OSPFv2 Single Area on a Cisco router with a multiaccess Ethernet interface. The process involves configuring interfaces and enabling OSPF on routers based on a provided topology. The setup uses two routers (R1 and R2) and multiple PCs connected in different subnets.

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 (Multiaccess – Ethernet Interface) Topology
OSPFv2 Single Area on Cisco Router (Multiaccess – Ethernet Interface) Topology

The topology consists of the following components:

  • R1 connected to:
    • Subnet: 192.168.10.0/24 (PC10)
    • Subnet: 192.168.20.0/24 (PC20)
    • Subnet: 192.168.30.0/24 (shared link to R2)
  • R2 connected to:
    • Subnet: 192.168.40.0/24 (PC40)
    • Subnet: 192.168.50.0/24 (PC50)
    • Subnet: 192.168.30.0/24 (shared link to R1)

Each subnet is configured on GigabitEthernet or FastEthernet interfaces.

Router Configuration

Below are the step-by-step configurations for both routers:


Router R1 Configuration

  1. Set the hostname:
    Router> enable
    Router# configure terminal
    Router(config)# hostname R1
    
  2. Configure Interfaces:
    • GigabitEthernet 0/0/1 (Connected to PC10):
      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
      
    • GigabitEthernet 0/0/2 (Connected to PC20):
      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
      
    • GigabitEthernet 0/0/0 (Connected to R2):
      R1(config)# interface gigabitEthernet 0/0/0
      R1(config-if)# no shutdown
      R1(config-if)# ip address 192.168.30.1 255.255.255.0
      R1(config-if)# exit
      
  3. Enable OSPFv2:
    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
    

Router R2 Configuration

  1. Set the hostname:
    Router> enable
    Router# configure terminal
    Router(config)# hostname R2
    
  2. Configure Interfaces:
    • GigabitEthernet 0/0/1 (Connected to PC40):
      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
      
    • GigabitEthernet 0/0/2 (Connected to PC50):
      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
      
    • GigabitEthernet 0/0/0 (Connected to R1):
      R2(config)# interface gigabitEthernet 0/0/0
      R2(config-if)# no shutdown
      R2(config-if)# ip address 192.168.30.2 255.255.255.0
      R2(config-if)# exit
      
  3. Enable OSPFv2:
    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, you can verify the OSPF settings and connectivity:

  1. Check OSPF neighbors:
    R1# show ip ospf neighbor
    R2# show ip ospf neighbor
    
  2. Check OSPF routing table:
    R1# show ip route
    R2# show ip route
    
  3. Ping between PCs across routers:
    • From PC10 (192.168.10.10), ping PC50 (192.168.50.10):
      > ping 192.168.50.10
      
    • From PC20 (192.168.20.10), ping PC40 (192.168.40.10):
      > ping 192.168.40.10
      

Conclusion

This configuration ensures that OSPFv2 is operational in a single area across multiaccess Ethernet interfaces. This setup allows for dynamic routing and efficient network communication between subnets.