BGPルートの生成(IGPから再配送 その1)
動的にBGPへ経路を注入する方法には、IGPからBGPへ経路を再配送させる方法があります。
たくさんの経路をBGPへ注入するのであれば、IGPから再配送するこの方法が楽な方法です。
経路を再配送するには、ルータコンフィグレーションモードで以下のコマンドで設定します。
Router(config)#router {protocol1}
Router(config-router)#redistribute {protocol2}
protocol1 : 再配送先(再配送に使うプロトコル)
protocol2 : 再配送元
「protocol2」で取得したルートを「protocol1」で再配送する。
※ルーティングプロトコルによって「protocol1」「protocol2」の後の指定の仕方が変わってきます。
※再配布を設定する際、シードメトリックの指定を省略するとデフォルトのシードメトリック値が使われることになります。
ルートの再配送についてはこちらで説明しています。
→ 「ルート再配送(redistribute)」 こちらを参考にして下さい。
それでは、IGPの経路をBGPへ再配送させてみましょう。
使用するネットワークは、下図になります。このネットワークを使用して、IGPの経路をBGPへ再配送する検証を行います。
IGPには、EIGRPを使用することにします。

●ネットワーク構成図の補足
Router_A ・・・ EIGRPを動作。BGPは動作させません。
Router_B ・・・ EIGRP、BGPを動作させる。
Router_C ・・・ BGPを動作させる。
まずは、ルーティングの設定を行います。再配送の設定は、ルーティングの設定の確認後に行います。
また、ここでは、BGPの設定で「network」コマンドを使用して、BGPルートの生成も行いません。
各ルータのルーティングの設定
●Router_A
Router_A(config)#router eigrp 100
Router_A(config-router)#network 10.0.0.0
Router_A(config-router)#network 172.16.0.0
Router_A(config-router)#network 172.17.0.0
●Router_B
Router_B(config)#router eigrp 100
Router_B(config-router)#network 172.16.0.0
Router_B(config)#exit
Router_B(config)#router bgp 100
Router_B(config-router)#no synchronization
Router_B(config-router)#neighbor 172.17.0.2 remote-as 200
Router_B(config-router)#no auto-summary
●Router_C
Router_C(config)#router bgp 200
Router_C(config-router)#no synchronization
Router_C(config-router)#neighbor 172.17.0.1 remote-as 100
Router_C(config-router)#no auto-summary
各ルータの設定は、以下のようになります。
強制的にインターフェイスをUPさせるために、Router_A、Router_CのE0インターフェイスで「no keepalive」コマンドを設定しておきます。
●Router_Aの設定
!
version 11.2
no service udp-small-servers
no service tcp-small-servers
!
hostname Router_A
!
enable password cisco
!
interface Ethernet0
 ip address 10.10.10.1 255.255.255.0
 no keepalive
!
interface Serial0
 ip address 172.16.0.1 255.255.0.0
 clockrate 64000
!
router eigrp 100
 network 10.0.0.0
 network 172.16.0.0
!
ip classless
!
line con 0
line aux 0
line vty 0 4
 password cisco
 login
!
end
●Router_Bの設定
!
version 11.2
no service udp-small-servers
no service tcp-small-servers
!
hostname Router_B
!
enable password cisco
!
interface Serial0
 ip address 172.16.0.2 255.255.0.0
!
interface Serial1
 ip address 172.17.0.1 255.255.0.0
 clockrate 64000
!
router eigrp 100
 network 172.16.0.0
 network 172.17.0.0
!
router bgp 100
 no synchronization
 neighbor 172.17.0.2 remote-as 200
 no auto-summary
!
ip classless
!
line con 0
 exec-timeout 0 0
line aux 0
line vty 0 4
 password cisco
 login
!
end
●Router_Cの設定
!
version 11.2
no service udp-small-servers
no service tcp-small-servers
!
hostname Router_C
!
enable password cisco
!
interface Ethernet0
 ip address 20.20.20.1 255.255.255.0
 no keepalive
!
interface Serial0
 ip address 172.17.0.2 255.255.0.0
!
interface Serial1
 ip address 172.18.0.1 255.255.0.0
 clockrate 64000
!
router bgp 200
 no synchronization
 neighbor 172.17.0.1 remote-as 100
 no auto-summary
!
ip classless
!
line con 0
 exec-timeout 0 0
line aux 0
line vty 0 4
 password cisco
 login
!
end
Router_Aのルーティングテーブルを確認してみます。
Gateway of last resort is not set
     10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
D       10.0.0.0/8 is a summary, 00:00:48, Null0
C       10.10.10.0/24 is directly connected, Ethernet0
C    172.16.0.0/16 is directly connected, Serial0
D    172.17.0.0/16 [90/2681856] via 172.16.0.2, 00:00:48, Serial0
AS200の「20.20.20.0/24」のルートがありません。
Router_Bのルーティングテーブルを確認してみます。
Gateway of last resort is not set
D    10.0.0.0/8 [90/2195456] via 172.16.0.1, 00:01:16, Serial0
C    172.16.0.0/16 is directly connected, Serial0
C    172.17.0.0/16 is directly connected, Serial1
AS200の「20.20.20.0/24」のルートがありません。
Router_Cのルーティングテーブルを確認してみます。
Gateway of last resort is not set
     20.0.0.0/24 is subnetted, 1 subnets
C       20.20.20.0 is directly connected, Ethernet0
C    172.17.0.0/16 is directly connected, Serial0
AS100の「10.10.10.0/24」、「172.16.0.0」のルートがありません。
つまり、現在の状況は以下のようになっています。
・AS100のルータには、AS200の経路情報がない。
・AS200のルータには、AS100の経路情報がない。
そこで、AS100のEIGRP経路を、BGPへ再配送させ、AS200の「connected」経路をBGPへ再配送させます。
この続きは、次の「BGPルートの生成(IGPから再配送 その2)」で紹介します。
