【BGP入門】広報経路の集約(Aggregate)について

  • URLをコピーしました!
目次

はじめに

こんにちは。ネットワークエンジニアの「だいまる」です。

今回は、BGPで送受信している経路を集約する方法をまとめていきたいと思います。

経路集約とは?

概要

経路集約とは「BGPやOSPF、IS-ISなどのルーティングプロトコルでやり取りされている経路をまとめる機能」です。

経路数を少なくすることができるのがメリットです!

インターネット上には100万経路に近い経路が広報されており、内部ネットワークも場所によっては膨大な数の経路が広報されています。

この経路を集約しない場合ハイスペックなルータが必要となるため、費用が莫大になります。

また、インターネットを流れる経路は一般的に「/24より短いPrefix」で広報する暗黙ルールが存在します。

この暗黙ルールを守るため、集約が必要になります!

ルータの負荷軽減やインターネットのルールを守るため、経路集約を行う必要があるのです。

(イメージ図)

世界一流エンジニアの思考法
〜Microsoftエンジニアが語る一流エンジニアとは?〜

設定方法(Cisco IOS)

経路集約の設定方法は、以下のコマンドで実行できます。

経路集約の設定方法(Cisco IOS)
(config-router)#aggregate-address <IPアドレス> <サブネットマスク> (オプション)

この設定方法に記載したオプションは以下の表にまとめます。

オプション項目詳細
advertise-map集約経路に継承させる集約前ルートの属性(Attribute)をroute-mapで指定
as-set・デフォルト:集約経路を生成するルータが属するAS番号のみ付加
・オプション:集約前経路のAS番号も付加したい場合に利用
attribute-map集約経路にroute-mapで指定した属性(Attirbute)を付与
※advertise-mapとの違いは、新規に属性付加する点
route-map集約経路にroute-map指定(Attribute等の付与)
summary-only集約経路のみ広報する場合に利用
※デフォルト:集約経路と個別経路を両方広報する
suppress-map特定の集約経路の広報をroute-mapを利用することで抑制可能
ネットワークスペシャリスト2026年版
〜合格のための知識・解き方を詳しく解説した「ネットワークスペシャリスト試験」の決定版学習書!〜

動作確認

今回は、項目① 「経路集約」と項目②「summary-only」の2種類を確認していきます。

検証構成

検証構成は、BGPの他記事と同じ構成で確認していきます。

AS100
AS100
AS200
AS200
ルータ1
ルータ1
ルータ2
ルータ2
ルータ3
ルータ3
ルータ4
ルータ4
ルータ5
ルータ5
ルータ6
ルータ6
ルータ7
ルータ7
192.168.1.0/30
192.168…
192.168.2.0/30
192.168…
10.1.0.0/30
10.1.0….
10.2.0.0/30
10.2.0….
10.2.1.0/30
10.2.1….
10.2.2.0/30
10.2.2….
10.1.1.0/30
10.1.1….
10.1.2.0/30
10.1.2….
10.1.3.0/30
10.1.3….
Lo0:10.10.X.1/32
Lo0:10….
Lo0:10.20.X.1/32
Lo0:10….
AS300
AS300
ルータ8
ルータ8
192.168.3.0/30
192.168…
192.168.4.0/30
192.168…
AS400
AS400
192.168.5.0/30
192.168…
192.168.6.0/30
192.168…
Lo0:10.30.X.1/32
Lo0:10.30.X.1/32
Lo0:10.40.X.1/32
Lo0:10….
ルータ9
ルータ9
Text is not SVG – cannot display

ルータ1とルータ2でAS200からもらった経路に対し設定していきます!

確認項目①:経路集約

まずはルータ4で事前確認を実施していきます。

Router4#show ip bgp
BGP table version is 12, local router ID is 10.10.4.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
 r>i  10.10.1.1/32     10.10.1.1                0    100      0 i
 r>i  10.10.2.1/32     10.10.2.1                0    100      0 i
 r>i  10.10.3.1/32     10.10.3.1                0    100      0 i
 *>   10.10.4.1/32     0.0.0.0                  0         32768 i
 * i  10.20.5.1/32     10.10.2.1                0    100      0 200 i
 *>i                   10.10.1.1                0    100      0 200 i
 *>i  10.20.6.1/32     10.10.1.1                0    100      0 200 i
 * i                   10.10.2.1                0    100      0 200 i
 * i  10.20.7.1/32     10.10.2.1                0    100      0 200 i
 *>i                   10.10.1.1                0    100      0 200 i
 *>i  10.30.8.1/32     10.10.2.1                0    100      0 300 i
 *>i  10.40.9.1/32     10.10.1.1                0    100      0 400 i
 *>i  10.40.19.1/32    10.10.1.1                0    100      0 400 i

この状態から「10.20.X.1/32」を「10.20.0.0/16」に集約していきます。

