NWエンジニアの勉強ブログ

NWエンジニアです。勉強した内容を気ままにまとめていきます。

OSPFでdistribute-listを使用する際にベストLSAをフィルタリングする【Cisco】

こんにちは。
今回は、OSPFネットワークにおいて、distribute-listを使用し、ベストLSA(ベストパスとなるLSA)をフィルタリングした時の仕様について検証したので、アウトプットします。なお、下記の公式ドキュメントを参考にしました。
OSPF distribute-list の実装変更について - Cisco Community

検証構成1


R2およびR3が172.20.1.0/24のルートをOSPFドメインに再配布しています。この時、R2ではメトリックを200とし、タグ200を付与、R3ではメトリックを300とし、タグ300を付与しています。これにより、R1は172.20.1.0/24に関するLSAを受け取った際に、R2からのLSAをベストLSAとしルーティングテーブルに載せます。

投入コンフィグ

R2とR3に投入したコンフィグは下記の通りです。

R2
router ospf 1
 redistribute connected metric 200 subnets tag 200
 network 192.168.1.0 0.0.0.255 area 0
 distribute-list 10 out
!
access-list 10 deny   10.2.2.2
access-list 10 permit any

R3
router ospf 1
 redistribute connected metric 300 subnets tag 300
 network 192.168.1.0 0.0.0.255 area 0
 distribute-list 10 out
!
access-list 10 deny   10.3.3.3
access-list 10 permit any

R1のルーティングテーブルとLSDB

R2とR3にて経路制御を行ったため、R1にて想定通りのルーティングテーブルとLSDBとなっているかを確認します。

R1#sh ip ro | b las
Gateway of last resort is not set

      10.0.0.0/32 is subnetted, 1 subnets
C        10.1.1.1 is directly connected, Loopback0
      172.20.0.0/24 is subnetted, 1 subnets
O E2     172.20.1.0 [110/200] via 192.168.1.2, 00:15:55, FastEthernet0/0
      192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.1.0/24 is directly connected, FastEthernet0/0
L        192.168.1.1/32 is directly connected, FastEthernet0/0
R1#
R1#sh ip os d

            OSPF Router with ID (10.1.1.1) (Process ID 1)

                Router Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum Link count
10.1.1.1        10.1.1.1        1142        0x80000002 0x00E040 2
10.2.2.2        10.2.2.2        1138        0x80000002 0x00B184 1
10.3.3.3        10.3.3.3        1143        0x80000002 0x0089A5 1

                Net Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum
192.168.1.3     10.3.3.3        1138        0x80000002 0x005B29

                Type-5 AS External Link States

Link ID         ADV Router      Age         Seq#       Checksum Tag
172.20.1.0      10.2.2.2        1180        0x80000001 0x00CF81 200
172.20.1.0      10.3.3.3        1183        0x80000001 0x00B3D1 300

172.20.1.0/24のベストルートとして、R2をネクストホップとしたルートが選択されていることがルーティングテーブルからわかります。
Link ID 172.20.1.0について、二つのLSA(Type-5)を受信していることが確認できましたが、もう少し詳しく確認してみます。

R1#sh ip os d external 172.20.1.0

            OSPF Router with ID (10.1.1.1) (Process ID 1)

                Type-5 AS External Link States

  Routing Bit Set on this LSA in topology Base with MTID 0
  LS age: 1323
  Options: (No TOS-capability, DC)
  LS Type: AS External Link
  Link State ID: 172.20.1.0 (External Network Number )
  Advertising Router: 10.2.2.2
  LS Seq Number: 80000001
  Checksum: 0xCF81
  Length: 36
  Network Mask: /24
        Metric Type: 2 (Larger than any link state path)
        MTID: 0
        Metric: 200
        Forward Address: 0.0.0.0
        External Route Tag: 200

  LS age: 1326
  Options: (No TOS-capability, DC)
  LS Type: AS External Link
  Link State ID: 172.20.1.0 (External Network Number )
  Advertising Router: 10.3.3.3
  LS Seq Number: 80000001
  Checksum: 0xB3D1
  Length: 36
  Network Mask: /24
        Metric Type: 2 (Larger than any link state path)
        MTID: 0
        Metric: 300
        Forward Address: 0.0.0.0
        External Route Tag: 300

想定通り、R2からのLSAはメトリック200、タグ200となっており、R3からのLSAはメトリック300、タグ300となっていることが確認できました。

検証構成2


ここからが本題です。検証構成1の条件に加えて、R1においてタグ200が付与された経路を除外するdistribute-listをin方向に適用した際の挙動を検証してみます。

投入するコンフィグ

R1に、下記のコンフィグを投入します。

router ospf 1
 distribute-list route-map TEST in
!
route-map TEST deny 10
 match tag 200
!
route-map TEST permit 20

状態確認の前に考えてみる

状態確認の前に、どのような挙動となるかを考えてみます。172.20.1.0/24の経路情報は、R2とR3の両方からLSAを受信しています。また、distribute-listをin方向で適用するので作用するポイントはLSDB構築後からルーティングテーブル形成までの間です。そのため、LSDBは投入前後で変わらないが、ルーティングテーブルに載るベストルートは、R3をネクストホップとしたルートと推測できます。

状態確認

R1のルーティングテーブルとLSDBを確認してみます。

R1#sh ip ro | b las
Gateway of last resort is not set

      10.0.0.0/32 is subnetted, 1 subnets
C        10.1.1.1 is directly connected, Loopback0
      192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.1.0/24 is directly connected, FastEthernet0/0
L        192.168.1.1/32 is directly connected, FastEthernet0/0
R1#
R1#sh ip os d

            OSPF Router with ID (10.1.1.1) (Process ID 1)

                Router Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum Link count
10.1.1.1        10.1.1.1        386         0x80000003 0x00DE41 2
10.2.2.2        10.2.2.2        403         0x80000003 0x00AF85 1
10.3.3.3        10.3.3.3        424         0x80000003 0x0087A6 1

                Net Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum
192.168.1.3     10.3.3.3        424         0x80000003 0x00592A

                Type-5 AS External Link States

Link ID         ADV Router      Age         Seq#       Checksum Tag
172.20.1.0      10.2.2.2        403         0x80000002 0x00CD82 200
172.20.1.0      10.3.3.3        425         0x80000002 0x00B1D2 300

ルーティングテーブルに、172.20.1.0/24が載っていない!
これが今回最も重要な部分になります。冒頭で載せた公式ドキュメント内には、次のように記述されています。

実装後:ベストパスとなる LSA を除外すると、次に有効なパスは計算されません

つまり、distribute-listによってベストパスとなるLSAを除外するように設定すると、その次に有効となる経路情報が保持されていても、SPFツリー形成およびルーティングテーブル形成には使用しないという仕様が存在します。このような仕様となった理由ですが、ドキュメント内に記述があるように、distribute-listの使用有無によるパス計算の違いによりループが発生するため、とのことです。

したがって、172.20.1.0/24がルーティングテーブルに載っていないのは、実装されたOSPFの仕様によるものとなります。
※なお、Ciscoのみで確認できた仕様のため、他ベンダ機器のOSPFの実装の場合だと異なる可能性があります。

まとめ

今回は、OSPF環境において、distribute-listを使用してベストパスLSAを制御した際の挙動について検証しました。バックアップ経路に自動で切り替えてくれるのがダイナミックルーティングのメリットですが、思わぬ落とし穴(仕様)に落ちないよう、検証はしっかり行っておきたいですね。それでは。

OSPFへの再配送時における、distribute-listの適用方向ごとのアルゴリズムの違い【Cisco】

こんにちは。
今回は、OSPFへの再配送時にdistribute-listを使用した経路制御を検証したので、アウトプットしていきます。

検証構成1


EIGRPからOSPFへ再配送を行う、単純な構成です。構成1では、ASBRにあたるR2において、distribute-listをout方向で使用し、EIGRPから再配送される経路の内、10.1.1.0/24のみを除外するケースを構築します。

distribute-list適用前の状態

distribute-list適用前のルーティングテーブルとLSDBを確認します。

R2(config-router)#do sh ip ro | b las
Gateway of last resort is not set

      2.0.0.0/32 is subnetted, 1 subnets
C        2.2.2.2 is directly connected, Loopback0
      10.0.0.0/8 is variably subnetted, 7 subnets, 2 masks
D        10.1.1.0/24 [90/156160] via 10.12.1.1, 00:26:34, FastEthernet0/0
D        10.2.2.0/24 [90/156160] via 10.12.1.1, 00:26:34, FastEthernet0/0
D        10.3.3.0/24 [90/156160] via 10.12.1.1, 00:26:34, FastEthernet0/0
C        10.12.1.0/24 is directly connected, FastEthernet0/0
L        10.12.1.2/32 is directly connected, FastEthernet0/0
C        10.23.1.0/24 is directly connected, FastEthernet1/0
L        10.23.1.2/32 is directly connected, FastEthernet1/0

R2(config-router)#do sh ip os d

            OSPF Router with ID (2.2.2.2) (Process ID 1)

                Router Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum Link count
2.2.2.2         2.2.2.2         1100        0x80000004 0x0026AE 1
3.3.3.3         3.3.3.3         1545        0x80000002 0x00E5E9 1

                Net Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum
10.23.1.3       3.3.3.3         1545        0x80000001 0x004FA5

                Type-5 AS External Link States

