LoginSignup
0
0

More than 1 year has passed since last update.

BGPのベストパス選択の実際

Posted at

bgp.png

R1はR2, R3, R5とneighborになっている。
R1でshow ip bgpを実行すると

R1#sho ip bgp
     Network          Next Hop            Metric LocPrf Weight Path
 *>  192.168.102.0    192.168.101.2            0         32768 64513 i ※1
 *                    192.168.101.18          80             0 64517 i ※2
 * i                  192.168.101.14          80     80      0 64516 i ※3

192.168.102.0/24 のprefixはBGPテーブルに3つあるが、
ベストパスは※1である。

この時、192.168.101.2のルータ(図でいうRT5)がダウンしたら、 ベストパスはどれになるか?

現在のベストパスはweightが設定されている。
weightはciscoルータがBGPのベストパスを選択するときに比較する最初の条件である。

この経路以外はWeightは設定されていない。

Weightの次に比較するのはlocal preference である。

残りの2経路のLocPrfを見ると、一つは空欄、もう一つは80である。

この時、どちらの経路が採用されるか?

そもそも、※2のlocPrfはなぜ空欄なのか?
それは、※2の経路はeBGPのネイバーから受信したprefixだからである。
逆に言うと、BGPテーブルを表示したときにLocPrfが空欄のprefixは、
eBGPから受信したものだとわかる。

eBGPから受信した経路にはlocPrfは「ない」のである。

では、ベストパスの2番目の比較が行われるときに、※2と※3の比較はどうなるのか?
locPrfがない経路より、80が設定されている※3の方が強いのか?

これは考えてもわからない。

こういう場合、LocPrfがないeBGPネイバーから受信したprefixはLocPrfがデフォルト値の100であるとして比較をおこなうことになっている。

だから、RT5がダウンしたらベストパスは ※2になる。

実際にやってみた。

R1#sho ip bgp

     Network          Next Hop            Metric LocPrf Weight Path
 *>  192.168.102.0    192.168.101.2            0         32768 64513 i
 *                    192.168.101.18          80             0 64517 i
 * i                  192.168.101.14          80     80      0 64516 i

※RT5を落とす

*Mar 29 04:29:31.095: %BGP-3-NOTIFICATION: sent to neighbor 192.168.101.2 4/0 (hold time expired) 0 bytes
*Mar 29 04:29:31.095: %BGP-5-NBR_RESET: Neighbor 192.168.101.2 reset (BGP Notification sent)
*Mar 29 04:29:31.095: %BGP-5-ADJCHANGE: neighbor 192.168.101.2 Down BGP Notification sent
*Mar 29 04:29:31.095: %BGP_SESSION-5-ADJCHANGE: neighbor 192.168.101.2 IPv4 Unicast topology base removed from session  BGP Notification sent

R1#sh ip bgp summary

Neighbor        V           AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
192.168.101.2   4        64513       0       0        1    0    0 00:00:07 Idle
192.168.101.14  4        64512      10      11        3    0    0 00:05:09        1
192.168.101.18  4        64517      10      11        3    0    0 00:05:09        1

※新しいベストパスが選択される

R1#sh ip bgp
     Network          Next Hop            Metric LocPrf Weight Path
 *>  192.168.102.0    192.168.101.18          80             0 64517 i
 * i                  192.168.101.14          80     80      0 64516 i
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