 |
|  |
◆BGP(MED属性の設定 その1)
※動作確認は、Cisco2500、Cisco1710、Cisco1720、Cisco1721、Cisco2611、Cisco2650、Cisco3620シリーズのルータ、Catalyst2900、Catalyst2950シリーズのスイッチなどで確認しています。コマンド、出力結果、動作は、機種、IOSのバージョンで異なる場合があります。
◆BGP(MED属性の設定 その1)
「BGP(MED属性とは)」の続きです。
ここでは、まず、MED属性を設定してゆく前に、下のネットワークをBGPで構築します。
下のネットワークを構築すると、「10.10.10.0/24」と「20.20.20.0/24」の経路において、各ルータのベストパスは、以下のようになります。
●Router_Bにおいて
iBGP経路より、eBGP経路の経路が優先されるため「172.16.0.1」を経由するパスがベストパスになるはずです。 |
|
●Router_Cにおいて
iBGP経路より、eBGP経路の経路が優先されるため「172.17.0.1」を経由するパスがベストパスになるはずです。
●Router_Dにおいて
BGPピアのルータIDが小さい方のパスが優先されるので、「172.16.0.1」を経由するパスがベストパスになるはずです。
※WEIGHT、LOCAL_PREF、AS_PATH、MEDなどのBGP属性による優先順位が同じ場合、最終的に、ルータIDの小さいピアからの経路を優先されます。
BGPにおける経路プロセスについては、「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 200
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
!
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 Loopback0
ip address 1.1.1.1 255.255.255.0
!
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 ospf 1
passive-interface Serial0
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
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
!
ip subnet-zero
!
interface Loopback0
ip address 2.2.2.2 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
bandwidth 64
!
router ospf 1
passive-interface Serial0
network 0.0.0.0 255.255.255.255 area 0
!
router bgp 200
no synchronization
neighbor 1.1.1.1 remote-as 200
neighbor 1.1.1.1 update-source Loopback0
neighbor 3.3.3.3 remote-as 200
neighbor 3.3.3.3 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 11.2
no service udp-small-servers
no service tcp-small-servers
!
hostname Router_D
!
enable password cisco
!
ip subnet-zero
!
interface Loopback0
ip address 3.3.3.3 255.255.255.255
!
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 ospf 1
network 0.0.0.0 255.255.255.255 area 0
!
router bgp 200
no synchronization
neighbor 1.1.1.1 remote-as 200
neighbor 1.1.1.1 update-source Loopback0
neighbor 2.2.2.2 remote-as 200
neighbor 2.2.2.2 update-source Loopback0
no auto-summary
!
ip classless
!
line con 0
line aux 0
line vty 0 4
password cisco
login
!
end
|
Router_B、Router_C、Router_DのBGPテーブルを確認します。
●Router_BのBGPテーブル
Router_B#show ip bgp
BGP table version is 3, local router ID is 1.1.1.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
*> 172.16.0.1 0 0 100 i
* i20.20.20.0/24 172.17.0.1 0 100 0 100 i
*> 172.16.0.1 0 0 100 i
|
●Router_CのBGPテーブル
Router_C#show ip bgp
BGP table version is 3, local router ID is 2.2.2.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
* i10.10.10.0/24 172.16.0.1 0 100 0 100 i
*> 172.17.0.1 0 0 100 i
* i20.20.20.0/24 172.16.0.1 0 100 0 100 i
*> 172.17.0.1 0 0 100 i
|
●Router_DのBGPテーブル
Router_D#show ip bgp
BGP table version is 7, local router ID is 3.3.3.3
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
* i20.20.20.0/24 172.17.0.1 0 100 0 100 i
*>i 172.16.0.1 0 100 0 100 i
|
「10.10.10.0/24」と「20.20.20.0/24」の経路において、各ルータのベストパスは、以下のようになっていることが確認できます。
●Router_Bにおいて
iBGP経路より、eBGP経路の経路が優先されるため「172.16.0.1」を経由するパスがベストパスになっている。
Router_Bのルーティングテーブルを確認すると、AD値より、eBGP経路がベストパスになっていることが確認できます。
Gateway of last resort is not set
1.0.0.0/24 is subnetted, 1 subnets
C 1.1.1.0 is directly connected, Loopback0
2.0.0.0/32 is subnetted, 1 subnets
O 2.2.2.2 [110/21] via 172.18.0.2, 00:10:20, Ethernet0
3.0.0.0/32 is subnetted, 1 subnets
O 3.3.3.3 [110/11] via 172.18.0.2, 00:10:20, Ethernet0
10.0.0.0/24 is subnetted, 1 subnets
B 10.10.10.0 [20/0] via 172.16.0.1, 00:22:35
20.0.0.0/24 is subnetted, 1 subnets
B 20.20.20.0 [20/0] via 172.16.0.1, 00:22:35
C 172.16.0.0/16 is directly connected, Serial0
O 172.17.0.0/16 [110/1582] via 172.18.0.2, 00:10:20, Ethernet0
C 172.18.0.0/16 is directly connected, Ethernet0
O 172.19.0.0/16 [110/20] via 172.18.0.2, 00:10:20, Ethernet0
|
●Router_Cにおいて
iBGP経路より、eBGP経路の経路が優先されるため「172.17.0.1」を経由するパスがベストパスになっている。
Router_Cのルーティングテーブルを確認すると、AD値より、eBGP経路がベストパスになっていることが確認できます。
Gateway of last resort is not set
1.0.0.0/32 is subnetted, 1 subnets
O 1.1.1.1 [110/21] via 172.19.0.2, 00:08:52, Ethernet0
2.0.0.0/32 is subnetted, 1 subnets
C 2.2.2.2 is directly connected, Loopback0
3.0.0.0/32 is subnetted, 1 subnets
O 3.3.3.3 [110/11] via 172.19.0.2, 00:08:52, Ethernet0
10.0.0.0/24 is subnetted, 1 subnets
B 10.10.10.0 [20/0] via 172.17.0.1, 00:19:32
20.0.0.0/24 is subnetted, 1 subnets
B 20.20.20.0 [20/0] via 172.17.0.1, 00:19:32
O 172.16.0.0/16 [110/1582] via 172.19.0.2, 00:08:52, Ethernet0
C 172.17.0.0/16 is directly connected, Serial0
O 172.18.0.0/16 [110/20] via 172.19.0.2, 00:08:52, Ethernet0
C 172.19.0.0/16 is directly connected, Ethernet0
|
●Router_Dにおいて
BGPピアのルータIDが小さい方のパスが優先されるので、「172.16.0.1」を経由するパスがベストパスになっている。
Router_Dのルーティングテーブルを確認すると、AD値より、iBGP経路がベストパスになっていることが確認できます。
Gateway of last resort is not set
1.0.0.0/32 is subnetted, 1 subnets
O 1.1.1.1 [110/11] via 172.18.0.1, 00:11:42, Ethernet0
2.0.0.0/32 is subnetted, 1 subnets
O 2.2.2.2 [110/11] via 172.19.0.1, 00:11:43, Ethernet1
3.0.0.0/32 is subnetted, 1 subnets
C 3.3.3.3 is directly connected, Loopback0
10.0.0.0/24 is subnetted, 1 subnets
B 10.10.10.0 [200/0] via 172.16.0.1, 00:11:38
20.0.0.0/24 is subnetted, 1 subnets
B 20.20.20.0 [200/0] via 172.16.0.1, 00:11:38
O 172.16.0.0/16 [110/1572] via 172.18.0.1, 00:11:43, Ethernet0
O 172.17.0.0/16 [110/1572] via 172.19.0.1, 00:11:43, Ethernet1
C 172.18.0.0/16 is directly connected, Ethernet0
C 172.19.0.0/16 is directly connected, Ethernet1
|
それでは、MED属性を設定してゆきましょう。
この続きは、次の「BGP(MED属性の設定 その2)」で説明してゆきます。
<ネットワーク資格の練習問題に挑戦> ●CCNA練習問題に挑戦!(650問)
●Network+練習問題に挑戦!(393問)
●テクニカルエンジニア(ネットワーク)試験
◆Cisco実機で学ぶ(CCNAスイッチ編) |
 |
|
<関連コンテンツ>
◆Cisco実機で学ぶ(CCNP) |
 |
|
<関連メニュー> ●CCNA実機で学ぶ
●CCNP実機で学ぶ ●アライドテレシス実機で学ぶ
●TCP/IP入門・無料ネットワークツール
|
|
 |