Link ID         ADV Router      Age         Seq#       Checksum Tag
10.1.1.0        2.2.2.2         13          0x80000001 0x00127A 0
10.2.2.0        2.2.2.2         1089        0x80000001 0x00FA8F 0
10.3.3.0        2.2.2.2         1089        0x80000001 0x00E3A4 0
10.12.1.0       2.2.2.2         1089        0x80000001 0x008DF3 0
R3#sh ip ro | b las
Gateway of last resort is not set

      3.0.0.0/32 is subnetted, 1 subnets
C        3.3.3.3 is directly connected, Loopback0
      10.0.0.0/8 is variably subnetted, 6 subnets, 2 masks
O E2     10.1.1.0/24 [110/20] via 10.23.1.2, 00:00:07, FastEthernet0/0
O E2     10.2.2.0/24 [110/20] via 10.23.1.2, 00:01:07, FastEthernet0/0
O E2     10.3.3.0/24 [110/20] via 10.23.1.2, 00:01:07, FastEthernet0/0
O E2     10.12.1.0/24 [110/20] via 10.23.1.2, 00:01:07, FastEthernet0/0
C        10.23.1.0/24 is directly connected, FastEthernet0/0
L        10.23.1.3/32 is directly connected, FastEthernet0/0
R3#sh ip os d

            OSPF Router with ID (3.3.3.3) (Process ID 1)

                Router Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum Link count
2.2.2.2         2.2.2.2         88          0x80000004 0x0026AE 1
3.3.3.3         3.3.3.3         532         0x80000002 0x00E5E9 1

                Net Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum
10.23.1.3       3.3.3.3         532         0x80000001 0x004FA5

                Type-5 AS External Link States

Link ID         ADV Router      Age         Seq#       Checksum Tag
10.1.1.0        2.2.2.2         18          0x80000001 0x00127A 0
10.2.2.0        2.2.2.2         78          0x80000001 0x00FA8F 0
10.3.3.0        2.2.2.2         78          0x80000001 0x00E3A4 0
10.12.1.0       2.2.2.2         78          0x80000001 0x008DF3 0

EIGRPからOSPFへ再配送された経路情報はLSA type5としてR2(ASBR)が生成し、OSPFドメイン内のルータ(R2,R3)はOSPF externalルートとして経路を学習しています。
※R2ではAD値の関係からEIGRPで学習した経路情報をルーティングテーブルに載せています。

distribute-listをR2に適用する

下記コンフィグをR2に投入します。

router ospf 1
 distribute-list 10 out
!
access-list 10 deny   10.1.1.0 0.0.0.255
access-list 10 permit any

distribute-list適用後の状態

distribute-list適用後のルーティングテーブルとLSDBを確認します。

まずは、ルーティングテーブルから。

R2(config-router)#do sh ip ro | b las
Gateway of last resort is not set

      2.0.0.0/32 is subnetted, 1 subnets
C        2.2.2.2 is directly connected, Loopback0
      10.0.0.0/8 is variably subnetted, 7 subnets, 2 masks
D        10.1.1.0/24 [90/156160] via 10.12.1.1, 00:27:49, FastEthernet0/0
D        10.2.2.0/24 [90/156160] via 10.12.1.1, 00:27:49, FastEthernet0/0
D        10.3.3.0/24 [90/156160] via 10.12.1.1, 00:27:49, FastEthernet0/0
C        10.12.1.0/24 is directly connected, FastEthernet0/0
L        10.12.1.2/32 is directly connected, FastEthernet0/0
C        10.23.1.0/24 is directly connected, FastEthernet1/0
L        10.23.1.2/32 is directly connected, FastEthernet1/0

R3#sh ip ro | b las
Gateway of last resort is not set

      3.0.0.0/32 is subnetted, 1 subnets
C        3.3.3.3 is directly connected, Loopback0
      10.0.0.0/8 is variably subnetted, 5 subnets, 2 masks
O E2     10.2.2.0/24 [110/20] via 10.23.1.2, 00:01:15, FastEthernet0/0
O E2     10.3.3.0/24 [110/20] via 10.23.1.2, 00:01:15, FastEthernet0/0
O E2     10.12.1.0/24 [110/20] via 10.23.1.2, 00:01:15, FastEthernet0/0
C        10.23.1.0/24 is directly connected, FastEthernet0/0
L        10.23.1.3/32 is directly connected, FastEthernet0/0

R2ではEIGRPで10.1.1.0/24の経路を学習しているため、ルーティングテーブルに変化はありません。
R3では10.1.1.0/24の経路がルーティングテーブルから消えていることがわかります。

続いて、LSDB。

R2(config-router)#do sh ip os d

            OSPF Router with ID (2.2.2.2) (Process ID 1)

                Router Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum Link count
2.2.2.2         2.2.2.2         1192        0x80000004 0x0026AE 1
3.3.3.3         3.3.3.3         1638        0x80000002 0x00E5E9 1

                Net Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum
10.23.1.3       3.3.3.3         1638        0x80000001 0x004FA5

                Type-5 AS External Link States

Link ID         ADV Router      Age         Seq#       Checksum Tag
10.2.2.0        2.2.2.2         1182        0x80000001 0x00FA8F 0
10.3.3.0        2.2.2.2         1182        0x80000001 0x00E3A4 0
10.12.1.0       2.2.2.2         1182        0x80000001 0x008DF3 0
R2(config-router)#


R3#sh ip os d

            OSPF Router with ID (3.3.3.3) (Process ID 1)

                Router Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum Link count
2.2.2.2         2.2.2.2         85          0x80000002 0x002AAC 1
3.3.3.3         3.3.3.3         84          0x80000002 0x00E5E9 1

                Net Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum
10.23.1.3       3.3.3.3         84          0x80000001 0x004FA5

                Type-5 AS External Link States

Link ID         ADV Router      Age         Seq#       Checksum Tag
10.2.2.0        2.2.2.2         122         0x80000001 0x00FA8F 0
10.3.3.0        2.2.2.2         122         0x80000001 0x00E3A4 0
10.12.1.0       2.2.2.2         125         0x80000001 0x008DF3 0

注目すべきは、R2のLSDBです。type-5の一覧からLink ID 10.1.1.0の情報が載っていないことから、R2(ASBR)は10.1.1.0/24のLSA type5を生成していないことが言えます。

このことから、OSPFにおいて、distribute-listをout方向に適用すると、EIGRPからOSPFに再配送後から、LSDB構築前までのプロセスに影響を及ぼしていることがわかります。

検証構成2


同様な構成で、今度はR3にdistribute-listをin方向で適用し、10.1.1.0/24の経路を除外するよう構築してみます。

distribute-listをR3に適用する

下記コンフィグをR3に投入します。なお、検証構成1でR2に投入したコンフィグは予め削除しています。

router ospf 1
 distribute-list 10 in
!
access-list 10 deny   10.1.1.0 0.0.0.255
access-list 10 permit any

distribute-list適用後の状態

distribute-list適用後のルーティングテーブルとLSDBを確認します。なお、R2はコンフィグ投入前後で変化がないため割愛します。

まずは、ルーティングテーブルから。

R3(config-router)#do sh ip ro | b las
Gateway of last resort is not set

      3.0.0.0/32 is subnetted, 1 subnets
C        3.3.3.3 is directly connected, Loopback0
      10.0.0.0/8 is variably subnetted, 5 subnets, 2 masks
O E2     10.2.2.0/24 [110/20] via 10.23.1.2, 00:03:12, FastEthernet0/0
O E2     10.3.3.0/24 [110/20] via 10.23.1.2, 00:03:12, FastEthernet0/0
O E2     10.12.1.0/24 [110/20] via 10.23.1.2, 00:03:12, FastEthernet0/0
C        10.23.1.0/24 is directly connected, FastEthernet0/0
L        10.23.1.3/32 is directly connected, FastEthernet0/0

10.1.1.0/24の経路が除外されていることがわかります。

次に、LSDB。

R3(config-router)#do sh ip os d

            OSPF Router with ID (3.3.3.3) (Process ID 1)

                Router Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum Link count
2.2.2.2         2.2.2.2         341         0x80000002 0x002AAC 1
3.3.3.3         3.3.3.3         340         0x80000002 0x00E5E9 1

                Net Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum
10.23.1.3       3.3.3.3         340         0x80000001 0x004FA5

                Type-5 AS External Link States

Link ID         ADV Router      Age         Seq#       Checksum Tag
10.1.1.0        2.2.2.2         345         0x80000001 0x00127A 0
10.2.2.0        2.2.2.2         375         0x80000001 0x00FA8F 0
10.3.3.0        2.2.2.2         375         0x80000001 0x00E3A4 0
10.12.1.0       2.2.2.2         386         0x80000001 0x008DF3 0

LSA type-5にLink ID 10.1.1.0が載っていることがわかります。
このことから、OSPFにおいて、distribute-listをin方向に適用すると、LSDB構築後から、ルーティングテーブル作成までのプロセスに影響を及ぼしていると推測できます。

したがって、distribute-listの適用方向によって、影響を及ぼす箇所(チェックポイント)は下記のような違いがあるといえます。

なぜdistribute-listの適用方向ごとに異なるのか【考察】

上記の検証より、distribute-listの適用方向によって、distribute-listのチェックポイントが異なることがわかりました。一見すると、適用方向に関係なく、LSDB構築前(あるいは後)で統一してもよさそうに見えます。なぜこのような違いがあるのかを考察してみます。

結論的には、同一エリア内のOSPFルータは同じトポロジーマップ(=LSDB)を持つ必要があるという仕様により、distribute-listのチェックポイントが異なると言えます。

