This article will provide a technical analysis of the ECMP misconfiguration.
We're analyzing a network scenario where show route indicates two equal-cost paths (ae0 and ae1). Despite configuring per-packet load balancing via policy-options, the show route forwarding-table output reveals that traffic is utilizing only one of the interfaces.
show route
show route forwarding-table
We have verified in our lab. We can see the routes in routing table for 12.12.12.12.
root@juser# run show route 12.12.12.12
inet.0: 14 destinations, 15 routes (14 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
12.12.12.0/24 *[BGP/170] 00:33:18, localpref 100, from 2.2.2.2
AS path: I, validation-state: unverified
to 200.0.0.2 via ae0.0
> to 100.0.0.2 via ae1.0
[BGP/170] 00:21:40, localpref 100, from 4.4.4.4
root@juser# show route forwarding-table destination 12.12.12.12
Routing table: default.inet
Internet:
Destination Type RtRef Next hop Type Index NhRef Netif
12.12.12.0/24 user 0 indr 2097151 2
ulst 2097150 6
200.0.0.2 ucst 1717 3 ae0.0
100.0.0.2 ucst 1714 3 ae1.0
root@juser# run show route 12.12.12.12 extensive
12.12.12.0/24 (2 entries, 1 announced)
TSI:
KRT in-kernel 12.12.12.0/24 -> {indirect(2097151)}
*BGP Preference: 170/-101
Next hop type: Indirect, Next hop index: 0
Address: 0xc685c94
Next-hop reference count: 2
Source: 2.2.2.2
Next hop type: Router, Next hop index: 0
Next hop: 200.0.0.2 via ae0.0
Session Id: 0x0
Next hop: 100.0.0.2 via ae1.0, selected
Protocol next hop: 2.2.2.2
Indirect next hop: 0xc814904 2097151 INH Session ID: 0x142
State: <Active Int Ext>
Local AS: 65512 Peer AS: 65512
Age: 35:15 Metric2: 1
Validation State: unverified
Task: BGP_65512.2.2.2.2
Announcement bits (2): 0-KRT 5-Resolve tree 1
AS path: I
Accepted
Localpref: 100
Router ID: 2.2.2.2
Thread: junos-main
Indirect next hops:
Protocol next hop: 2.2.2.2 Metric: 1
Indirect path forwarding next hops: 2
Next hop type: Router
Next hop: 100.0.0.2 via ae1.0
2.2.2.2/32 Originating RIB: inet.0
Metric: 1 Node path count: 1
Forwarding nexthops: 2
BGP Preference: 170/-101
Address: 0xc685eec
Next-hop reference count: 1
Source: 4.4.4.4
Protocol next hop: 4.4.4.4
Indirect next hop: 0xc813d04 - INH Session ID: 0x0
State: <NotBest Int Ext Changed
Inactive reason: Not Best in its group - IGP metric
Age: 23:37 Metric2: 2
Task: BGP_65512.4.4.4.4
Indirect next hops: 1
Protocol next hop: 4.4.4.4 Metric: 2
4.4.4.0/24 Originating RIB: inet.0
Metric: 2 Node path count: 1
lroot@juser# ...area 0.0.0.0 interface lo0.0 metric 1.
{master:0}[edit]
root@juser# show | compare
[edit protocols ospf area 0.0.0.0 interface lo0.0]
+ metric 1;
labroot@jtac-qfx10002-36q-r2012# commit
[edit protocols]
'bgp'
warning: requires 'bgp' license
configuration check succeeds
commit complete
12.12.12.0/24 *[BGP/170] 00:00:30, localpref 100, from 2.2.2.2
[BGP/170] 00:28:03, localpref 100, from 4.4.4.4
root@juser# .show route forwarding-table destination 12.12.12.12
12.12.12.0/24 user 0 ulst 2097153 2
indr 2097151 2
ulst 2097150 7
100.0.0.2 ucst 1714 3 ae1.0 -
indr 2097152 2
200.0.0.2 ucst 1717 3 ae0.0 -
Routing table: __master.anon__.inet
default perm 0 rjct 1671 1
Routing table: __pfe_private__.inet
default perm 0 dscd 1697 2
Please follow the below guide for BGP path selection.
https://www.juniper.net/documentation/us/en/software/junos/vpn-l2/bgp/topics/concept/routing-protocols-address-representation.html