OcNOS-SP : Layer 3 Guide : Layer 3 Unicast Configuration Guide : OSPFv2 : Loop-Free Alternate (LFA) ECMP PATH
Loop-Free Alternate (LFA) ECMP PATH
This section contains configurations for OSPF LFA ECMP which provides LFA/alternate path from primary ECMP path set or non-primary/non-ECMP path set which improve convergence after a primary path failure occur in network.
Overview
With ECMP, a prefix has multiple primary paths to forward traffic. When a particular primary path fails, the other primary paths are not guaranteed to provide protection against the failure scenario. As part of LFA ECMP, alternate paths are determined for each primary path separately. The selected alternate path can be either one of the primary path from the set of ECMP or a loop-free non-ECMP if available.
In OSPF, by default the LFA algorithm tries to find loop free node protecting alternate from the set of existing primary next-hops. If no loop free node-protecting alternate is available, the LFA algorithm tries to find link-protecting alternate from the set of existing primary next-hops. If no loop-free node-protecting and link-protecting alternate is available, then the LFA algorithm should select a loop-free link-protecting from the non-ECMP next-hops.
Topology
Figure 8-78: OSPF-LFA_ECMP
Configuring OSPF LFA ECMP
Configuration Part 1: with default LFA configuration where primary path priority higher than Secondary-path (non-ECMP) and LFA selection happen within primary ECMP path
RTR1
 
#configure terminal
Enter configure mode.
(config)#interface eth1
Enter interface mode.
(config-if)#ip address 10.1.1.1/24
Configure the IP address of the interface.
(config-if)#ip ospf cost 4
Assign cost to interface
(config-if)#exit
Exit interface mode.
(config)#interface eth2
Enter interface mode.
(config-if)#ip address 20.1.1.1/24
Assign IP address.
(config-if)#ip ospf cost 5
Assign cost to interface
(config-if)#exit
Exit interface mode.
(config)#interface eth3
Enter interface mode.
(config-if)#ip address 30.1.1.1/24
Assign IP address.
(config-if)#ip ospf cost 10
Assign cost to interface
(config-if)#exit
Exit interface mode.
(config)#router ospf 1
Configure the routing process and specify the Process ID (1).
(config-router)#ospf router-id 1.1.1.1
Configure router-id as 1.1.1.1
(config-router)#bfd all-interfaces
Enable BFD over ospf for all ospf enabled interfaces
(config-router)#network 10.1.1.0/24 area 0
Configure OSPF network for area 0.
(config-router)#network 20.1.1.0/24 area 0
Configure OSPF network for area 0.
(config-router)#network 30.1.1.0/24 area 0
Configure OSPF network for area 0.
(config-router)#fast-reroute keep-all-paths
Configure LFA-FRR to calculate the available backup path.
(config-router)#commit
Commit the candidate configuration to the running configuration.
(config-router)#end
Exit router mode.
RTR2
 
#configure terminal
Enter configure mode.
(config)#interface eth1
Enter interface mode.
(config-if)#ip address 10.1.1.2/24
Configure the IP address of the interface.
(config-if)#ip ospf cost 4
Assign cost to interface
(config-if)#exit
Exit interface mode.
(config)#interface eth2
Enter interface mode.
(config-if)#ip address 40.1.1.1/24
Assign IP address.
(config-if)#ip ospf cost 3
Assign cost to interface
(config-if)#exit
Exit interface mode.
(config)#interface eth3
Enter interface mode.
(config-if)#ip address 80.1.1.1/24
Assign IP address.
(config-if)#ip ospf cost 1
Assign cost to interface
(config-if)#exit
Exit interface mode.
(config)#router ospf 1
Configure the routing process and specify the Process ID (1).
(config-router)#ospf router-id 2.2.2.2
Configure router-id.
(config-router)#bfd all-interfaces
Enable BFD over ospf for all ospf enabled interfaces
(config-router)#network 10.1.1.0/24 area 0
Configure OSPF network for area 0.
(config-router)#network 40.1.1.0/24 area 0
Configure OSPF network for area 0.
(config-router)#network 80.1.1.0/24 area 0
Configure OSPF network for area 0.
(config-router)#commit
Commit the candidate configuration to the running configuration.
(config-router)#end
Exit router mode.
RTR3
 