OSPFはネイバー確立後、自身のLSDBとほかのネイバーのLSDBを比較し合い、同期処理を行うことでアジャセンシーを確立します。アジャセンシー確立後、新たにLSDBに変化があった場合は、再同期処理を行うことで、同じLSDBを保つように動作します。

このような仕様のもと、例えば、distribute-listをin方向で適用した際、LSDB構築前にdistribute-listのチェックポイントが存在すると、LSDBの差分は存在し続けることになります(out方向でも同様に考えられる)。したがって、distribute-listのチェックポイントは適用方向によって異なる必要があると考えることができます。

まとめ

今回は、OSPFへの再配送時における、distribute-listによる経路制御を検証し、適用方向によってアルゴリズムに違いがあることがわかりました。それでは。

VirtualBox上のLinuxへのHDD追加からマウントまでの流れ

今回は、VirtualBox上のLinux(CentOS7)へHDD追加からマウントまでの流れをアウトプットしていきたいと思います。

<目次>

やりたいこと

VirtualBox上のLinuxにHDDを追加し、特定のディレクトリ(『/data』とします)に保存されたファイルやディレクトリは、今回追加するHDDに保存されるようにしたい。


流れは下記の通り。

  1. HDDを追加する
  2. パーティションを作成する
  3. 作成したパーティションファイルシステムを作成する
  4. ファイルシステムをマウントする
  5. 『/etc/fstab』ファイルにファイルシステムを追記する(任意)

HDDを追加する

まずは、現状確認。システムが認識しているブロックデバイスをlsblkコマンドで確認します。
lsblkコマンドはブロックデバイスの一覧を表示するコマンドです。
*1

早速、HDDを追加します。
VirtualBoxマネージャーの画面で、『設定』→『ストレージ』と進み、HDDを追加後、OKを押します。
今回は、「CentOS7minimal_1.vdi」を追加しています。

再度lsblkコマンドを実行し、追加したHDDをシステムが認識しているか、確認してみます。

追加したHDDがデバイスファイル/dev/sdbとして認識されているので準備完了です。

パーティションを作成する

次に、追加されたHDD(/dev/sdb)にパーティションを作成していきます。
パーティションの作成には、fdiskコマンド、gdiskコマンド、partedコマンドが使用可能です。
今回はfdiskコマンドで基本パーティション/dev/sdb1を作成していきます。

fdiskコマンドを実行すると、サブコマンドを使用し対話形式でパーティションの作成(削除、変更なども可)を行うことができます。サブコマンド『m』でサブコマンドメニューを表示できます。

まずはサブコマンド『p』で/dev/sdbのパーティションテーブルを確認します(当然何も表示されません)。
パーティションの作成はサブコマンド『n』を実行します。今回は下記の通りで指定しました。
 ・基本パーティション
 ・パーティション番号は1
 ・開始位置はデフォルト通り
 ・終了位置は+1M

再度サブコマンド『p』でパーティションテーブルを確認します。/dev/sda1が追加されていることがわかります。

最後に、サブコマンド『w』でパーティションテーブルの変更を保存して終了します。

作成したパーティションファイルシステムを作成する

作成したパーティションは、まだファイルを保存することができない状態のため、ファイルシステムを作成していきます。ファイルシステムを作成するコマンドは、mkfsコマンド、mke2fsコマンドなどがありますが、今回はmkfsコマンドを使用します。ファイルシステムタイプはext2とします。

ファイルシステムをマウントする

最後に作成したファイルシステムをマウントしていきます。今回は下記のイメージ図のように、あらかじめ作成した『/data』ディレクトリをマウントポイントとし、『/dev/sdb1』をマウントします。

マウントするにはmountコマンドを使用します。

マウントされているかを確認するために、dfコマンドを実行します。
※なお、mountコマンド(引数指定なし)を実行することでも、マウントされているかが確認できます。

dfコマンドは、引数にディレクトリ名を指定することで、そのディレクトリが属しているファイルシステムを表示することができます。

lsコマンドで『/data』ディレクトリを確認してみます。

※『lost+found』という空のディレクトリがデフォルトで表示されます。これはHDDのチェックを行い、必要に応じて修復を行うfsckコマンドで使用されるデータが保存されるディレクトリです。

試しに『/data』ディレクトリ上に『file』ファイルを作成してみます。

以上で、追加したHDD上のファイルシステムをマウントすることができました。

本当に追加したHDD上に保存されているのか?

『/data』ディレクトリ配下のファイルやディレクトリが追加したHDDに保存されているかを確認するため、『/dev/sdb1』をアンマウントしてみます。アンマウント後、『/data』ディレクトリ内にあったファイルやディレクトリが表示されなくなった場合、たしかに追加したHDD上にあることがわかります。

アンマウントを行うにはumountコマンドを使用します。引数には、マウントポイント(/data)かデバイスファイル名(/dev/sdb1)を指定します。

アンマウント後、dfコマンドとlsコマンドを実行してみます。
『/data』ディレクトリは『/』ディレクトリに属し、ファイルが何も保存されていないことがわかります。

再度マウントし、dfコマンドとlsコマンドを実行してみます。

アンマウント前と同じ状態に戻っていることがわかります。
したがって、たしかに追加したHDDにデータが保存されていることがわかりました。

『/etc/fstab』ファイルにファイルシステムを追記する(任意)

今回マウントしたファイルシステムを、次回の起動以降も同様にマウントさせておきたい場合、『/etc/fstab』ファイルにファイルシステムの情報を記述しておく必要があります。
今回のみマウントする場合は、本作業は不要です。

記述例は下記の通りです。『/etc/fstab』ファイルの書式に従って追記します。

 

まとめ

今回はVirtualBox上のLinuxにHDDを追加し、マウントするまでの流れをまとめてみました。LPICの最初の難敵とも言っても過言ではない本トピックですが、これからも手を動かして技術力を上げていきたいと思います!

ありがとうございました。

*1:ブロックデバイス⇒HDDやSSDといった、任意の場所にアクセスすることができるデバイス

外部ASから見たBGP Confederation構成

こんにちは!
今回は、外部ASと接続したときのBGP Confederation構成を検証していきます。
◆第一回
shirase96476559.hatenablog.com

◆第二回
shirase96476559.hatenablog.com

1.検証構成

下記のような構成で検証しました。

AS1234はサブAS 65000とサブAS 65001によって構成されます。
また、外部ASとして、AS 500とAS 600と接続し、外部ASからのAS 1234の見え方を確認します。

※検証環境:Cisco DevNet Sandboxのiosvを使用

2.構築

コンフィグは下記の通りです。
※interfaceには特別な設定を入れていないので、省略します。

hostname RT1
!
router ospf 1
 network 10.1.12.0 0.0.0.255 area 0
 network 1.1.1.1 0.0.0.0 area 0
!
router bgp 65000
 neighbor 2.2.2.2 remote-as 65000
 neighbor 2.2.2.2 update-source loopback0
 network 1.1.1.1 mask 255.255.255.255
 bgp confederation identifier 1234
hostname RT2
!
router ospf 1
 network 10.1.12.0 0.0.0.255 area 0
 network 10.1.23.0 0.0.0.255 area 0
 network 2.2.2.2 0.0.0.0 area 0
!
router bgp 65000
 neighbor 1.1.1.1 remote-as 65000
 neighbor 1.1.1.1 update-source loopback0
 neighbor 1.1.1.1 next-hop-self
 neighbor 3.3.3.3 remote-as 65001
 neighbor 3.3.3.3 next-hop-self
 neighbor 3.3.3.3 update-source loopback0
 neighbor 3.3.3.3 ebgp-multihop
 neighbor 10.1.25.5 remote-as 500
 neighbor 10.1.25.5 ebgp-multihop
 network 2.2.2.2 mask 255.255.255.255
 bgp confederation identifier 1234
 bgp confederation peers 65001
hostname RT3
!
router ospf 1
 network 10.1.23.0 0.0.0.255 area 0
 network 10.1.34.0 0.0.0.255 area 0
 network 3.3.3.3 0.0.0.0 area 0
!
router bgp 65001
 neighbor 4.4.4.4 remote-as 65001
 neighbor 4.4.4.4 update-source loopback0
 neighbor 4.4.4.4 next-hop-self
 neighbor 2.2.2.2 remote-as 65000
 neighbor 2.2.2.2 next-hop-self
 neighbor 2.2.2.2 update-source loopback0
 neighbor 2.2.2.2 ebgp-multihop
 network 3.3.3.3 mask 255.255.255.255
 bgp confederation identifier 1234
 bgp confederation peers 65000
hostname RT4
!
router ospf 1
 network 10.1.34.0 0.0.0.255 area 0
 network 4.4.4.4 0.0.0.0 area 0
!
router bgp 65001
 neighbor 3.3.3.3 remote-as 65001
 neighbor 3.3.3.3 update-source loopback0
 neighbor 3.3.3.3 next-hop-self
 neighbor 10.1.46.6 remote-as 600
 neighbor 10.1.46.6 ebgp-multihop
 network 4.4.4.4 mask 255.255.255.255
 bgp confederation identifier 1234
hostname RT5
!
router bgp 500
 neighbor 10.1.25.2 remote-as 1234
 network 5.5.5.5 mask 255.255.255.255
hostname RT6
!
router bgp 600
 neighbor 10.1.46.4 remote-as 1234
 network 6.6.6.6 mask 255.255.255.255

3.BGPテーブルの確認

BGPテーブルは下記の通りです。

