BGP(同期化の設定 その2)
ここでは、「BGP(同期化の設定 その1)」で使用したネットワークをさらに拡張し、AS200を通過ASにして、BGP同期を検証していきます。
使用するネットワークは、下図になります。このネットワークをBGPで構築していきます。
下図のネットワークをBGPで構築していきますが、BGP同期に関しては、各ルータを以下のようにしておきます。
Router_A、Router_B ・・・ BGP同期を無効
Router_C、Router_D ・・・ BGP同期を有効
にしておきます。

●ルータの設定
また、ルーティングを簡素化するために、Router_Aでは、AS200へのルートをデフォルトルートで到達させるようにします。
Router_A(config)#ip route 0.0.0.0 0.0.0.0 172.16.0.2
Router_Bで次の設定を追加します。
Router_B(config-router)#neighbor 172.17.0.2 next-hop-self
Router_Cで次の設定を追加します。
Router_C(config-router)#neighbor 172.18.0.2 next-hop-self
このコマンドを追加することで、Router_B、Router_C が、eBGP、iBGPで学習した「10.10.10.0/24」経路の「Next Hop」を自分のインターフェイスで通知するようになります。
Router_A、Router_Bで、BGP同期を無効にします。
BGP同期を無効にするには、「no synchronization」コマンドを使います。
Router(config-router)#no synchronization
それでは、各ルータを設定してゆきます。
強制的にインターフェイスをUPさせるために、Router_Aの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 bgp 100
no synchronization
network 10.10.10.0 mask 255.255.255.0
neighbor 172.16.0.2 remote-as 200
no auto-summary
!
ip classless
ip route 0.0.0.0 0.0.0.0 172.16.0.2
!
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 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
!
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
neighbor 172.17.0.1 remote-as 200
neighbor 172.18.0.2 remote-as 300
neighbor 172.18.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_Dの設定
!
version 12.1
no service single-slot-reload-enable
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname Router_D
!
logging rate-limit console 10 except errors
enable password cisco
!
ip subnet-zero
!
no ip finger
!
interface Serial0/0
ip address 172.18.0.2 255.255.0.0
no fair-queue
!
router bgp 300
bgp log-neighbor-changes
neighbor 172.18.0.1 remote-as 200
no auto-summary
!
ip classless
no ip http server
!
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_CのBGPテーブルを確認してみます。
Router_C#show ip bgp
BGP table version is 2, local router ID is 172.18.0.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
*>i10.10.10.0/24 172.17.0.1 0 100 0 100 i
「10.10.10.0/24」の経路が、「>」よりベストパスになっているのが確認できます。
ところが、
Router_DのBGPテーブルを確認してみます。
Router_D#sh ip bgp
(何も出力されない)BGPテーブルは空で、「10.10.10.0/24」の経路情報がありません。
Router_C でiBGPで、「10.10.10.0/24」の経路を学習し、ベストパスになっているにも関わらず、Router_Dへ、「10.10.10.0/24」の経路が伝わっていません。
Router_Dのルーティングテーブルを確認してみると
Gateway of last resort is not set
C 172.18.0.0/16 is directly connected, Serial0/0
当然ながら、「10.10.10.0/24」の経路がありません。
それは、Router_C、Router_Dで、BGP同期が有効になっているからです。
BGP同期では、次のルールがありました。
iBGPピアから学習した経路をeBGPピアにアドバタイズする前に、その経路がIGPと同期していなければならない。
というルールです。
通過ASであるAS200が、AS300に「10.10.10.0/24」経路を通過させなかったのです。
確かに、Router_Cのルーティングテーブルを確認してみると
IGPと同期が取れていないため、「10.10.10.0/24」の経路がありません。
Gateway of last resort is not set
C 172.17.0.0/16 is directly connected, Serial0
C 172.18.0.0/16 is directly connected, Serial1
iBGPとIGPの両方で、同じルートのアドバタイズを受けた時のみ、ルーティングテーブルに載せます。
Router_Dで、「10.10.10.0/24」経路を反映させるためにRouter_CとRouter_DでBGP同期を無効にします。
Router_CでBGP同期を無効にします。
Router_C(config-router)#no synchronization
Router_DでBGP同期を無効にします。
Router_D(config-router)#no synchronization
これで、「10.10.10.0/24」経路は、AS300へ通過するようになったはずです。
ルーティングテーブルへの反映を早めるために次のコマンドを入力します。
Router_C(config)#clear ip bgp *
しばらくの間、待ってから
Router_DでBGPテーブルを確認してみます。
Router_D#show ip bgp
BGP table version is 2, local router ID is 172.18.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.18.0.1 0 200 100 i
「10.10.10.0/24」の経路をBGPで学習し、ベストパスになっていることが確認できます。
Router_Dで、再度ルーティングテーブルを確認してみます。
Gateway of last resort is not set
C 172.18.0.0/16 is directly connected, Serial0/0
10.0.0.0/24 is subnetted, 1 subnets
B 10.10.10.0 [20/0] via 172.18.0.1, 00:01:55
Router_Dのルーティングテーブルに、「10.10.10.0/24」経路が反映されました。