#configure terminal
Enter configure mode.
(config)#interface eth1
Enter interface mode.
(config-if)#ip address 20.1.1.2/24
Configure the IP address of the interface.
(config-if)#ip ospf cost 5
Assign cost to interface
(config-if)#exit
Exit interface mode.
(config)#interface eth2
Enter interface mode.
(config-if)#ip address 50.1.1.1/24
Assign IP address.
(config-if)#ip ospf cost 2
Assign cost to interface
(config-if)#exit
Exit interface mode.
(config)#interface eth3
Enter interface mode.
(config-if)#ip address 80.1.1.2/24
Assign IP address.
(config-if)#ip ospf cost 1
Assign cost to interface
(config-if)#exit
Exit interface mode.
(config)#router ospf 1
Configure the routing process and specify the Process ID (1).
(config-router)#ospf router-id 3.3.3.3
Configure router-id.
(config-router)#bfd all-interfaces
Enable BFD over ospf for all ospf enabled interfaces
(config-router)#network 20.1.1.0/24 area 0
Configure OSPF network for area 0.
(config-router)#network 50.1.1.0/24 area 0
Configure OSPF network for area 0.
(config-router)#network 80.1.1.0/24 area 0
Configure OSPF network for area 0.
(config-router)#commit
Commit the candidate configuration to the running configuration.
(config-router)#end
Exit router mode.
RTR4
 
#configure terminal
Enter configure mode.
(config)#interface eth1
Enter interface mode.
(config-if)#ip address 30.1.1.2/24
Configure the IP address of the interface.
(config-if)#ip ospf cost 10
Assign cost to interface
(config-if)#exit
Exit interface mode.
(config)#interface eth2
Enter interface mode.
(config-if)#ip address 60.1.1.1/24
Assign IP address.
(config-if)#ip ospf cost 2
Assign cost to interface
(config-if)#exit
Exit interface mode.
(config)#router ospf 1
Configure the routing process and specify the Process ID (1).
(config-router)#ospf router-id 4.4.4.4
Configure router-id.
(config-router)#bfd all-interfaces
Enable BFD over ospf for all ospf enabled interfaces
(config-router)#network 30.1.1.0/24 area 0
Configure OSPF network for area 0.
(config-router)#network 60.1.1.0/24 area 0
Configure OSPF network for area 0.
(config-router)#commit
Commit the candidate configuration to the running configuration.
(config-router)#end
Exit router mode.
RTR5
 
#configure terminal
Enter configure mode.
(config)#interface lo
Enter interface mode.
(config-if)#ip address 33.33.33.1/32 secondary
Configure the IP address of the interface loopback.
(config-if)#exit
Exit interface mode.
(config)#interface eth1
Enter interface mode.
(config-if)#ip address 40.1.1.2/24
Configure the IP address of the interface.
(config-if)#ip ospf cost 3
Assign cost to interface
(config-if)#exit
Exit interface mode.
(config)#interface eth2
Enter interface mode.
(config-if)#ip address 50.1.1.2/24
Assign IP address.
(config-if)#ip ospf cost 2
Assign cost to interface
(config-if)#exit
Exit interface mode.
(config)#interface eth3
Enter interface mode.
(config-if)#ip address 60.1.1.2/24
Assign IP address.
(config-if)#ip ospf cost 2
Assign cost to interface
(config-if)#exit
Exit interface mode.
(config)#router ospf 1
Configure the routing process and specify the Process ID (1).
(config-router)#ospf router-id 5.5.5.5
Configure router-id.
(config-router)#bfd all-interfaces
Enable BFD over ospf for all ospf enabled interfaces
(config-router)#network 40.1.1.0/24 area 0
Configure OSPF network for area 0.
(config-router)#network 50.1.1.0/24 area 0
Configure OSPF network for area 0.
(config-router)#network 60.1.1.0/24 area 0
Configure OSPF network for area 0.
(config-router)#network 33.33.33.1/32 area 0
Configure OSPF network for area 0.
(config-router)#commit
Commit the candidate configuration to the running configuration.
(config-router)#end
Exit router mode.
Validation
Validation Part 1: LFA selected from primary ECMP path set
RTR1
#show ip ospf route fast-reroute
 