RT1#sh ip bgp
BGP table version is 7, 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
 r>i  2.2.2.2/32       2.2.2.2                  0    100      0 i
 r>i  3.3.3.3/32       2.2.2.2                  0    100      0 (65001) i
 r>i  4.4.4.4/32       2.2.2.2                  0    100      0 (65001) i
 *>i  5.5.5.5/32       2.2.2.2                  0    100      0 500 i
 *>i  6.6.6.6/32       2.2.2.2                  0    100      0 (65001) 600 i
RT2#sh ip bgp
BGP table version is 7, local router ID is 2.2.2.2
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  1.1.1.1/32       1.1.1.1                  0    100      0 i
 *>   2.2.2.2/32       0.0.0.0                  0         32768 i
 r>   3.3.3.3/32       3.3.3.3                  0    100      0 (65001) i
 r>   4.4.4.4/32       3.3.3.3                  0    100      0 (65001) i
 *>   5.5.5.5/32       10.1.25.5                0             0 500 i
 *>   6.6.6.6/32       3.3.3.3                  0    100      0 (65001) 600 i
RT3#sh ip bgp
BGP table version is 7, local router ID is 3.3.3.3
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>   1.1.1.1/32       2.2.2.2                  0    100      0 (65000) i
 r>   2.2.2.2/32       2.2.2.2                  0    100      0 (65000) i
 *>   3.3.3.3/32       0.0.0.0                  0         32768 i
 r>i  4.4.4.4/32       4.4.4.4                  0    100      0 i
 *>   5.5.5.5/32       2.2.2.2                  0    100      0 (65000) 500 i
 *>i  6.6.6.6/32       4.4.4.4                  0    100      0 600 i
RT4#sh ip bgp
BGP table version is 7, local router ID is 4.4.4.4
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  1.1.1.1/32       3.3.3.3                  0    100      0 (65000) i
 r>i  2.2.2.2/32       3.3.3.3                  0    100      0 (65000) i
 r>i  3.3.3.3/32       3.3.3.3                  0    100      0 i
 *>   4.4.4.4/32       0.0.0.0                  0         32768 i
 *>i  5.5.5.5/32       3.3.3.3                  0    100      0 (65000) 500 i
 *>   6.6.6.6/32       10.1.46.6                0             0 600 i
RT5#sh ip bgp
BGP table version is 7, local router ID is 5.5.5.5
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       10.1.25.2                              0 1234 i
 *>   2.2.2.2/32       10.1.25.2                0             0 1234 i
 *>   3.3.3.3/32       10.1.25.2                              0 1234 i
 *>   4.4.4.4/32       10.1.25.2                              0 1234 i
 *>   5.5.5.5/32       0.0.0.0                  0         32768 i
 *>   6.6.6.6/32       10.1.25.2                              0 1234 600 i
RT6#sh ip bgp
BGP table version is 7, local router ID is 6.6.6.6
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       10.1.46.4                              0 1234 i
 *>   2.2.2.2/32       10.1.46.4                              0 1234 i
 *>   3.3.3.3/32       10.1.46.4                              0 1234 i
 *>   4.4.4.4/32       10.1.46.4                0             0 1234 i
 *>   5.5.5.5/32       10.1.46.4                              0 1234 500 i
 *>   6.6.6.6/32       0.0.0.0                  0         32768 i

まず、Confederation内のRT1を例に見てみると、5.5.5.5/32や6.6.6.6/32といった外部ASから広告されている経路は、AS_PATH属性にAS情報が記載されており、6.6.6.6/32に関してはサブAS 65001を経由していることがわかります。

次に、外部AS 500に所属するRT5を見てみると、eBGPを構築した時と同様に、1.1.1.1/32、2.2.2.2/32、3.3.3.3/32、4.4.4.4/32は、AS 1234から広告された経路であることがわかりますが、サブAS 65000やサブAS 65001の表記がないため、どちらから広告されたかはわかりません。
また、AS600から広告されている6.6.6.6/32の経路も、AS 600→1234と経由してAS 500にやってきたことはわかりますが、同じくサブASの情報はありません。このことは、RT6でも同様のことが言えます。

したがって、外部ASからはサブASが見えない(=BGP Confederation構成であることを意識することなく接続している)ということがわかりました。

4.ルーティングテーブルの確認

ルーティングテーブルは下記の通り

RT1#sh ip route | b Gate
Gateway of last resort is not set

      1.0.0.0/32 is subnetted, 1 subnets
C        1.1.1.1 is directly connected, Loopback0
      2.0.0.0/32 is subnetted, 1 subnets
O        2.2.2.2 [110/2] via 10.1.12.2, 00:19:11, GigabitEthernet0/0
      3.0.0.0/32 is subnetted, 1 subnets
O        3.3.3.3 [110/3] via 10.1.12.2, 00:18:37, GigabitEthernet0/0
      4.0.0.0/32 is subnetted, 1 subnets
O        4.4.4.4 [110/4] via 10.1.12.2, 00:18:10, GigabitEthernet0/0
      5.0.0.0/32 is subnetted, 1 subnets
B        5.5.5.5 [200/0] via 2.2.2.2, 00:13:32
      6.0.0.0/32 is subnetted, 1 subnets
B        6.6.6.6 [200/0] via 2.2.2.2, 00:12:23
      10.0.0.0/8 is variably subnetted, 4 subnets, 2 masks
C        10.1.12.0/24 is directly connected, GigabitEthernet0/0
L        10.1.12.1/32 is directly connected, GigabitEthernet0/0
O        10.1.23.0/24 [110/2] via 10.1.12.2, 00:18:47, GigabitEthernet0/0
O        10.1.34.0/24 [110/3] via 10.1.12.2, 00:18:20, GigabitEthernet0/0
RT1#
RT2#sh ip route | b Gate
Gateway of last resort is not set

      1.0.0.0/32 is subnetted, 1 subnets
O        1.1.1.1 [110/2] via 10.1.12.1, 00:21:27, GigabitEthernet0/0
      2.0.0.0/32 is subnetted, 1 subnets
C        2.2.2.2 is directly connected, Loopback0
      3.0.0.0/32 is subnetted, 1 subnets
O        3.3.3.3 [110/2] via 10.1.23.3, 00:21:03, GigabitEthernet0/1
      4.0.0.0/32 is subnetted, 1 subnets
O        4.4.4.4 [110/3] via 10.1.23.3, 00:20:26, GigabitEthernet0/1
      5.0.0.0/32 is subnetted, 1 subnets
B        5.5.5.5 [20/0] via 10.1.25.5, 00:15:48
      6.0.0.0/32 is subnetted, 1 subnets
B        6.6.6.6 [200/0] via 3.3.3.3, 00:14:39
      10.0.0.0/8 is variably subnetted, 7 subnets, 2 masks
C        10.1.12.0/24 is directly connected, GigabitEthernet0/0
L        10.1.12.2/32 is directly connected, GigabitEthernet0/0
C        10.1.23.0/24 is directly connected, GigabitEthernet0/1
L        10.1.23.2/32 is directly connected, GigabitEthernet0/1
C        10.1.25.0/24 is directly connected, GigabitEthernet0/2
L        10.1.25.2/32 is directly connected, GigabitEthernet0/2
O        10.1.34.0/24 [110/2] via 10.1.23.3, 00:20:36, GigabitEthernet0/1
RT2#
RT3#sh ip route | b Gate
Gateway of last resort is not set

      1.0.0.0/32 is subnetted, 1 subnets
O        1.1.1.1 [110/3] via 10.1.23.2, 00:22:26, GigabitEthernet0/0
      2.0.0.0/32 is subnetted, 1 subnets
O        2.2.2.2 [110/2] via 10.1.23.2, 00:22:26, GigabitEthernet0/0
      3.0.0.0/32 is subnetted, 1 subnets
C        3.3.3.3 is directly connected, Loopback0
      4.0.0.0/32 is subnetted, 1 subnets
O        4.4.4.4 [110/2] via 10.1.34.4, 00:21:59, GigabitEthernet0/1
      5.0.0.0/32 is subnetted, 1 subnets
B        5.5.5.5 [200/0] via 2.2.2.2, 00:17:11
      6.0.0.0/32 is subnetted, 1 subnets
B        6.6.6.6 [200/0] via 4.4.4.4, 00:16:02
      10.0.0.0/8 is variably subnetted, 5 subnets, 2 masks
O        10.1.12.0/24 [110/2] via 10.1.23.2, 00:22:26, GigabitEthernet0/0
C        10.1.23.0/24 is directly connected, GigabitEthernet0/0
L        10.1.23.3/32 is directly connected, GigabitEthernet0/0
C        10.1.34.0/24 is directly connected, GigabitEthernet0/1
L        10.1.34.3/32 is directly connected, GigabitEthernet0/1
RT3#
RT4#sh ip route | b Gate
Gateway of last resort is not set

      1.0.0.0/32 is subnetted, 1 subnets
O        1.1.1.1 [110/4] via 10.1.34.3, 00:23:35, GigabitEthernet0/0
      2.0.0.0/32 is subnetted, 1 subnets
O        2.2.2.2 [110/3] via 10.1.34.3, 00:23:35, GigabitEthernet0/0
      3.0.0.0/32 is subnetted, 1 subnets
O        3.3.3.3 [110/2] via 10.1.34.3, 00:23:35, GigabitEthernet0/0
      4.0.0.0/32 is subnetted, 1 subnets
C        4.4.4.4 is directly connected, Loopback0
      5.0.0.0/32 is subnetted, 1 subnets
