BGP

【図解/BGP】Confederationの仕組みと設定 ~サブAS,ルートリフレクタとの比較~

BGP Confederation (コンフェデレーション) とは

BGP のコンフェデレーションは、RFC5065 で規定された、フルメッシュ要件を緩和するための仕組みです。

フルメッシュ要件とは、iBGP ネイバーから受け取ったルートを他の iBGP ネイバーに渡せないことに起因する、同一 AS 内の全 BGP ルータをネイバー確立する要件です。詳細については以下を参照下さい。

【図解】iBGPとeBGPの違い,スプリットホライズンとフルメッシュ,NEXT_HOP属性とnexthop-selfの関係
iBGPピアとeBGPピアの違い BGP ピアとは、2 台の BGP ルータ同士...

フルメッシュ要件の緩和策については、ルートリフレクタも効果的ですが、AS の合併や、OSPF 負荷軽減のための AS 分割には特に効果的です。

例えば以下の 3 つの AS (AS=123,AS= 456,AS= 789) を合併することを考えます。

もともと各 AS で 3つの iBGP ネイバーを確立していましたが、これら 9 つのルータを全て iBGP にする場合、9C2 = 36 の iBGP ネイバー確立が必要になります。

このようなケースではもともとの各 AS を『サブ AS』とし、これらを統合する AS=1000 を作り、コンフェデレーションを構成することができます。

既存の設定に追加して投入することで対応できますので、大幅な構成変更は不要です。

[RT1 ~ RT3]

RTX(config)# router bgp 123
RTX(config-router)# bgp confederation identifier 1000
RTX(config-router)# bgp confederation peers 456 789

[RT4 ~ RT6]

RTX(config)# router bgp 456
RTX(config-router)# bgp confederation identifier 1000
RTX(config-router)# bgp confederation peers 123 789

[RT7 ~ RT9]

RTX(config)# router bgp 789
RTX(config-router)# bgp confederation identifier 1000
RTX(config-router)# bgp confederation peers 123 456

ただし、コンフェデレーションの外部から見たときは AS 番号が変わるため、RT10 では設定変更が必要になりますので注意が必要です。

[RT10]

RT10(config)# router bgp 10
RT10(config-router)# no neighbor 10.1.110.1 remote-as 123
RT10(config-router)# neighbor 10.1.110.1 remote-as 1000

BGP Confederation の挙動 (広報するルートと属性の扱い)

BGP Confederation 間のピアは iBGP, eBGP と中間の挙動をします。

大枠としては、『どのルートを広報するか』については eBGP と同様、iBGP からのルートを広報しますが、各ルートの属性については iBGP と同じように属性値を変更しません。

細かい違いを iBGP と  eBGP と比較した表を以下に示します。

比較対象iBGPeBGPConfederation Peer
BGPテーブルの i 表記有り (iBGP)無し (eBGP)無し (eBGP)
AS_PATH属性変化なしAS_Sequenceとして
自分のAS番号を
先頭に付与
Confed_Sequence
として自分のAS
番号を先頭に付与
NEXT_HOP属性変化なし相手のIPアドレス
に変更して広報
変化なし
LOCAL_PREF属性広報可能広報不可広報可能
IPヘッダTTL25511
ルーティングAD値20020200

BGP confederation の構成例と設定例

BGP コンフェデレーションの構成例および設定例を示します。コンフェデレーションピア間でのルート交換では属性は保存されますのでデフォルトでは NEXT_HOP 属性も変化しません。そのため neighbor ~ next-hop-self を使うと良いです。(ルートリフレクタでは next-hop-self は使えないので、その点はコンフェデレーションのほうが扱い易い)

[R1 の config]

router bgp 123
 bgp confederation identifier 579
 network 1.1.1.0 mask 255.255.255.0
 neighbor 10.1.12.2 remote-as 123
 neighbor 10.1.13.3 remote-as 123
router ospf 1
 network 10.0.0.0 0.255.255.255 area 0

[R2 の config]

router bgp 123
 bgp confederation identifier 579
 bgp confederation peers 456
 network 2.2.2.0 mask 255.255.255.0
 neighbor 10.1.12.1 remote-as 123
 neighbor 10.1.23.3 remote-as 123
 neighbor 10.1.24.4 remote-as 456
 neighbor 10.1.24.4 next-hop-self
 neighbor 10.1.27.7 remote-as 70
