OSPFRouter Config

maximum-paths [n]

Configures the maximum number of equal-cost paths that OSPF can install in the routing table for a single destination, enabling load balancing across multiple links.

Syntax·Router Config
maximum-paths [n]

When to Use This Command

  • Load balance traffic across two equal-cost OSPF links between routers to increase bandwidth utilization.
  • Configure a maximum of 4 paths in a redundant OSPF network with multiple parallel links to ensure efficient load sharing.
  • Limit the number of paths to 1 to force OSPF to use only the best path, simplifying troubleshooting or meeting specific policy requirements.
  • Increase the maximum paths from default (4) to 8 on high-end routers supporting more ECMP paths for better load distribution.

Command Examples

Set maximum paths to 2 for load balancing

maximum-paths 2
Router(config-router)# maximum-paths 2
Router(config-router)# end
Router# show ip route ospf
     10.1.1.0/24 is variably subnetted, 2 subnets, 2 masks
O       10.1.1.0/24 [110/2] via 192.168.1.1, 00:00:12, GigabitEthernet0/0
                    [110/2] via 192.168.2.1, 00:00:12, GigabitEthernet0/1

The command sets OSPF to use up to 2 equal-cost paths. The 'show ip route ospf' output displays two next-hop entries for the same destination (10.1.1.0/24), each with the same metric (110/2), indicating load balancing across two interfaces.

Reset to default maximum paths (4)

no maximum-paths
Router(config-router)# no maximum-paths
Router(config-router)# end
Router# show ip protocols | include maximum
  Maximum path: 4

The 'no maximum-paths' command resets the value to the default (4). The 'show ip protocols' output confirms the maximum path count is 4.

Understanding the Output

The command itself does not produce output; its effect is seen in the routing table. Use 'show ip route' to see multiple next-hop entries for the same destination when ECMP is active. Each entry shows the OSPF-learned route with the administrative distance (110) and metric (cost). The presence of multiple lines for the same network indicates load balancing. A single entry means only one path is used (either because only one exists or maximum-paths is set to 1). The metric must be equal for paths to be considered equal-cost. If paths have different metrics, only the best (lowest metric) is installed regardless of the maximum-paths setting.

CCNA Exam Tips

1.

CCNA exam tip: The default maximum-paths for OSPF is 4, but the exam may ask about the range (1 to 16) or the default (4).

2.

CCNA exam tip: ECMP requires equal cost; OSPF cost is based on bandwidth (reference bandwidth / interface bandwidth). Ensure paths have identical costs for load balancing.

3.

CCNA exam tip: The 'maximum-paths' command is configured in router configuration mode for OSPF, not interface mode.

4.

CCNA exam tip: A common exam scenario: you see multiple routes for the same network in the routing table; the question may ask why or how to limit them.

Common Mistakes

Mistake 1: Setting maximum-paths to a value higher than the number of equal-cost paths available; no effect and no error.

Mistake 2: Forgetting that OSPF must have equal-cost paths; if costs differ, only one path is used even if maximum-paths is high.

Mistake 3: Applying the command in global configuration mode instead of router configuration mode (e.g., 'router ospf 1').

Related Commands

Practice for the CCNA 200-301

Test your knowledge with hundreds of CCNA practice questions covering all exam domains.

Practice CCNA Questions