B        5.5.5.5 [200/0] via 3.3.3.3, 00:18:47
      6.0.0.0/32 is subnetted, 1 subnets
B        6.6.6.6 [20/0] via 10.1.46.6, 00:17:39
      10.0.0.0/8 is variably subnetted, 6 subnets, 2 masks
O        10.1.12.0/24 [110/3] via 10.1.34.3, 00:23:35, GigabitEthernet0/0
O        10.1.23.0/24 [110/2] via 10.1.34.3, 00:23:35, GigabitEthernet0/0
C        10.1.34.0/24 is directly connected, GigabitEthernet0/0
L        10.1.34.4/32 is directly connected, GigabitEthernet0/0
C        10.1.46.0/24 is directly connected, GigabitEthernet0/1
L        10.1.46.4/32 is directly connected, GigabitEthernet0/1
RT4#
RT5#sh ip route | b Gate
Gateway of last resort is not set

      1.0.0.0/32 is subnetted, 1 subnets
B        1.1.1.1 [20/0] via 10.1.25.2, 00:20:17
      2.0.0.0/32 is subnetted, 1 subnets
B        2.2.2.2 [20/0] via 10.1.25.2, 00:20:17
      3.0.0.0/32 is subnetted, 1 subnets
B        3.3.3.3 [20/0] via 10.1.25.2, 00:20:17
      4.0.0.0/32 is subnetted, 1 subnets
B        4.4.4.4 [20/0] via 10.1.25.2, 00:20:17
      5.0.0.0/32 is subnetted, 1 subnets
C        5.5.5.5 is directly connected, Loopback0
      6.0.0.0/32 is subnetted, 1 subnets
B        6.6.6.6 [20/0] via 10.1.25.2, 00:19:09
      10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        10.1.25.0/24 is directly connected, GigabitEthernet0/0
L        10.1.25.5/32 is directly connected, GigabitEthernet0/0
RT5#
RT6#sh ip route | b Gate
Gateway of last resort is not set

      1.0.0.0/32 is subnetted, 1 subnets
B        1.1.1.1 [20/0] via 10.1.46.4, 00:21:10
      2.0.0.0/32 is subnetted, 1 subnets
B        2.2.2.2 [20/0] via 10.1.46.4, 00:21:10
      3.0.0.0/32 is subnetted, 1 subnets
B        3.3.3.3 [20/0] via 10.1.46.4, 00:21:10
      4.0.0.0/32 is subnetted, 1 subnets
B        4.4.4.4 [20/0] via 10.1.46.4, 00:21:10
      5.0.0.0/32 is subnetted, 1 subnets
B        5.5.5.5 [20/0] via 10.1.46.4, 00:21:10
      6.0.0.0/32 is subnetted, 1 subnets
C        6.6.6.6 is directly connected, Loopback0
      10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        10.1.46.0/24 is directly connected, GigabitEthernet0/0
L        10.1.46.6/32 is directly connected, GigabitEthernet0/0
RT6#

※上記構成の場合、pingで外部AS間の疎通確認をする際には、souce loopback 0がないとpingが通らないので注意

RT1#ping 5.5.5.5
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 5.5.5.5, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)
RT1#
RT1#ping 5.5.5.5 source loopback 0
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 5.5.5.5, timeout is 2 seconds:
Packet sent with a source address of 1.1.1.1 
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 3/3/4 ms
RT1#

5.まとめと考察

全3回でBGP Confederationの構築と検証を行い、Confederation内での見え方と外部からの見え方の二点を中心に確認しました。
iBGPピア数を減らす技術には、ルートリフレクタ(RR)がありますが、もともと別々のASを統合し、かつ、フルメッシュ構成にするケースでは、RRよりも(個人的には)シンプルに対応できる技術だと思いました。

疑問点として、BGP Confederationを使用してMPLS VPNを構築した場合のラベルスタックの挙動が気になりました。
この辺りはinter-AS MPLS VPNを勉強してから、改めて検証してみたいですね。

BGP Confederationの確認

こんにちは!
今回は、前回構築した『BGP Confederation』を使用したNWの状態を確認していきます。
◆前回記事
shirase96476559.hatenablog.com


1.構成図と設計(再掲)
下記の通りでした。

2.BGPテーブル
まずはRT1~6のBGPテーブルを見てみます。
Pathの欄には、括弧表記がありますが、これがBGP Confederation内部では経由してきたサブASであることを意味します。

RT1#sh ip bgp
BGP table version is 9, 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
 r>i  2.2.2.2/32       2.2.2.2                  0    100      0 i
 r>i  3.3.3.3/32       3.3.3.3                  0    100      0 i
 r>i  4.4.4.4/32       2.2.2.2                  0    100      0 (456) i
 r>i  5.5.5.5/32       3.3.3.3                  0    100      0 (456) i
 r>i  6.6.6.6/32       2.2.2.2                  0    100      0 (456) i
 *>i  7.7.7.7/32       2.2.2.2                  0    100      0 ?
 *>i  8.8.8.8/32       2.2.2.2                  0    100      0 (456) ?
RT2#sh ip bgp
BGP table version is 11, local router ID is 2.2.2.2
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  1.1.1.1/32       1.1.1.1                  0    100      0 i
 *>   2.2.2.2/32       0.0.0.0                  0         32768 i
 r>i  3.3.3.3/32       3.3.3.3                  0    100      0 i
 r>   4.4.4.4/32       4.4.4.4                  0    100      0 (456) i
 r    5.5.5.5/32       4.4.4.4                  0    100      0 (456) i
 r>i                   3.3.3.3                  0    100      0 (456) i
 r>   6.6.6.6/32       4.4.4.4                  0    100      0 (456) i
 *>   7.7.7.7/32       10.1.27.7                0         32768 ?
 *>   8.8.8.8/32       4.4.4.4                  0    100      0 (456) ?
RT3#sh ip bgp
BGP table version is 9, local router ID is 3.3.3.3
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  1.1.1.1/32       1.1.1.1                  0    100      0 i
 r>i  2.2.2.2/32       2.2.2.2                  0    100      0 i
 *>   3.3.3.3/32       0.0.0.0                  0         32768 i
 r    4.4.4.4/32       5.5.5.5                  0    100      0 (456) i
 r>i                   2.2.2.2                  0    100      0 (456) i
 r>   5.5.5.5/32       5.5.5.5                  0    100      0 (456) i
 r    6.6.6.6/32       5.5.5.5                  0    100      0 (456) i
 r>i                   2.2.2.2                  0    100      0 (456) i
 *>i  7.7.7.7/32       2.2.2.2                  0    100      0 ?
 *    8.8.8.8/32       5.5.5.5                  0    100      0 (456) ?
 *>i                   2.2.2.2                  0    100      0 (456) ?
RT4#sh ip bgp
BGP table version is 13, local router ID is 4.4.4.4
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  1.1.1.1/32       5.5.5.5                  0    100      0 (123) i
 r>                    2.2.2.2                  0    100      0 (123) i
 r i  2.2.2.2/32       5.5.5.5                  0    100      0 (123) i
 r>                    2.2.2.2                  0    100      0 (123) i
 r i  3.3.3.3/32       5.5.5.5                  0    100      0 (123) i
 r>                    2.2.2.2                  0    100      0 (123) i
 *>   4.4.4.4/32       0.0.0.0                  0         32768 i
 r>i  5.5.5.5/32       5.5.5.5                  0    100      0 i
 r>i  6.6.6.6/32       6.6.6.6                  0    100      0 i
 * i  7.7.7.7/32       5.5.5.5                  0    100      0 (123) ?
 *>                    2.2.2.2                  0    100      0 (123) ?
 *>i  8.8.8.8/32       6.6.6.6                  0    100      0 ?
RT5#sh ip bgp
BGP table version is 13, local router ID is 5.5.5.5
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  1.1.1.1/32       4.4.4.4                  0    100      0 (123) i
 r>                    3.3.3.3                  0    100      0 (123) i
 r i  2.2.2.2/32       4.4.4.4                  0    100      0 (123) i
 r>                    3.3.3.3                  0    100      0 (123) i
 r i  3.3.3.3/32       4.4.4.4                  0    100      0 (123) i
 r>                    3.3.3.3                  0    100      0 (123) i
 r>i  4.4.4.4/32       4.4.4.4                  0    100      0 i
 *>   5.5.5.5/32       0.0.0.0                  0         32768 i
 r>i  6.6.6.6/32       6.6.6.6                  0    100      0 i
 * i  7.7.7.7/32       4.4.4.4                  0    100      0 (123) ?
 *>                    3.3.3.3                  0    100      0 (123) ?
 *>i  8.8.8.8/32       6.6.6.6                  0    100      0 ?
RT6#sh ip bgp
BGP table version is 11, local router ID is 6.6.6.6
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  1.1.1.1/32       5.5.5.5                  0    100      0 (123) i
 r>i                   4.4.4.4                  0    100      0 (123) i
 r i  2.2.2.2/32       5.5.5.5                  0    100      0 (123) i
 r>i                   4.4.4.4                  0    100      0 (123) i
 r>i  3.3.3.3/32       4.4.4.4                  0    100      0 (123) i
 r i                   5.5.5.5                  0    100      0 (123) i
 r>i  4.4.4.4/32       4.4.4.4                  0    100      0 i
 r>i  5.5.5.5/32       5.5.5.5                  0    100      0 i
 *>   6.6.6.6/32       0.0.0.0                  0         32768 i
 * i  7.7.7.7/32       5.5.5.5                  0    100      0 (123) ?
 *>i                   4.4.4.4                  0    100      0 (123) ?
 *>   8.8.8.8/32       10.1.68.8                0         32768 ?