OSPF process 1:
Codes: C - connected, D - Discard, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
OSPF LFA attributes:
P - Primary, SP - Secondary-Path, ID - Interface Disjoint,
NP - Node Protecting, BID - Broadcast Interface Disjoint
 
O 33.33.33.1/32 [17] via 10.1.1.2, eth1, Area 0.0.0.0
Backup path:
via 20.1.1.2, eth2, Area 0.0.0.0
Attributes: Metric: [17] ,P ,NP
via 20.1.1.2, eth2, Area 0.0.0.0
Backup path:
via 10.1.1.2, eth1, Area 0.0.0.0
Attributes: Metric: [17] ,P ,ID
O 40.1.1.0/24 [7] via 10.1.1.2, eth1, Area 0.0.0.0
Backup path:
via 30.1.1.2, eth3, Area 0.0.0.0
Attributes: Metric: [15] ,SP ,NP
O 50.1.1.0/24 [7] via 20.1.1.2, eth2, Area 0.0.0.0
Backup path:
via 10.1.1.2, eth1, Area 0.0.0.0
Attributes: Metric: [7] ,P ,ID
via 10.1.1.2, eth1, Area 0.0.0.0
Backup path:
via 20.1.1.2, eth2, Area 0.0.0.0
Attributes: Metric: [7] ,P ,NP
O 60.1.1.0/24 [9] via 10.1.1.2, eth1, Area 0.0.0.0
Backup path:
via 20.1.1.2, eth2, Area 0.0.0.0
Attributes: Metric: [9] ,P ,NP
via 20.1.1.2, eth2, Area 0.0.0.0
Backup path:
via 10.1.1.2, eth1, Area 0.0.0.0
Attributes: Metric: [9] ,P ,ID
O 80.1.1.0/24 [5] via 10.1.1.2, eth1, Area 0.0.0.0
Backup path:
via 20.1.1.2, eth2, Area 0.0.0.0
Attributes: Metric: [6] ,SP ,NP
 
#show ip route fast-reroute
Codes: K - kernel, C - connected, S - static, R - RIP, B - BGP
O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2,
ia - IS-IS inter area, T - FRR nhp,p - stale info
* - candidate default
 
IP Route Table for VRF "default"
O 33.33.33.1/32 [110/17] via 20.1.1.2, eth2, 00:00:44
[FRR-NH] via 10.1.1.2, eth1
 
[110/17] via 10.1.1.2, eth1
[FRR-NH] via 20.1.1.2, eth2
 
O 40.1.1.0/24 [110/7] via 10.1.1.2, eth1, 00:01:46
[FRR-NH] via 30.1.1.2, eth3
 
O 50.1.1.0/24 [110/7] via 10.1.1.2, eth1, 00:01:34
[FRR-NH] via 20.1.1.2, eth2
 
[110/7] via 20.1.1.2, eth2
[FRR-NH] via 10.1.1.2, eth1
 
O 60.1.1.0/24 [110/9] via 20.1.1.2, eth2, 00:01:34
[FRR-NH] via 10.1.1.2, eth1
 
[110/9] via 10.1.1.2, eth1
[FRR-NH] via 20.1.1.2, eth2
 
O 80.1.1.0/24 [110/5] via 10.1.1.2, eth1, 00:01:46
[FRR-NH] via 20.1.1.2, eth2
 
 
#show ip ospf route 33.33.33.1
 
OSPF process 1:
Codes: C - connected, D - Discard, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
OSPF LFA attributes:
P - Primary, SP - Secondary-Path, ID - Interface Disjoint,
NP - Node Protecting, BID - Broadcast Interface Disjoint
 
O 33.33.33.1/32 [17] via 10.1.1.2, eth1, Area 0.0.0.0
via 20.1.1.2, eth2, Area 0.0.0.0
 
#show ip route 33.33.33.1
Routing entry for 33.33.33.1/32
Known via "ospf", distance 110, metric 17, External Route Tag: 0, best
Last update 00:00:40 ago
* 20.1.1.2, via eth2
* 10.1.1.2, via eth1
 