router ospf 1
 passive-interface GigabitEthernet0/1
 network 10.0.0.0 0.255.255.255 area 0

[R3 の config]

router bgp 123
 bgp confederation identifier 579
 bgp confederation peers 456
 network 3.3.3.0 mask 255.255.255.0
 neighbor 10.1.13.1 remote-as 123
 neighbor 10.1.23.2 remote-as 123
 neighbor 10.1.35.5 remote-as 456
 neighbor 10.1.35.5 next-hop-self
router ospf 1
 passive-interface GigabitEthernet0/1
 network 10.0.0.0 0.255.255.255 area 0

[R4 の config]

router bgp 456
 bgp confederation identifier 579
 bgp confederation peers 123
 network 4.4.4.0 mask 255.255.255.0
 neighbor 10.1.24.2 remote-as 123
 neighbor 10.1.24.2 next-hop-self
 neighbor 10.1.45.5 remote-as 456
 neighbor 10.1.46.6 remote-as 456
router ospf 1
 passive-interface GigabitEthernet0/0
 network 10.0.0.0 0.255.255.255 area 0

[R5 の config]

router bgp 456
 bgp confederation identifier 579
 bgp confederation peers 123
 network 5.5.5.0 mask 255.255.255.0
 neighbor 10.1.35.3 remote-as 123
 neighbor 10.1.35.3 next-hop-self
 neighbor 10.1.45.4 remote-as 456
 neighbor 10.1.56.6 remote-as 456
router ospf 1
 passive-interface GigabitEthernet0/0
 network 10.0.0.0 0.255.255.255 area 0

[R6 の config]

router bgp 456
 bgp confederation identifier 579
 network 6.6.6.0 mask 255.255.255.0
 neighbor 10.1.46.4 remote-as 456
 neighbor 10.1.56.5 remote-as 456
router ospf 1
 network 10.0.0.0 0.255.255.255 area 0

[R7 の config]

router bgp 70
 network 7.7.7.0 mask 255.255.255.0
 neighbor 10.1.27.2 remote-as 579

結果、各ルータの BGP テーブル (show ip bgp) を示します。

[R1 の BGP テーブル]

     Network          Next Hop            Metric LocPrf Weight Path
 *>  1.1.1.0/24       0.0.0.0                  0         32768 i
 *>i 2.2.2.0/24       10.1.12.2                0    100      0 i
 *>i 3.3.3.0/24       10.1.13.3                0    100      0 i
 *>i 4.4.4.0/24       10.1.24.4                0    100      0 (456) i
 * i                  10.1.35.5                0    100      0 (456) i
 *>i 5.5.5.0/24       10.1.24.4                0    100      0 (456) i
 * i                  10.1.35.5                0    100      0 (456) i
 *>i 6.6.6.0/24       10.1.24.4                0    100      0 (456) i
 * i                  10.1.35.5                0    100      0 (456) i
 *>i 7.7.7.0/24       10.1.27.7                0    100      0 70 i

[R2 の BGP テーブル]

     Network          Next Hop            Metric LocPrf Weight Path
 *>i 1.1.1.0/24       10.1.12.1                0    100      0 i
 *>  2.2.2.0/24       0.0.0.0                  0         32768 i
 *>i 3.3.3.0/24       10.1.23.3                0    100      0 i
 * i 4.4.4.0/24       10.1.35.5                0    100      0 (456) i
 *>                   10.1.24.4                0    100      0 (456) i
 * i 5.5.5.0/24       10.1.35.5                0    100      0 (456) i
 *>                   10.1.24.4                0    100      0 (456) i
 * i 6.6.6.0/24       10.1.35.5                0    100      0 (456) i
 *>                   10.1.24.4                0    100      0 (456) i
 *>  7.7.7.0/24       10.1.27.7                0             0 70 i