ここで一つ疑問が出てきます。
例えば、RT3の下記部分。対向サブASからの経路ですが、学習プロトコルはeBGPでしょうか?iBGPでしょうか?

 r    6.6.6.6/32       5.5.5.5                  0    100      0 (456) i
 r>i                   2.2.2.2                  0    100      0 (456) i

3.ルーティングテーブル
正解はiBGPです。(そもそもBGP Cenfederationの目的がiBGPピア数を減らすことなので当然と言われれば当然ですね)
ルーティングテーブルを見てみます。
注目すべきは、対向AS側のループバックのプロトコルを見るとOSPFとなっていることです。
見た目やコンフィグにはeBGPで学習していそうですが、OSPFがベストになっていることから、AD値から逆算して考えるとiBGPで学習したと考えることができます。(AD値:eBGP=20,OSPF=110,iBGP=200)

RT1#sh ip route | b Gate
Gateway of last resort is not set

      1.0.0.0/32 is subnetted, 1 subnets
C        1.1.1.1 is directly connected, Loopback0
      2.0.0.0/32 is subnetted, 1 subnets
O        2.2.2.2 [110/2] via 10.1.12.2, 00:33:09, GigabitEthernet0/0
      3.0.0.0/32 is subnetted, 1 subnets
O        3.3.3.3 [110/2] via 10.1.13.3, 00:32:10, GigabitEthernet0/1
      4.0.0.0/32 is subnetted, 1 subnets
O        4.4.4.4 [110/3] via 10.1.12.2, 00:30:51, GigabitEthernet0/0
      5.0.0.0/32 is subnetted, 1 subnets
O        5.5.5.5 [110/3] via 10.1.13.3, 00:30:27, GigabitEthernet0/1
      6.0.0.0/32 is subnetted, 1 subnets
O        6.6.6.6 [110/4] via 10.1.13.3, 00:29:35, GigabitEthernet0/1
                 [110/4] via 10.1.12.2, 00:29:35, GigabitEthernet0/0
      7.0.0.0/32 is subnetted, 1 subnets
B        7.7.7.7 [200/0] via 2.2.2.2, 00:18:44
      8.0.0.0/32 is subnetted, 1 subnets
B        8.8.8.8 [200/0] via 2.2.2.2, 00:16:03
      10.0.0.0/8 is variably subnetted, 10 subnets, 2 masks
C        10.1.12.0/24 is directly connected, GigabitEthernet0/0
L        10.1.12.1/32 is directly connected, GigabitEthernet0/0
C        10.1.13.0/24 is directly connected, GigabitEthernet0/1
L        10.1.13.1/32 is directly connected, GigabitEthernet0/1
O        10.1.23.0/24 [110/2] via 10.1.13.3, 00:32:00, GigabitEthernet0/1
                      [110/2] via 10.1.12.2, 00:33:09, GigabitEthernet0/0
O        10.1.24.0/24 [110/2] via 10.1.12.2, 00:33:09, GigabitEthernet0/0
O        10.1.35.0/24 [110/2] via 10.1.13.3, 00:32:10, GigabitEthernet0/1
O        10.1.45.0/24 [110/3] via 10.1.13.3, 00:30:17, GigabitEthernet0/1
                      [110/3] via 10.1.12.2, 00:30:51, GigabitEthernet0/0
O        10.1.46.0/24 [110/3] via 10.1.12.2, 00:30:51, GigabitEthernet0/0
O        10.1.56.0/24 [110/3] via 10.1.13.3, 00:30:27, GigabitEthernet0/1
RT2#sh ip route | b Gate
Gateway of last resort is not set

      1.0.0.0/32 is subnetted, 1 subnets
O        1.1.1.1 [110/2] via 10.1.12.1, 00:34:39, GigabitEthernet0/0
      2.0.0.0/32 is subnetted, 1 subnets
C        2.2.2.2 is directly connected, Loopback0
      3.0.0.0/32 is subnetted, 1 subnets
O        3.3.3.3 [110/2] via 10.1.23.3, 00:33:34, GigabitEthernet0/1
      4.0.0.0/32 is subnetted, 1 subnets
O        4.4.4.4 [110/2] via 10.1.24.4, 00:32:35, GigabitEthernet0/2
      5.0.0.0/32 is subnetted, 1 subnets
O        5.5.5.5 [110/3] via 10.1.24.4, 00:31:51, GigabitEthernet0/2
                 [110/3] via 10.1.23.3, 00:32:01, GigabitEthernet0/1
      6.0.0.0/32 is subnetted, 1 subnets
O        6.6.6.6 [110/3] via 10.1.24.4, 00:31:09, GigabitEthernet0/2
      7.0.0.0/32 is subnetted, 1 subnets
S        7.7.7.7 [1/0] via 10.1.27.7
      8.0.0.0/32 is subnetted, 1 subnets
B        8.8.8.8 [200/0] via 4.4.4.4, 00:09:11
      10.0.0.0/8 is variably subnetted, 13 subnets, 2 masks
C        10.1.12.0/24 is directly connected, GigabitEthernet0/0
L        10.1.12.2/32 is directly connected, GigabitEthernet0/0
O        10.1.13.0/24 [110/2] via 10.1.23.3, 00:33:34, GigabitEthernet0/1
                      [110/2] via 10.1.12.1, 00:34:39, GigabitEthernet0/0
C        10.1.23.0/24 is directly connected, GigabitEthernet0/1
L        10.1.23.2/32 is directly connected, GigabitEthernet0/1
C        10.1.24.0/24 is directly connected, GigabitEthernet0/2
L        10.1.24.2/32 is directly connected, GigabitEthernet0/2
C        10.1.27.0/24 is directly connected, GigabitEthernet0/3
L        10.1.27.2/32 is directly connected, GigabitEthernet0/3
O        10.1.35.0/24 [110/2] via 10.1.23.3, 00:33:34, GigabitEthernet0/1
O        10.1.45.0/24 [110/2] via 10.1.24.4, 00:32:35, GigabitEthernet0/2
O        10.1.46.0/24 [110/2] via 10.1.24.4, 00:32:35, GigabitEthernet0/2
O        10.1.56.0/24 [110/3] via 10.1.24.4, 00:31:51, GigabitEthernet0/2
                      [110/3] via 10.1.23.3, 00:32:01, GigabitEthernet0/1
RT3#sh ip route | b Gate
Gateway of last resort is not set

      1.0.0.0/32 is subnetted, 1 subnets
O        1.1.1.1 [110/2] via 10.1.13.1, 00:41:07, GigabitEthernet0/0
      2.0.0.0/32 is subnetted, 1 subnets
O        2.2.2.2 [110/2] via 10.1.23.2, 00:40:57, GigabitEthernet0/1
      3.0.0.0/32 is subnetted, 1 subnets
C        3.3.3.3 is directly connected, Loopback0
      4.0.0.0/32 is subnetted, 1 subnets
O        4.4.4.4 [110/3] via 10.1.35.5, 00:39:11, GigabitEthernet0/2
                 [110/3] via 10.1.23.2, 00:39:45, GigabitEthernet0/1
      5.0.0.0/32 is subnetted, 1 subnets
O        5.5.5.5 [110/2] via 10.1.35.5, 00:39:21, GigabitEthernet0/2
      6.0.0.0/32 is subnetted, 1 subnets
O        6.6.6.6 [110/3] via 10.1.35.5, 00:38:28, GigabitEthernet0/2
      7.0.0.0/32 is subnetted, 1 subnets
B        7.7.7.7 [200/0] via 2.2.2.2, 00:27:37
      8.0.0.0/32 is subnetted, 1 subnets
B        8.8.8.8 [200/0] via 2.2.2.2, 00:24:56
      10.0.0.0/8 is variably subnetted, 11 subnets, 2 masks
O        10.1.12.0/24 [110/2] via 10.1.23.2, 00:40:57, GigabitEthernet0/1
                      [110/2] via 10.1.13.1, 00:41:07, GigabitEthernet0/0
C        10.1.13.0/24 is directly connected, GigabitEthernet0/0
L        10.1.13.3/32 is directly connected, GigabitEthernet0/0
C        10.1.23.0/24 is directly connected, GigabitEthernet0/1
L        10.1.23.3/32 is directly connected, GigabitEthernet0/1
O        10.1.24.0/24 [110/2] via 10.1.23.2, 00:40:57, GigabitEthernet0/1
C        10.1.35.0/24 is directly connected, GigabitEthernet0/2
L        10.1.35.3/32 is directly connected, GigabitEthernet0/2
O        10.1.45.0/24 [110/2] via 10.1.35.5, 00:39:11, GigabitEthernet0/2
O        10.1.46.0/24 [110/3] via 10.1.35.5, 00:39:11, GigabitEthernet0/2
                      [110/3] via 10.1.23.2, 00:39:45, GigabitEthernet0/1
O        10.1.56.0/24 [110/2] via 10.1.35.5, 00:39:21, GigabitEthernet0/2
RT4#sh ip route | B b Gate
Gateway of last resort is not set

      1.0.0.0/32 is subnetted, 1 subnets
O        1.1.1.1 [110/3] via 10.1.24.2, 00:35:20, GigabitEthernet0/0
      2.0.0.0/32 is subnetted, 1 subnets
