Routing Over Multiple Paths with Equal Costs

Problem

You want to restrict how many paths your router can use simultaneously to reach a particular destination.

Solution

By default, the router will install up to four routes to the same destination for most routing protocols, except BGP where the default is one, and static routes that allow six. You can change this default to any value between one and sixteen by using the configuration command maximum-paths. In IOS versions before 12.3(2)T, the maximum number of paths was six:

Router#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#router ospf 65510
Router(config-router)#maximum-paths 2
Router(config-router)#end 
Router#

The same syntax works for other routing protocols:

Router#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#router eigrp 99
Router(config-router)#maximum-paths 2
Router(config-router)#end
Router#

In IOS Version 12.2T, Cisco introduced a new command to allow you to configure the number iBGP paths separately from eBGP. You set the maximum number of eBGP paths using the standard maximum-paths command, and specify the number of paths for iBGP separately:

Router#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#router bgp 65511
Router(config-router)#maximum-paths 2
Router(config-router)#maximum-paths ibgp 3
Router(config-router)#end
Router#

IOS releases prior to 12.2T only include a standard maximum-paths ...

Get Cisco IOS Cookbook, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.