BGP bgp bestpath compare-routerid

この記事は約7分で読めます。

2つのBGPピアから同一の経路情報を受信した場合、eBGPもiBGPもパスアトリビュートの比較を行うことでベストパスを決定するが、8番目の「NEXT_HOPに到達するIGPメトリックが最小のパスを優先」においても決着がつかなかった場合の次の動作が異なる。eBGPでは先に学習した経路情報を優先し、iBGPではBGPルータIDを比較し、小さい方のルータIDから受信した経路情報を優先する。

詳細は以下CCOのNo.8~No.11参照

Select BGP Best Path Algorithm
This document describes the function of the Border Gateway Protocol (BGP) best path algorithm.

WEIGHT、LOCAL_PREF、MEDの重み付けを行っていない前提で、上図のR1のBGPテーブルを見てみる。R1からR5(5.5.5.5/32)、R6(6.6.6.6/32)、R7(7.7.7.7/32)への通信はR3経由が優先されていることが確認できる。

R1#show ip bgp
BGP table version is 8, local router ID is 1.1.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
              x best-external, a additional-path, c RIB-compressed,
              t secondary path,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

     Network          Next Hop            Metric LocPrf Weight Path
 *>   1.1.1.1/32       0.0.0.0                  0         32768 i
 *>   2.2.2.2/32       10.0.10.2                0             0 200 i
 *    3.3.3.3/32       10.0.10.2                              0 200 400 300 i
 *>                    10.0.20.2                0             0 300 i
 *    4.4.4.4/32       10.0.20.2                              0 300 400 i
 *>                    10.0.10.2                              0 200 400 i
 *    5.5.5.5/32       10.0.10.2                              0 200 400 i
 *>                    10.0.20.2                              0 300 400 i
 *    6.6.6.6/32       10.0.10.2                              0 200 400 i
 *>                    10.0.20.2                              0 300 400 i
 *    7.7.7.7/32       10.0.10.2                              0 200 400 i
 *>                    10.0.20.2                              0 300 400 i

R1からR5、R6、R7への通信経路をR2経由に変更するには、先に受信した経路情報よりもルータIDの比較を優先するようにR1を設定変更すれば良い。具体的にはR1のルータコンフィグレーションモードでbgp bestpath compare-routeridコマンドを実行する。

R1(config)#router bgp 100
R1(config-router)#bgp bestpath compare-routerid

R1内で完結する設定変更のため、設定変更後のソフトリセット(clear ip bgp * soft)、ハードリセット(clear ip bgp *)は不要となる。設定変更後のR1のBGPテーブルを見ると、R1からR5(5.5.5.5/32)、R6(6.6.6.6/32)、R7(7.7.7.7/32)への通信はR2経由が優先されるようになったことが確認できる。

##### 設定変更後のR1のBGPテーブル #####
R1#show ip bgp
BGP table version is 15, local router ID is 1.1.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
              x best-external, a additional-path, c RIB-compressed,
              t secondary path,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

     Network          Next Hop            Metric LocPrf Weight Path
 *>   1.1.1.1/32       0.0.0.0                  0         32768 i
 *>   2.2.2.2/32       10.0.10.2                0             0 200 i
 *    3.3.3.3/32       10.0.10.2                              0 200 400 300 i
 *>                    10.0.20.2                0             0 300 i
 *    4.4.4.4/32       10.0.20.2                              0 300 400 i
 *>                    10.0.10.2                              0 200 400 i
 *>   5.5.5.5/32       10.0.10.2                              0 200 400 i
 *                     10.0.20.2                              0 300 400 i
 *>   6.6.6.6/32       10.0.10.2                              0 200 400 i
 *                     10.0.20.2                              0 300 400 i
 *>   7.7.7.7/32       10.0.10.2                              0 200 400 i
 *                     10.0.20.2                              0 300 400 i

以上

コメント

タイトルとURLをコピーしました