O        2.2.2.2 [110/2] via 10.1.24.2, 00:35:20, GigabitEthernet0/0
      3.0.0.0/32 is subnetted, 1 subnets
O        3.3.3.3 [110/3] via 10.1.45.5, 00:34:38, GigabitEthernet0/1
                 [110/3] via 10.1.24.2, 00:35:20, GigabitEthernet0/0
      4.0.0.0/32 is subnetted, 1 subnets
C        4.4.4.4 is directly connected, Loopback0
      5.0.0.0/32 is subnetted, 1 subnets
O        5.5.5.5 [110/2] via 10.1.45.5, 00:34:38, GigabitEthernet0/1
      6.0.0.0/32 is subnetted, 1 subnets
O        6.6.6.6 [110/2] via 10.1.46.6, 00:33:54, GigabitEthernet0/2
      7.0.0.0/32 is subnetted, 1 subnets
B        7.7.7.7 [200/0] via 2.2.2.2, 00:20:52
      8.0.0.0/32 is subnetted, 1 subnets
B        8.8.8.8 [200/0] via 6.6.6.6, 00:20:22
      10.0.0.0/8 is variably subnetted, 11 subnets, 2 masks
O        10.1.12.0/24 [110/2] via 10.1.24.2, 00:35:20, GigabitEthernet0/0
O        10.1.13.0/24 [110/3] via 10.1.45.5, 00:34:38, GigabitEthernet0/1
                      [110/3] via 10.1.24.2, 00:35:20, GigabitEthernet0/0
O        10.1.23.0/24 [110/2] via 10.1.24.2, 00:35:20, GigabitEthernet0/0
C        10.1.24.0/24 is directly connected, GigabitEthernet0/0
L        10.1.24.4/32 is directly connected, GigabitEthernet0/0
O        10.1.35.0/24 [110/2] via 10.1.45.5, 00:34:38, GigabitEthernet0/1
C        10.1.45.0/24 is directly connected, GigabitEthernet0/1
L        10.1.45.4/32 is directly connected, GigabitEthernet0/1
C        10.1.46.0/24 is directly connected, GigabitEthernet0/2
L        10.1.46.4/32 is directly connected, GigabitEthernet0/2
O        10.1.56.0/24 [110/2] via 10.1.46.6, 00:33:54, GigabitEthernet0/2
                      [110/2] via 10.1.45.5, 00:34:38, GigabitEthernet0/1
RT5#sh ip route | b Gate
Gateway of last resort is not set

      1.0.0.0/32 is subnetted, 1 subnets
O        1.1.1.1 [110/3] via 10.1.35.3, 00:37:56, GigabitEthernet0/0
      2.0.0.0/32 is subnetted, 1 subnets
O        2.2.2.2 [110/3] via 10.1.45.4, 00:37:46, GigabitEthernet0/1
                 [110/3] via 10.1.35.3, 00:37:56, GigabitEthernet0/0
      3.0.0.0/32 is subnetted, 1 subnets
O        3.3.3.3 [110/2] via 10.1.35.3, 00:37:56, GigabitEthernet0/0
      4.0.0.0/32 is subnetted, 1 subnets
O        4.4.4.4 [110/2] via 10.1.45.4, 00:37:46, GigabitEthernet0/1
      5.0.0.0/32 is subnetted, 1 subnets
C        5.5.5.5 is directly connected, Loopback0
      6.0.0.0/32 is subnetted, 1 subnets
O        6.6.6.6 [110/2] via 10.1.56.6, 00:36:59, GigabitEthernet0/2
      7.0.0.0/32 is subnetted, 1 subnets
B        7.7.7.7 [200/0] via 3.3.3.3, 00:21:39
      8.0.0.0/32 is subnetted, 1 subnets
B        8.8.8.8 [200/0] via 6.6.6.6, 00:22:57
      10.0.0.0/8 is variably subnetted, 11 subnets, 2 masks
O        10.1.12.0/24 [110/3] via 10.1.45.4, 00:37:46, GigabitEthernet0/1
                      [110/3] via 10.1.35.3, 00:37:56, GigabitEthernet0/0
O        10.1.13.0/24 [110/2] via 10.1.35.3, 00:37:56, GigabitEthernet0/0
O        10.1.23.0/24 [110/2] via 10.1.35.3, 00:37:56, GigabitEthernet0/0
O        10.1.24.0/24 [110/2] via 10.1.45.4, 00:37:46, GigabitEthernet0/1
C        10.1.35.0/24 is directly connected, GigabitEthernet0/0
L        10.1.35.5/32 is directly connected, GigabitEthernet0/0
C        10.1.45.0/24 is directly connected, GigabitEthernet0/1
L        10.1.45.5/32 is directly connected, GigabitEthernet0/1
O        10.1.46.0/24 [110/2] via 10.1.56.6, 00:36:59, GigabitEthernet0/2
                      [110/2] via 10.1.45.4, 00:37:46, GigabitEthernet0/1
C        10.1.56.0/24 is directly connected, GigabitEthernet0/2
L        10.1.56.5/32 is directly connected, GigabitEthernet0/2
RT6#sh ip route | b Gate
Gateway of last resort is not set

      1.0.0.0/32 is subnetted, 1 subnets
O        1.1.1.1 [110/4] via 10.1.56.5, 00:35:17, GigabitEthernet0/1
                 [110/4] via 10.1.46.4, 00:35:17, GigabitEthernet0/0
      2.0.0.0/32 is subnetted, 1 subnets
O        2.2.2.2 [110/3] via 10.1.46.4, 00:35:17, GigabitEthernet0/0
      3.0.0.0/32 is subnetted, 1 subnets
O        3.3.3.3 [110/3] via 10.1.56.5, 00:35:17, GigabitEthernet0/1
      4.0.0.0/32 is subnetted, 1 subnets
O        4.4.4.4 [110/2] via 10.1.46.4, 00:35:17, GigabitEthernet0/0
      5.0.0.0/32 is subnetted, 1 subnets
O        5.5.5.5 [110/2] via 10.1.56.5, 00:35:17, GigabitEthernet0/1
      6.0.0.0/32 is subnetted, 1 subnets
C        6.6.6.6 is directly connected, Loopback0
      7.0.0.0/32 is subnetted, 1 subnets
B        7.7.7.7 [200/0] via 4.4.4.4, 00:22:20
      8.0.0.0/32 is subnetted, 1 subnets
S        8.8.8.8 [1/0] via 10.1.68.8
      10.0.0.0/8 is variably subnetted, 12 subnets, 2 masks
O        10.1.12.0/24 [110/3] via 10.1.46.4, 00:35:17, GigabitEthernet0/0
O        10.1.13.0/24 [110/3] via 10.1.56.5, 00:35:17, GigabitEthernet0/1
O        10.1.23.0/24 [110/3] via 10.1.56.5, 00:35:17, GigabitEthernet0/1
                      [110/3] via 10.1.46.4, 00:35:17, GigabitEthernet0/0
O        10.1.24.0/24 [110/2] via 10.1.46.4, 00:35:17, GigabitEthernet0/0
O        10.1.35.0/24 [110/2] via 10.1.56.5, 00:35:17, GigabitEthernet0/1
O        10.1.45.0/24 [110/2] via 10.1.56.5, 00:35:17, GigabitEthernet0/1
                      [110/2] via 10.1.46.4, 00:35:17, GigabitEthernet0/0
C        10.1.46.0/24 is directly connected, GigabitEthernet0/0
L        10.1.46.6/32 is directly connected, GigabitEthernet0/0
C        10.1.56.0/24 is directly connected, GigabitEthernet0/1
L        10.1.56.6/32 is directly connected, GigabitEthernet0/1
C        10.1.68.0/24 is directly connected, GigabitEthernet0/2
L        10.1.68.6/32 is directly connected, GigabitEthernet0/2
RT7#sh ru  ip route | b Gate
Gateway of last resort is 10.1.27.2 to network 0.0.0.0

S*    0.0.0.0/0 [1/0] via 10.1.27.2
      7.0.0.0/32 is subnetted, 1 subnets
C        7.7.7.7 is directly connected, Loopback0
      10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        10.1.27.0/24 is directly connected, GigabitEthernet0/0
L        10.1.27.7/32 is directly connected, GigabitEthernet0/0
RT8#sh ip route | b Gate
Gateway of last resort is 10.1.68.6 to network 0.0.0.0

S*    0.0.0.0/0 [1/0] via 10.1.68.6
      8.0.0.0/32 is subnetted, 1 subnets
C        8.8.8.8 is directly connected, Loopback0
      10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        10.1.68.0/24 is directly connected, GigabitEthernet0/0
L        10.1.68.8/32 is directly connected, GigabitEthernet0/0

※ちなみに、RT7やRT8から他のRTにping確認する場合は、souce loopback 0をつけてください。


5.まとめ
BGP Confederation構成のNWを構築し、BGPテーブルとルーティングテーブルをピックアップしてみました。
BGP Confederationの特徴は下記の通り。

 ・ピアリング数を減らすことができる
 ・BGP Confederation内部はiBGPで学習している

さて、これで終わりとしたいですが、まだ確認すべきことがあります。
外部ASから見たときは?

次回は、このテーマで検証をしていきたいと思います。

BGP Confederationの構築



こんにちは!
今回は『BGP Confederation』を使用したNWを構築したので、そのレポートです。

1.『BGP Confederation』特徴

iBGPはルーティングループ防止のため、iBGPで学習した経路をほかのピアに広告しない、というスプリットホライズン機能が働きます。
そのため、BGPルータの数が多いAS内においてフルメッシュでピアリングしようとすると、その数は膨大となり設定も管理も大変です。

