0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

IGPのネットワークをBGPテーブルからけすとECMPが発動しない謎

0
Posted at

自分の知識不足ですね、はい。

#spine/leaf
ip prefix-list LOOPBACK-ONLY permit 172.16.0.0/24 ge 32
route-map OSPF-TO-BGP permit 10
 match ip address prefix-list LOOPBACK-ONLY
!
router bgp 65000
 address-family ipv4 unicast
 # 再配送時にルートマップを適用
  redistribute ospf route-map OSPF-TO-BGP

特定範囲のループバックアドレスのみをBGPに注入する

ibgp-spine2# show ip bgp
BGP table version is 10, local router ID is 172.16.0.2, vrf id 0
Default local pref 100, local AS 65000
Status codes:  s suppressed, d damped, h history, * valid, > best, = multipath,
               i internal, r RIB-failure, S Stale, R Removed
Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self
Origin codes:  i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

   Network          Next Hop            Metric LocPrf Weight Path
*> 172.16.0.1/32    10.0.0.6                20         32768 ?
* i                 20.0.0.1                10    100      0 ?
* i                 10.0.0.1                10    100      0 ?
*> 172.16.0.3/32    20.0.0.6                10         32768 ?
*> 172.16.0.4/32    10.0.0.6                10         32768 ?
* i                 10.0.0.1                20    100      0 ?

アンダーレイを除外した後の影響
iBGPによるECMPが効かなくなる可能性がある
LocPrf を揃える

全Spineで同じLocal Preferenceを付与して揃える

route-map OSPF-TO-BGP permit 10
 match ip address prefix-list LOOPBACK-ONLY
 !自分自身が再配送するものも他から再配送されたものも、同じ値に揃える
 set local-preference 100
 !redistribute(再配送)した経路にはルーターが32768 を付与するデフォルト仕様があるため
 !ECMPのためにはWeight を揃える必要がある
 set weight 0

なぜECMPにならないのか確認する

ibgp-spine2# show ip bgp 172.16.0.1/32
BGP routing table entry for 172.16.0.1/32, version 17
Paths: (3 available, best #3, table default)
  Advertised to non peer-group peers:
  172.16.0.3 172.16.0.4
  Local, (Received from a RR-client)
    20.0.0.1 (metric 20) from 172.16.0.4 (172.16.0.4)
      Origin incomplete, metric 10, localpref 100, valid, internal
      Last update: Sun Jun 14 01:31:08 2026
  Local, (Received from a RR-client)
    10.0.0.1 (metric 20) from 172.16.0.3 (172.16.0.3)
      Origin incomplete, metric 10, localpref 100, valid, internal
      Last update: Sun Jun 14 01:31:08 2026
  Local
    10.0.0.6 from 0.0.0.0 (172.16.0.2)
      Origin incomplete, metric 20, localpref 100, valid, sourced, best (Local Route)
      Last update: Sun Jun 14 01:30:54 2026
router bgp 65000
 address-family ipv4 unicast
  maximum-paths 4
  bgp bestpath as-path multipath-relax
ibgp-spine2# show ip bgp
BGP table version is 19, local router ID is 172.16.0.2, vrf id 0
Default local pref 100, local AS 65000
Status codes:  s suppressed, d damped, h history, * valid, > best, = multipath,
               i internal, r RIB-failure, S Stale, R Removed
Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self
Origin codes:  i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

   Network          Next Hop            Metric LocPrf Weight Path
* i172.16.0.1/32    20.0.0.1                10    100      0 ?
* i                 10.0.0.1                10    100      0 ?
*>                  10.0.0.6                20    100      0 ?
*> 172.16.0.3/32    20.0.0.6                10    100      0 ?
* i172.16.0.4/32    10.0.0.1                20    100      0 ?
*>                  10.0.0.6                10    100      0 ?

Displayed  3 routes and 6 total paths

しないほうが賢明かなあ。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?