Configuration Part 2: with non-ECMP tiebreaker configured where secondary-path priority higher than primary (ECMP) path
Configure below configuration with config’s shown in Part1:
RTR1
 
#configure terminal
Enter configure mode.
(config)#router ospf 1
Enter Router OSPF mode.
(config-router)#fast-reroute tie-break secondary-path index 5
Configure LFA tiebreaker for LFA to be calculate from non-ecmp path set if available (this is user defined to decide the priority to select between ecmp/non-ecmp set)
(config-router)#commit
Commit the candidate configuration to the running configuration.
(config-router)#exit
Exit Router OSPF mode and return to Configure mode.
Validation Part 2: LFA selected from non-ecmp path for each primary ecmp path
RTR1
#show ip ospf route fast-reroute
 
OSPF process 1:
Codes: C - connected, D - Discard, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
OSPF LFA attributes:
P - Primary, SP - Secondary-Path, ID - Interface Disjoint,
NP - Node Protecting, BID - Broadcast Interface Disjoint
 
O 33.33.33.1/32 [17] via 10.1.1.2, eth1, Area 0.0.0.0
Backup path:
via 30.1.1.2, eth3, Area 0.0.0.0
Attributes: Metric: [22] ,SP ,NP
via 20.1.1.2, eth2, Area 0.0.0.0
Backup path:
via 30.1.1.2, eth3, Area 0.0.0.0
Attributes: Metric: [22] ,SP ,NP
O 40.1.1.0/24 [7] via 10.1.1.2, eth1, Area 0.0.0.0
Backup path:
via 30.1.1.2, eth3, Area 0.0.0.0
Attributes: Metric: [15] ,SP ,NP
O 50.1.1.0/24 [7] via 20.1.1.2, eth2, Area 0.0.0.0
Backup path:
via 30.1.1.2, eth3, Area 0.0.0.0
Attributes: Metric: [14] ,SP ,NP
via 10.1.1.2, eth1, Area 0.0.0.0
Backup path:
via 30.1.1.2, eth3, Area 0.0.0.0
Attributes: Metric: [14] ,SP ,NP
O 60.1.1.0/24 [9] via 10.1.1.2, eth1, Area 0.0.0.0
Backup path:
via 30.1.1.2, eth3, Area 0.0.0.0
Attributes: Metric: [12] ,SP ,NP
via 20.1.1.2, eth2, Area 0.0.0.0
Backup path:
via 30.1.1.2, eth3, Area 0.0.0.0
Attributes: Metric: [12] ,SP ,NP
O 80.1.1.0/24 [5] via 10.1.1.2, eth1, Area 0.0.0.0
Backup path:
via 20.1.1.2, eth2, Area 0.0.0.0
Attributes: Metric: [6] ,SP ,NP
 
#show ip route fast-reroute
Codes: K - kernel, C - connected, S - static, R - RIP, B - BGP
O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2,
ia - IS-IS inter area , T - FRR nhp,p - stale info
* - candidate default
 
IP Route Table for VRF "default"
O 33.33.33.1/32 [110/17] via 20.1.1.2, eth2, 00:00:36
[FRR-NH] via 30.1.1.2, eth3
 
[110/17] via 10.1.1.2, eth1
[FRR-NH] via 30.1.1.2, eth3
 
O 40.1.1.0/24 [110/7] via 10.1.1.2, eth1, 00:01:38
[FRR-NH] via 30.1.1.2, eth3
 
O 50.1.1.0/24 [110/7] via 10.1.1.2, eth1, 00:01:26
[FRR-NH] via 30.1.1.2, eth3
 
[110/7] via 20.1.1.2, eth2
[FRR-NH] via 30.1.1.2, eth3
 
O 60.1.1.0/24 [110/9] via 20.1.1.2, eth2, 00:01:26
[FRR-NH] via 30.1.1.2, eth3
 
[110/9] via 10.1.1.2, eth1
[FRR-NH] via 30.1.1.2, eth3
 
O 80.1.1.0/24 [110/5] via 10.1.1.2, eth1, 00:01:38
[FRR-NH] via 20.1.1.2, eth2
Last modified date: 10/16/2023