Load Balancing with OSPF

Load balancing is a standard functionality of Cisco IOS Software that is available across all router platforms. It is inherent to the forwarding process in the router, and it enables a router to use multiple paths to a destination when it forwards packets. The number of paths used is limited by the number of entries that the routing protocol puts in the routing table. Four entries is the default in Cisco IOS Software for IP routing protocols except for BGP. BGP has a default of one entry. The maximum number of paths you can configure is 16.

Figure 4-6 shows an example of configuring an OSPF router to load balance across six equal-cost paths.

Figure 4-6 OSPF Equal-Cost Load Balancing

Figure 4-6 OSPF Equal-Cost Load Balancing

Calculate Cost Ofospf

The cost (or metric) of an interface in OSPF indicates the overhead that is required to send packets across a certain interface. The cost of an interface is inversely proportional to its bandwidth. A higher bandwidth indicates a lower cost. By default, Cisco routers calculate the cost of an interface based on the bandwidth. However, you can force the cost of an interface with the command ip ospf cost {value} in interface configuration mode.

If equal-cost paths exist to the same destination, the Cisco implementation of OSPF can keep track of up to 16 next hops to the same destination in the routing table (which is called load balancing). By default, the Cisco router supports up to four equal-cost paths to a destination for OSPF. Use the maximum-paths command under the OSPF router process configuration mode to set the number of equal-cost paths in the routing table, as shown in Example 4-8.

Example 4-8 Setting the Number of Equal-Cost Paths in the Routing Table


#router ospf 1



paths ?

<1-16> Number

of paths



paths 3

You can use the show ip route command to find equal-cost routes. Following is an example of the show ip route command output for a specific subnet that has multiple routes available in the routing table. Example 4-9 shows three equal-cost paths to the network.

Example 4-9 Finding Equal-Cost Routes with the show ip route Command

RouterX#show ip route

Routing entry for

Known via "ospf 1", distance 110, metric 74, type intra area

Redistributing via ospf 1

Last update from on Seriall, 00:00:01 ago

Routing Descriptor Blocks:

*, from, 00:00:01 ago

via Serial2

Route metric is 74, traffic share count is

1, from, 00:00:01 ago

via Serial3

Route metric is 74, traffic share count is

1, from, 00:00:01 ago

via Seriall

Route metric is 74, traffic share count is


Notice the three routing descriptor blocks. Each block is one available route. Also note the asterisk (*) next to one of the block entries. The asterisk corresponds to the active route that is used for new traffic. The term "new traffic" corresponds to a single packet or an entire flow to a destination, depending on whether the router is performing per-destination or per-packet load balancing.

Was this article helpful?

+18 -7


  • amina
    How many equal cost paths can be load balanced in ospf?
    2 years ago
  • Uta
    How to uniqeule cost load balancing in ospf?
    1 year ago
  • Roberto
    How add routing table route using load balancer?
    9 months ago
  • Marie Vogel
    How many paths can ospf load balance?
    8 months ago
    Does ospf support load balancing?
    7 months ago
  • Balbo
    How does load balancing is handled in ospf protocol?
    6 months ago
  • kieron
    How many equals cost path does ospf support?
    6 months ago
    What do we call routes in the routing table with same cost?
    3 months ago
  • kaisa piili
    Is equal cost load balancing enabled by default in ospf3?
    3 months ago
  • mezan
    How to configure ospf for unequal cost load balancing?
    3 months ago
  • karolin
    How to check ospf load balancing?
    2 months ago
  • Pupa
    What is loadbalancing ospf?
    2 months ago
  • Monika
    How ospf load balancing works?
    2 months ago

Post a comment