Configure ECMP

Enable Equal Cost MultiPath (ECMP) to permit routers to determine up to eight equal-cost paths to the same destination prefix. You can use the multiple paths for load-sharing of traffic, which provides fast convergence to alternative paths. By maximizing load sharing among equal-cost paths, you can maximize the efficiency of links between routers.

About this task

To configure ECMP for a VRF instance, after you enable ECMP globally, use VRF Router Configuration mode rather than Global Configuration mode.

Different hardware platforms can support a different number of ECMP paths. For more information, see Release Notes for VOSS.

Procedure

  1. Enter Global Configuration mode:

    enable

    configure terminal

  2. Enable ECMP globally:

    ip ecmp

  3. Optional: Configure the maximum number of ECMP paths:

    ip ecmp max-path <ECMP-Paths>

  4. Optional: Configure a prefix-list for the target destination:

    ip prefix-list WORD<1-64> <A.B.C.D/X> [ge <0-32>] [le <0-32>]

  5. Optional: Configure an ECMP pathlist to specify routes with the required number of paths:

    ip ecmp pathlist-<1-8> WORD<1-64>

  6. Optional: Return to Privileged EXEC mode:

    end

  7. Optional: Apply changes to all ECMP pathlist configurations:

    ip ecmp pathlist-apply [vrf WORD<1-16>]

Example

Define which IP prefixes use ECMP and which do not.

Switch:1>enable
Switch:1#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Switch:1(config)#ip ecmp
Switch:1(config)#ip prefix-list ecmpAllowed 192.0.2.0/24 ge 24 le 24
Switch:1(config)#ip prefix-list ecmpDenied 0.0.0.0/0 ge 0 le 32
Switch:1(config)#ip ecmp pathlist-2 ecmpAllowed
Switch:1(config)#ip ecmp pathlist-1 ecmpDenied
Switch:1(config)#end
Switch:1#ip ecmp pathlist-apply

Variable Definitions

The following table defines parameters for the ip ecmp command.

Variable

Value

max-path <ECMP-Paths>

Specifies the maximum number of ECMP paths. Different hardware platforms can support a different number of ECMP paths. For more information on the maximum number of ECMP paths supported on the switch, see the scaling information in Release Notes for VOSS.

pathlist-1 WORD<0-64>

Specifies one equal-cost path to the same destination prefix. To remove the policy, enter a blank string.

pathlist-2 WORD<0-64>

Specifies up to two equal-cost paths to the same destination prefix. To remove the policy, enter a blank string.

pathlist-3 WORD<0-64>

Specifies up to three equal-cost paths to the same destination prefix. To remove the policy, enter a blank string.

pathlist-4 WORD<0-64>

Specifies up to four equal-cost paths to the same destination prefix. To remove the policy, enter a blank string.

pathlist-5 WORD<0-64>

Specifies up to five equal-cost paths to the same destination prefix. To remove the policy, enter a blank string.

pathlist-6 WORD<0-64>

Specifies up to six equal-cost paths to the same destination prefix. To remove the policy, enter a blank string.

pathlist-7 WORD<0-64>

Specifies up to seven equal-cost paths to the same destination prefix. To remove the policy, enter a blank string.

pathlist-8 WORD<0-64>

Specifies up to eight equal-cost paths to the same destination prefix. To remove the policy, enter a blank string.

pathlist-apply [vrf WORD<1-16>]

Applies the pathlist configuration changes. You can optionally specify a VRF name.

The following table defines parameters for the ip prefix-list command.

Variable

Value

WORD<0-64>

Specifies the prefix list name.

<A.B.C.D/X>

Specifies the IP address and network mask in one of the following formats:

  • a.b.c.d/x

  • a.b.c.d/x.x.x.x

  • default

ge <0-32>

Specifies the minimum length to match. Lower bound and higher bound mask lengths together can define a range of networks.

le <0-32>

Specifies the maximum length to match. Lower bound and higher bound mask lengths together can define a range of networks.