BGP(経路決定プロセスの確認 その1)
前の「BGP(経路決定プロセス)」では、BGPが、パス属性に基づき経路決定を行うパスベクタプロトコルであると説明しました。
BGPは、複雑なルーティングプロトコルで、経路決定のプロセスは、難解です。
ここでは、下図のネットワークをBGPで構成し、
「ROUTER-ID」がBGPの経路決定プロセスにどのように影響するのかをを検証してみます。
AS200のiBGPでは、ループバックアドレスを使用してピアを張ります。

それでは、各ルータを設定していきます。
強制的にインターフェイスを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
!
interface Serial1
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
neighbor 172.16.0.2 remote-as 200
neighbor 172.17.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
!
interface Loopback0
ip address 2.2.2.2 255.255.255.255
!
interface Ethernet0
ip address 172.18.0.1 255.255.0.0
!
interface Serial0
ip address 172.16.0.2 255.255.0.0
!
interface Serial1
no ip address
shutdown
!
router ospf 1
network 0.0.0.0 255.255.255.255 area 0
!
router bgp 200
no synchronization
neighbor 3.3.3.3 remote-as 200
neighbor 3.3.3.3 update-source Loopback0
neighbor 4.4.4.4 remote-as 200
neighbor 4.4.4.4 update-source Loopback0
neighbor 172.16.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_Cの設定
!
version 11.2
no service udp-small-servers
no service tcp-small-servers
!
hostname Router_C
!
enable password cisco
!
interface Loopback0
ip address 3.3.3.3 255.255.255.255
!
interface Ethernet0
ip address 172.19.0.1 255.255.0.0
!
interface Serial0
ip address 172.17.0.2 255.255.0.0
!
router ospf 1
network 0.0.0.0 255.255.255.255 area 0
!
router bgp 200
no synchronization
neighbor 2.2.2.2 remote-as 200
neighbor 2.2.2.2 update-source Loopback0
neighbor 4.4.4.4 remote-as 200
neighbor 4.4.4.4 update-source Loopback0
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_Dの設定
!
version 12.0
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname Router_D
!
enable password cisco
!
ip subnet-zero
!
interface Loopback0
ip address 4.4.4.4 255.255.255.255
no ip directed-broadcast
!
interface Ethernet0/0
ip address 172.18.0.2 255.255.0.0
no ip directed-broadcast
!
interface Ethernet0/1
ip address 172.19.0.2 255.255.0.0
no ip directed-broadcast
!
router ospf 1
network 0.0.0.0 255.255.255.255 area 0
!
router bgp 200
no synchronization
neighbor 2.2.2.2 remote-as 200
neighbor 2.2.2.2 update-source Loopback0
neighbor 3.3.3.3 remote-as 200
neighbor 3.3.3.3 update-source Loopback0
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
endRouter_Dのルーティングテーブルを確認してみます。
Gateway of last resort is not set
2.0.0.0/32 is subnetted, 1 subnets
O 2.2.2.2 [110/11] via 172.18.0.1, 00:00:49, Ethernet0/0
3.0.0.0/32 is subnetted, 1 subnets
O 3.3.3.3 [110/11] via 172.19.0.1, 00:00:50, Ethernet0/1
4.0.0.0/32 is subnetted, 1 subnets
C 4.4.4.4 is directly connected, Loopback0
O 172.17.0.0/16 [110/74] via 172.19.0.1, 00:00:50, Ethernet0/1
O 172.16.0.0/16 [110/74] via 172.18.0.1, 00:00:50, Ethernet0/0
C 172.19.0.0/16 is directly connected, Ethernet0/1
C 172.18.0.0/16 is directly connected, Ethernet0/0
10.0.0.0/24 is subnetted, 1 subnets
B 10.10.10.0 [200/0] via 172.16.0.1, 00:00:01「10.10.10.0/24」のルートは、「172.16.0.1」を経由するようになっています。
Router_DのBGPテーブルを確認してみます。
Router_D#show ip bgp
BGP table version is 2, local router ID is 4.4.4.4
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
*>i 172.16.0.1 0 100 0 100 i
BGPピアのルータIDが小さい「172.16.0.1」経由のパスがベストパスとなっています。
WEIGHT、LOCAL_PREF、AS_PATH、MEDなどのBGP属性による優先順位が同じ場合、最終的には、ROUTER-IDでベストパスが決定されるということが分かります。
BGPでは、最終的に、ルータIDの小さいピアからの経路を優先するようになっています。
次の「BGP(経路決定プロセスの確認 その2)」では、Router_Bのループバックアドレスを変更し、Router_B、Router_Cで「next-hop-self」でRouter_Dとピアを張り、ROUTER-IDを操作することで、ベストパスが変更されることを確認します。