[R3 の BGP テーブル]

     Network          Next Hop            Metric LocPrf Weight Path
 *>i 1.1.1.0/24       10.1.13.1                0    100      0 i
 *>i 2.2.2.0/24       10.1.23.2                0    100      0 i
 *>  3.3.3.0/24       0.0.0.0                  0         32768 i
 * i 4.4.4.0/24       10.1.24.4                0    100      0 (456) i
 *>                   10.1.35.5                0    100      0 (456) i
 * i 5.5.5.0/24       10.1.24.4                0    100      0 (456) i
 *>                   10.1.35.5                0    100      0 (456) i
 * i 6.6.6.0/24       10.1.24.4                0    100      0 (456) i
 *>                   10.1.35.5                0    100      0 (456) i
 *>i 7.7.7.0/24       10.1.27.7                0    100      0 70 i

[R4 の BGP テーブル]

     Network          Next Hop            Metric LocPrf Weight Path
 *>  1.1.1.0/24       10.1.24.2                0    100      0 (123) i
 * i                  10.1.35.3                0    100      0 (123) i
 * i 2.2.2.0/24       10.1.35.3                0    100      0 (123) i
 *>                   10.1.24.2                0    100      0 (123) i
 *>  3.3.3.0/24       10.1.24.2                0    100      0 (123) i
 * i                  10.1.35.3                0    100      0 (123) i
 *>  4.4.4.0/24       0.0.0.0                  0         32768 i
 *>i 5.5.5.0/24       10.1.45.5                0    100      0 i
 *>i 6.6.6.0/24       10.1.46.6                0    100      0 i
 * i 7.7.7.0/24       10.1.35.3                0    100      0 (123) 70 i
 *>                   10.1.24.2                0    100      0 (123) 70 i

[R5 の BGP テーブル]

     Network          Next Hop            Metric LocPrf Weight Path
 * i 1.1.1.0/24       10.1.24.2                0    100      0 (123) i
 *>                   10.1.35.3                0    100      0 (123) i
 *>  2.2.2.0/24       10.1.35.3                0    100      0 (123) i
 * i                  10.1.24.2                0    100      0 (123) i
 * i 3.3.3.0/24       10.1.24.2                0    100      0 (123) i
 *>                   10.1.35.3                0    100      0 (123) i
 *>i 4.4.4.0/24       10.1.45.4                0    100      0 i
 *>  5.5.5.0/24       0.0.0.0                  0         32768 i
 *>i 6.6.6.0/24       10.1.56.6                0    100      0 i
 *>  7.7.7.0/24       10.1.35.3                0    100      0 (123) 70 i
 * i                  10.1.24.2                0    100      0 (123) 70 i

[R6 の BGP テーブル]

     Network          Next Hop            Metric LocPrf Weight Path
 *>i 1.1.1.0/24       10.1.24.2                0    100      0 (123) i
 * i                  10.1.35.3                0    100      0 (123) i
 * i 2.2.2.0/24       10.1.35.3                0    100      0 (123) i
 *>i                  10.1.24.2                0    100      0 (123) i
 *>i 3.3.3.0/24       10.1.24.2                0    100      0 (123) i
 * i                  10.1.35.3                0    100      0 (123) i
 *>i 4.4.4.0/24       10.1.46.4                0    100      0 i
 *>i 5.5.5.0/24       10.1.56.5                0    100      0 i
 *>  6.6.6.0/24       0.0.0.0                  0         32768 i
 * i 7.7.7.0/24       10.1.35.3                0    100      0 (123) 70 i
 *>i                  10.1.24.2                0    100      0 (123) 70 i

[R7 の BGP テーブル]

     Network          Next Hop            Metric LocPrf Weight Path
 *>  1.1.1.0/24       10.1.27.2                              0 579 i
 *>  2.2.2.0/24       10.1.27.2                0             0 579 i
 *>  3.3.3.0/24       10.1.27.2                              0 579 i
 *>  4.4.4.0/24       10.1.27.2                              0 579 i
 *>  5.5.5.0/24       10.1.27.2                              0 579 i
 *>  6.6.6.0/24       10.1.27.2                              0 579 i
 *>  7.7.7.0/24       0.0.0.0                  0         32768 i

また、最後に参考として、以下のリンクから『RT2 と RT4 の間のパケットキャプチャ』がダウンロードできます。

https://milestone-of-se.nesuke.com/pcap/bgp-confed-nhself.pcapng

コメント

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