BGP Confederationは、サブASという小さなASが集まって一つのASを構成することによりピア数を減らすことが可能な技術です。

2.構成図と設計

今回は、下記の構成で構築しました。

サブAS123(RT1~3)とサブAS456(RT4~6)によってAS1000を構成しています。
※検証構成のためAS番号は適当ですが、サブASにはプライベートAS番号を使用し、外部に流れないようにすることが一般的なようです。

3.構築1 サブASを作る

まずは、BGP Confederationの設定前までを設定してみます。
特別込み入ったコンフィグではありませんが、注意点としては、
   router bgp <サブAS番号>
となることです。

hostname RT1
!
interface GigabitEthernet0/0
 ip add 10.1.12.1 255.255.255.0
 no shutdown
!
interface GigabitEthernet0/1
 ip add 10.1.13.1 255.255.255.0
 no shutdown
!
int loopback 0
 ip add 1.1.1.1 255.255.255.255
!
router ospf 1
 network 10.1.12.0 0.0.0.255 area 0
 network 10.1.13.0 0.0.0.255 area 0 
 network 1.1.1.1 0.0.0.0 area 0
 passive-interface loopback0
!
router bgp 123
 neighbor AS123 peer-group
 neighbor AS123 remote-as 123
 neighbor AS123 update-source Loopback0
 neighbor 2.2.2.2 peer-group AS123
 neighbor 3.3.3.3 peer-group AS123
 network 1.1.1.1 mask 255.255.255.255
hostname RT2
!
interface GigabitEthernet0/0
  ip address 10.1.12.2 255.255.255.0
 no shutdown
!
interface GigabitEthernet0/1
 ip address 10.1.23.2 255.255.255.0
 no shutdown
!
interface GigabitEthernet0/2
 ip address 10.1.24.2 255.255.255.0
 no shutdown
!
interface GigabitEthernet0/3
 ip address 10.1.27.2 255.255.255.0
 no shutdown
!
int loopback 0
 ip add 2.2.2.2 255.255.255.255
!
router ospf 1
 network 10.1.12.0 0.0.0.255 area 0
 network 10.1.23.0 0.0.0.255 area 0 
 network 10.1.24.0 0.0.0.255 area 0
 network 2.2.2.2 0.0.0.0 area 0
 passive-interface loopback0
!
router bgp 123
 neighbor AS123 peer-group
 neighbor AS123 remote-as 123
 neighbor AS123 update-source Loopback0
 neighbor AS123 next-hop-self
 neighbor 1.1.1.1 peer-group AS123
 neighbor 3.3.3.3 peer-group AS123
 network 2.2.2.2 mask 255.255.255.255
 redistribute static
!
ip route 7.7.7.7 255.255.255.255 10.1.27.7
!
hostname RT3
!
interface GigabitEthernet0/0
 ip add 10.1.13.3 255.255.255.0
 no shutdown
!
interface GigabitEthernet0/1
 ip add 10.1.23.3 255.255.255.0
 no shutdown
!
interface GigabitEthernet0/2
 ip add 10.1.35.3 255.255.255.0
 no shutdown
!
int loopback 0
 ip add 3.3.3.3 255.255.255.255
!
router ospf 1
 network 10.1.13.0 0.0.0.255 area 0
 network 10.1.23.0 0.0.0.255 area 0 
 network 10.1.35.0 0.0.0.255 area 0
 network 3.3.3.3 0.0.0.0 area 0
 passive-interface loopback0
!
router bgp 123
 neighbor AS123 peer-group
 neighbor AS123 remote-as 123
 neighbor AS123 update-source Loopback0
 neighbor 1.1.1.1 peer-group AS123
 neighbor 2.2.2.2 peer-group AS123
 network 3.3.3.3 mask 255.255.255.255
hostname RT4
!
interface GigabitEthernet0/0
 ip add 10.1.24.4 255.255.255.0
 no shutdown
!
interface GigabitEthernet0/1
 ip add 10.1.45.4 255.255.255.0
 no shutdown
!
interface GigabitEthernet0/2
 ip add 10.1.46.4 255.255.255.0
 no shutdown
!
int loopback 0
 ip add 4.4.4.4 255.255.255.255
!
router ospf 1
 network 10.1.24.0 0.0.0.255 area 0
 network 10.1.45.0 0.0.0.255 area 0 
 network 10.1.46.0 0.0.0.255 area 0
 network 4.4.4.4 0.0.0.0 area 0
 passive-interface loopback0
!
router bgp 456
 neighbor AS456 peer-group
 neighbor AS456 remote-as 456
 neighbor AS456 update-source Loopback0
 neighbor 5.5.5.5 peer-group AS456
 neighbor 6.6.6.6 peer-group AS456
 network 4.4.4.4 mask 255.255.255.255
hostname RT5
!
interface GigabitEthernet0/0
 ip add 10.1.35.5 255.255.255.0
 no shutdown
!
interface GigabitEthernet0/1
 ip add 10.1.45.5 255.255.255.0
 no shutdown
!
interface GigabitEthernet0/2
 ip add 10.1.56.5 255.255.255.0
 no shutdown
!
int loopback 0
 ip add 5.5.5.5 255.255.255.255
!
router ospf 1
 network 10.1.35.0 0.0.0.255 area 0
 network 10.1.45.0 0.0.0.255 area 0 
 network 10.1.56.0 0.0.0.255 area 0
 network 5.5.5.5 0.0.0.0 area 0
 passive-interface loopback0
!
router bgp 456
 neighbor AS456 peer-group
 neighbor AS456 remote-as 456
 neighbor AS456 update-source Loopback0
 neighbor 4.4.4.4 peer-group AS456
 neighbor 6.6.6.6 peer-group AS456
 network 5.5.5.5 mask 255.255.255.255
hostname RT6
!
interface GigabitEthernet0/0
 ip add 10.1.46.6 255.255.255.0
 no shutdown
!
interface GigabitEthernet0/1
 ip add 10.1.56.6 255.255.255.0
 no shutdown
!
interface GigabitEthernet0/2
 ip add 10.1.68.6 255.255.255.0
 no shutdown
!
int loopback 0
 ip add 6.6.6.6 255.255.255.255
!
router ospf 1
 network 10.1.46.0 0.0.0.255 area 0 
 network 10.1.56.0 0.0.0.255 area 0
 network 6.6.6.6 0.0.0.0 area 0
 passive-interface loopback0
!
router bgp 456
 neighbor AS456 peer-group
 neighbor AS456 remote-as 456
 neighbor AS456 update-source Loopback0
 neighbor AS456 next-hop-self
 neighbor 4.4.4.4 peer-group AS456
 neighbor 5.5.5.5 peer-group AS456
 network 6.6.6.6 mask 255.255.255.255
 redistribute static
!
ip route 8.8.8.8 255.255.255.255 10.1.68.8
hostname RT7
!
interface GigabitEthernet0/0
 ip add 10.1.27.7 255.255.255.0
 no shutdown
!
int loopback 0
 ip add 7.7.7.7 255.255.255.255
!
ip route 0.0.0.0 0.0.0.0 10.1.27.2
hostname RT8
!
interface GigabitEthernet0/0
 ip add 10.1.68.8 255.255.255.0
 no shutdown
!
int loopback 0
 ip add 8.8.8.8 255.255.255.255
!
ip route 0.0.0.0 0.0.0.0 10.1.68.6

4.構築2 BGP Confederation設定

それでは本題のBGP Confederationの設定を投入します。
フォーマットは下記の通りです。
router bgp <サブAS>
 bgp confederation identifier   #共通
 bgp confederation peers <対向のサブAS>  #サブAS間のASBR

また、サブASのASBR間はeBGPピアとなるため、RT2~5ではeBGP関連の設定も追加します。

#RT1
router bgp 123
 bgp confederation identifier 1000
#RT2
router bgp 123
 bgp confederation identifier 1000
 bgp confederation peers 456
 neighbor 4.4.4.4 remote-as 456
 neighbor 4.4.4.4 update-source loopback 0
 neighbor 4.4.4.4 next-hop-self
 neighbor 4.4.4.4 ebgp-multihop
#RT3
router bgp 123
 bgp confederation identifier 1000
 bgp confederation peers 456
 neighbor AS123 next-hop-self
 neighbor 5.5.5.5 remote-as 456
 neighbor 5.5.5.5 update-source loopback 0
 neighbor 5.5.5.5 next-hop-self
 neighbor 5.5.5.5 ebgp-multihop
#RT4
router bgp 456
 bgp confederation identifier 1000
 bgp confederation peers 123
 neighbor AS456 next-hop-self
 neighbor 2.2.2.2 remote-as 123
 neighbor 2.2.2.2 update-source loopback 0
 neighbor 2.2.2.2 next-hop-self
 neighbor 2.2.2.2 ebgp-multihop
#RT5
router bgp 456
 bgp confederation identifier 1000
 bgp confederation peers 123
 neighbor AS456 next-hop-self
 neighbor 3.3.3.3 remote-as 123
 neighbor 3.3.3.3 update-source loopback 0
 neighbor 3.3.3.3 next-hop-self
 neighbor 3.3.3.3 ebgp-multihop
#RT6
router bgp 456
 bgp confederation identifier 1000

5.まとめ次回

以上で、BGP Confederation構築に必要なコンフィグの投入は完了です。
次回は今回構築した構成の状態確認をしていきます。
shirase96476559.hatenablog.com