経路集約の設定(Router1)
Router1#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router1(config)#router bgp 100
Router1(config-router)#aggregate-address 10.20.0.0 255.255.0.0
Router1(config-router)#end

Router2にもこの設定を追加しています!

設定後の状態を確認していきましょう。

以下のログを見ると「10.20.0.0/16」に集約されていることがわかると思います。

事後確認(Router4)
Router4#show ip bgp
BGP table version is 13, local router ID is 10.10.4.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
 r>i  10.10.1.1/32     10.10.1.1                0    100      0 i
 r>i  10.10.2.1/32     10.10.2.1                0    100      0 i
 r>i  10.10.3.1/32     10.10.3.1                0    100      0 i
 *>   10.10.4.1/32     0.0.0.0                  0         32768 i
 * i  10.20.0.0/16     10.10.2.1                0    100      0 i
 *>i                   10.10.1.1                0    100      0 i
 * i  10.20.5.1/32     10.10.2.1                0    100      0 200 i
 *>i                   10.10.1.1                0    100      0 200 i
 *>i  10.20.6.1/32     10.10.1.1                0    100      0 200 i
 * i                   10.10.2.1                0    100      0 200 i
 * i  10.20.7.1/32     10.10.2.1                0    100      0 200 i
 *>i                   10.10.1.1                0    100      0 200 i
 *>i  10.30.8.1/32     10.10.2.1                0    100      0 300 i
 *>i  10.40.9.1/32     10.10.1.1                0    100      0 400 i
 *>i  10.40.19.1/32    10.10.1.1                0    100      0 400 i
インターネットルーティング入門 第3版
〜図解でわかる経路制御の仕組み!〜

確認項目②:summary-only

次にデフォルトでは、集約した経路と個別経路両方を広報する仕様になっていますが、これを集約経路だけ広報する「summary-onlly」オプションの動作確認を行います。

事前確認(Router4)
Router4#show ip bgp
BGP table version is 13, local router ID is 10.10.4.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
 r>i  10.10.1.1/32     10.10.1.1                0    100      0 i
 r>i  10.10.2.1/32     10.10.2.1                0    100      0 i
 r>i  10.10.3.1/32     10.10.3.1                0    100      0 i
 *>   10.10.4.1/32     0.0.0.0                  0         32768 i
 * i  10.20.0.0/16     10.10.2.1                0    100      0 i
 *>i                   10.10.1.1                0    100      0 i
 * i  10.20.5.1/32     10.10.2.1                0    100      0 200 i
 *>i                   10.10.1.1                0    100      0 200 i
 *>i  10.20.6.1/32     10.10.1.1                0    100      0 200 i
 * i                   10.10.2.1                0    100      0 200 i
 * i  10.20.7.1/32     10.10.2.1                0    100      0 200 i
 *>i                   10.10.1.1                0    100      0 200 i
 *>i  10.30.8.1/32     10.10.2.1                0    100      0 300 i
 *>i  10.40.9.1/32     10.10.1.1                0    100      0 400 i
 *>i  10.40.19.1/32    10.10.1.1                0    100      0 400 i

この状態に以下のコマンドをRouter1とRouter2に設定していきます。

(config-router)#aggregate-address 10.20.0.0/16 summary-only

では実際に投入したログを見てみましょう。

summary-onlyの設定投入
Router1#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router1(config)#router bgp 100
Router1(config-router)#aggregate-address 10.20.0.0 255.255.0.0 summary-only
Router1(config-router)#end

同様にRouter2にもこの設定を追加しています!

最後にRouter4の状態を見てみましょう。

事後確認(Router4)
Router4#show ip bgp
BGP table version is 19, local router ID is 10.10.4.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
 r>i  10.10.1.1/32     10.10.1.1                0    100      0 i
 r>i  10.10.2.1/32     10.10.2.1                0    100      0 i
 r>i  10.10.3.1/32     10.10.3.1                0    100      0 i
 *>   10.10.4.1/32     0.0.0.0                  0         32768 i
 * i  10.20.0.0/16     10.10.2.1                0    100      0 i
 *>i                   10.10.1.1                0    100      0 i
 *>i  10.30.8.1/32     10.10.2.1                0    100      0 300 i
 *>i  10.40.9.1/32     10.10.1.1                0    100      0 400 i
 *>i  10.40.19.1/32    10.10.1.1                0    100      0 400 i

実際に集約経路のみの広報となっていることがわかります。

ネットワークエンジニアの教科書
〜ネットワークエンジニアを目指す人、ネットワークエンジニアになったばかりの人におすすめの1冊〜

最後に

今回は、BGPの経路制御の第一弾として「経路集約」についてまとめてみました。

直近、ブログを改善しているため、prefix-list/route-mapに関する制御やその他の経路制御は別の記事で作成する予定です。

  • URLをコピーしました!

この記事を書いた人

目次