BGP(配布リスト・distribute-list その2)

BGP(配布リスト・distribute-list その1)」の続きです。

ここでは、配布リストの設定を行う前に、下のネットワークをBGPで構築していきます。

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

●Router_Aの設定

!
version 12.0
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname Router_A
!
enable password cisco
!
ip subnet-zero
!
interface Loopback0
 ip address 10.10.10.1 255.255.255.0
!
interface Loopback1
 ip address 20.20.20.1 255.255.255.0
!
interface Serial0/0
 bandwidth 64
 ip address 172.16.0.1 255.255.0.0
 clockrate 64000
!
interface Serial0/1
 bandwidth 64
 ip address 172.17.0.1 255.255.0.0
 clockrate 64000
!
router bgp 100
 no synchronization
 network 10.10.10.0 mask 255.255.255.0
 network 20.20.20.0 mask 255.255.255.0
 neighbor 172.16.0.2 remote-as 200
 neighbor 172.17.0.2 remote-as 300
 no auto-summary
!
ip classless
!
line con 0
 exec-timeout 0 0
 transport input none
line aux 0
line vty 0 4
 password cisco
 login
!
no scheduler allocate
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 Ethernet0
 ip address 172.18.0.1 255.255.0.0
!
interface Serial0
 ip address 172.16.0.2 255.255.0.0
 bandwidth 64
!
router bgp 200
 no synchronization
 neighbor 172.16.0.1 remote-as 100
 neighbor 172.18.0.2 remote-as 400
 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 Ethernet0
 ip address 172.19.0.1 255.255.0.0
!
interface Serial0
 ip address 172.17.0.2 255.255.0.0
 bandwidth 64
!
router bgp 300
 no synchronization
 neighbor 172.17.0.1 remote-as 100
 neighbor 172.19.0.2 remote-as 400
 no auto-summary
!
ip classless
!
line con 0
 exec-timeout 0 0
line aux 0
line vty 0 4
 password cisco
 login
!
end

●Router_Dの設定

!
version 11.2
no service udp-small-servers
no service tcp-small-servers
!
hostname Router_D
!
enable password cisco
!
ip subnet-zero
!
interface Ethernet0
 ip address 172.18.0.2 255.255.0.0
!
interface Ethernet1
 ip address 172.19.0.2 255.255.0.0
!
router bgp 400
 no synchronization
 neighbor 172.18.0.1 remote-as 200
 neighbor 172.19.0.1 remote-as 300
 no auto-summary
!
ip classless
!
line con 0
line aux 0
line vty 0 4
 password cisco
 login
!
end

設定が完了したら、Router_AがRouter_Bに、どのルートをアドバタイズしているのか確認してみます。

Router_Aで、次のコマンドを入力します。

Router_A#show ip bgp neighbors 172.16.0.2 advertised-routes

Router_A#show ip bgp neighbors 172.16.0.2 advertised-routes
BGP table version is 3, local router ID is 20.20.20.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*> 10.10.10.0/24    0.0.0.0                  0         32768 i
*> 20.20.20.0/24    0.0.0.0                  0         32768 i

「10.10.10.0/24」と「20.20.20.0/24」の2つの経路情報をアドバタイズしていることが確認できます。

Router_DのBGPテーブルを確認します。

●Router_DのBGPテーブル

Router_D#show ip bgp
BGP table version is 3, local router ID is 172.19.0.2
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop          Metric LocPrf Weight Path
*  10.10.10.0/24    172.19.0.1                           0 300 100 i
*>                  172.18.0.1                           0 200 100 i
*  20.20.20.0/24    172.19.0.1                           0 300 100 i
*>                  172.18.0.1                           0 200 100 i

Router_Dは、次の4つのBGP経路情報を持っていることが確認できます。

それでは、配布リストの設定を行っていきます。

続きは、次の「BGP(配布リスト・distribute-list その3)」で配布リストの設定を行っていきます。