Dynamic Routing Protocols on Cisco IOS XE: OSPF Configuration, Verification & Best Practices (2025 Guide)

Dynamic Routing Protocols on Cisco IOS XE: OSPF Configuration, Verification & Best Practices (2025 Guide)

In this post: we will learn the ins and outs of Cisco IOS XE–supported dynamic routing protocols, with a special spotlight on OSPF configuration, optimization, and verification.

Dynamic routing protocols is designed to help networks intelligently manage and propagate routes. These protocols automate route discovery, reduce manual configuration, and adapt quickly to network changes—essential for maintaining resilient, scalable networks.

Dynamic routing protocols that are supported on Cisco IOS XE Software include the following:

Protocol Key Traits
RIP Simple, distance-vector protocol with max hop count of 15—ideal for small networks
EIGRP Cisco’s hybrid protocol offering fast convergence and partial updates (Cisco‑proprietary)
OSPF Industry-standard link-state protocol known for fast convergence and scalability
IS‑IS Another open-standard link-state protocol (more common in carrier environments)
BGP Exterior gateway protocol used for routing between autonomous systems (ISPs, large enterprises)

OSPF is the most commonly used open-standard dynamic routing protocol. It is a routing protocol that is known for its fast convergence and scalability, making it a popular choice for large-enterprise networks. 


Configuring Basic OSPF on Cisco IOS XE

You can configure a basic OSPF in two steps:

1. Enable the OSPF routing process.

Router(config)# router ospf process-id

2. Identify the networks on which you want to run OSPF.

Router(config-router)# network ip-address wildcard-mask area area-id

Sample config:

Router(config)# router ospf 1
Router(config-router)# network 192.168.1.0 0.0.0.255 area 0
Part Meaning
router ospf 1 Starts the OSPF process with process-id 1
network 192.168.1.0 The network you want to include in OSPF
0.0.0.255 Wildcard mask (opposite of subnet mask 255.255.255.0)
area 0 Assigns the matched interface to OSPF Area 0 (backbone area)

OSPF Verification Process:

You can use several commands to verify the configuration of OSPF.

  1. Show OSPF configuration:
Router# show running-config | section ospf

Outputs:

router ospf 1
 router-id 192.0.2.3
 network 10.0.1.0 0.0.0.255 area 0
 network 10.2.1.0 0.0.0.255 area 0
 network 10.10.13.0 0.0.0.255 area 0

  1. Show OSPF cost:
Router# show ip ospf interface brief

Outputs:

Interface    PID   Area      IP Address/Mask    Cost  State Nbrs    F/C
Lo0           1     0         10.10.11.1/24       1       P2P       0/0
Et0/1         1     0         10.1.1.1/24         10      BDR       1/1
Et0/0         1     0         10.0.1.1/24         10      BDR       1/1
  • OSPF Cost = how "expensive" a link is in OSPF.
  • Lower cost = better route.
  • OSPF uses cumulative cost over a path to choose the shortest path.
  • You can manually set cost to influence OSPF decisions.

💡 Tip: We can manually adjust cost under interface config:

Router(config)# interface [interface-name]
Router(config-if)# ip ospf cost [value]

Example: Suppose you have two links between routers:

  • A fast link (1 Gbps)
  • A backup link (100 Mbps)

You might set:

interface GigabitEthernet0/1
  ip ospf cost 1

interface FastEthernet0/1
  ip ospf cost 100

This ensures OSPF prefers the 1 Gbps link unless it goes down.


  1. Displays the OSPF neighbor information on a per-interface basis
Router# show ip ospf neighbor

Outputs:

Neighbor           ID    Pri State      Dead Time    Address         Interface
192.0.2.3           1     FULL/DR        00:00:38    10.1.1.3        Ethernet0/1
192.0.2.2           1     FULL/DR        00:00:34    10.0.1.2        Ethernet0/0

Explain: The command show ip ospf neighbor shows the OSPF neighbors that R1 is connected to. In this example, R1 has two neighbors:

  • 192.0.2.3 is connected through Ethernet0/1, IP address 10.1.1.3.
  • 192.0.2.2 is connected through Ethernet0/0, IP address 10.0.1.2.

Both neighbors are in the FULL/DR state, meaning R1 has fully formed OSPF connections with them, and they are the Designated Routers (DR) on their networks. The Dead Time shows how long R1 will wait before considering a neighbor down if it stops receiving Hello messages.

If you found this guide helpful, consider supporting me!

Read more