BGPルートの生成(経路集約 その1)

ここでは、BGPで経路情報を集約して通知させる方法を紹介します。

まずは、ネットワークをBGPで構築します。

 ここでは、まだ、経路集約に関しての設定は行いません。

 Router_Aにて、ループバックアドレスを4つ割り当てます。この割り当てたネットワークは、経路集約に使用します。

使用するネットワークは、下図になります。

それでは、各ルータを設定していきます。

各ルータの設定は、次のようになります。

●Router_Aの設定

!
version 11.2
no service udp-small-servers
no service tcp-small-servers
!
hostname Router_A
!
enable password cisco
!
ip subnet-zero
!
interface Loopback0
 ip address 192.168.4.1 255.255.255.0
!
interface Loopback1
 ip address 192.168.5.1 255.255.255.0
!
interface Loopback2
 ip address 192.168.6.1 255.255.255.0
!
interface Loopback3
 ip address 192.168.7.1 255.255.255.0
!
interface Serial0
 ip address 172.16.0.1 255.255.0.0
 clockrate 64000
!
router bgp 100
 no synchronization
 network 192.168.4.0
 network 192.168.5.0
 network 192.168.6.0
 network 192.168.7.0
 neighbor 172.16.0.2 remote-as 200
 no auto-summary
!
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
!
ip subnet-zero
!
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 bgp 200
 no synchronization
 neighbor 172.16.0.1 remote-as 100
 neighbor 172.17.0.2 remote-as 200
 neighbor 172.17.0.2 next-hop-self
 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
!
ip subnet-zero
!
interface Serial0
 ip address 172.17.0.2 255.255.0.0
!
router bgp 200
 no synchronization
 neighbor 172.17.0.1 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のルーティングテーブルを確認してみます。

Gateway of last resort is not set

B    192.168.4.0/24 [200/0] via 172.17.0.1, 00:00:05
B    192.168.5.0/24 [200/0] via 172.17.0.1, 00:00:06
B    192.168.6.0/24 [200/0] via 172.17.0.1, 00:00:06
B    192.168.7.0/24 [200/0] via 172.17.0.1, 00:00:06
C    172.17.0.0/16 is directly connected, Serial0

 AS100の「192.168.4.0/24」、「192.168.5.0/24」、「192.168.6.0/24」、「192.168.7.0/24」の経路情報がありますね。

それでは、これらの経路情報をRouter_Bで、「192.168.4.0/22」に集約して通知するように設定していきます。

AS100の経路集約経路
192.168.4.0/24
192.168.5.0/24
192.168.6.0/24
192.168.7.0/24
192.168.4.0/22

経路集約の設定

 BGPで経路集約の設定を行うには、ルーティングコンフィグレーションモードで、「aggregate-address」コマンドを使用します。

コマンドは、以下のようになります。

Router(config-router)#aggregate-address {network} {mask} {オプション}

この続きは、「BGPルートの生成(経路集約 その2)」で紹介します。