@network Cisco・アライド実機で学ぶ > Cisco実機で学ぶ(CCNP) > BGP(Local Preferenceの設定 その1)

 Rakuten

@network Cisco・アライド実機で学ぶ
◆BGP(ピアグループの設定 その1)

※動作確認は、Cisco2500、Cisco1710、Cisco1720、Cisco1721、Cisco2611、Cisco2650、Cisco3620シリーズのルータ、Catalyst2900、Catalyst2950シリーズのスイッチなどで確認しています。コマンド、出力結果、動作は、機種、IOSのバージョンで異なる場合があります。

◆BGP(Local Preferenceの設定 その1)

 「BGP(Local Preference属性とは)」の続きです。

 ここでは、まず、Local Preference属性を設定してゆく前に、下のネットワークを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 Ethernet0/0
 ip address 172.16.0.1 255.255.0.0
!
interface Ethernet0/1
 ip address 172.17.0.1 255.255.0.0
!
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
 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 Loopback0
 ip address 1.1.1.1 255.255.255.0
!
interface Ethernet0
 ip address 172.16.0.2 255.255.0.0
!
interface Serial0
 ip address 172.18.0.1 255.255.0.0
 clockrate 64000
!
router ospf 1
 passive-interface Ethernet0
 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.17.0.2 255.255.0.0
!
interface Serial0
 ip address 172.19.0.1 255.255.0.0
 clockrate 64000
!
router ospf 1
 passive-interface Ethernet0
 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
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 Serial0
 ip address 172.18.0.2 255.255.0.0
!
interface Serial1
 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 3, 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/129] via 172.18.0.2, 00:33:36, Serial0
     3.0.0.0/32 is subnetted, 1 subnets
O       3.3.3.3 [110/65] via 172.18.0.2, 00:33:36, Serial0
     10.0.0.0/24 is subnetted, 1 subnets
B       10.10.10.0 [20/0] via 172.16.0.1, 00:31:58
     20.0.0.0/24 is subnetted, 1 subnets
B       20.20.20.0 [20/0] via 172.16.0.1, 00:31:58
C    172.16.0.0/16 is directly connected, Ethernet0
O    172.17.0.0/16 [110/138] via 172.18.0.2, 00:33:36, Serial0
C    172.18.0.0/16 is directly connected, Serial0
O    172.19.0.0/16 [110/128] via 172.18.0.2, 00:33:36, Serial0

●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/129] via 172.19.0.2, 00:37:51, Serial0
     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/65] via 172.19.0.2, 00:37:51, Serial0
     10.0.0.0/24 is subnetted, 1 subnets
B       10.10.10.0 [20/0] via 172.17.0.1, 00:36:22
     20.0.0.0/24 is subnetted, 1 subnets
B       20.20.20.0 [20/0] via 172.17.0.1, 00:36:22
O    172.16.0.0/16 [110/138] via 172.19.0.2, 00:37:51, Serial0
C    172.17.0.0/16 is directly connected, Ethernet0
O    172.18.0.0/16 [110/128] via 172.19.0.2, 00:37:51, Serial0
C    172.19.0.0/16 is directly connected, Serial0

●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/65] via 172.18.0.1, 00:40:53, Serial0
     2.0.0.0/32 is subnetted, 1 subnets
O       2.2.2.2 [110/65] via 172.19.0.1, 00:40:53, Serial1
     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:39:25
     20.0.0.0/24 is subnetted, 1 subnets
B       20.20.20.0 [200/0] via 172.16.0.1, 00:39:25
O    172.16.0.0/16 [110/74] via 172.18.0.1, 00:40:53, Serial0
O    172.17.0.0/16 [110/74] via 172.19.0.1, 00:40:53, Serial1
C    172.18.0.0/16 is directly connected, Serial0
C    172.19.0.0/16 is directly connected, Serial1

それでは、Local Preference属性を設定してゆきましょう。

この続きは、次の「BGP(Local Preferenceの設定 その2)」で説明してゆきます。



<ネットワーク資格の練習問題に挑戦>
CCNA練習問題に挑戦!(650問)
Network+練習問題に挑戦!(393問)
テクニカルエンジニア(ネットワーク)試験
◆Cisco実機で学ぶ(CCNAルータ編)

ルータの概要・基本操作・設定1 (17項目)
ルータの概要・基本操作・設定3 (22項目)
IGRP・EIGRPの設定 (18項目)
アクセスリスト・ACLの設定 (14項目)
NAT・DHCPの設定 (8項目)
ルータの概要・基本操作・設定2 (17項目)
RIPv1・RIPv2の設定 (14項目)
OSPFの設定・デフォルトルートの伝播(16項目)
WANの設定 (10項目)
◆Cisco実機で学ぶ(CCNAスイッチ編)

スイッチの基本操作・設定 (14項目)
VTP・スパニングツリーの設定 (12項目)
MACアドレスの管理・VLANの設定 (12項目)

◆アライドテレシス実機で学ぶ

基本操作・設定 (11項目)
OSPFの設定 (9項目)
ポリシールーティング・VRRPなど (12項目)
VLAN・マルチホーミング・RIPの設定 (10項目)
STP・ポートトランキングなど (14項目)
<関連コンテンツ>
◆Cisco実機で学ぶ(CCNP)

BGPとは
BGP(基本設定 その1)
BGP(基本設定 iBGP・eBGP確認 その3)
BGP(基本設定 iBGPの設定 その5)
BGP(基本設定 iBGPの設定 その7)
BGP(基本設定 ループバックでピア その9)
BGP(基本設定 iBGPとIGP その11)
BGP(経路決定プロセスの確認 その1)
BGP(同期化とは)
BGP(同期化の設定 その2)
BGP(eBGPマルチホップ その2)
BGPルートの生成(IGPから再配送 その1)
BGPルートの生成(経路集約 その1)
BGPルートの生成(経路集約 その3)
iBGPで学習した経路は他のiBGPへ流さない
BGP(ルートリフレクションとは)
BGP(ルートリフレクションの確認)
BGP(複数のルートリフレクタの設定)
BGP(コンフェデレーションとは)
BGP(コンフェデレーションの確認 その1)
BGP(コミュニティとは)
BGP(コミュニティの確認)
BGP(バックドア その1)
BGP(バックドア その3)
BGP(ピアグループの設定 その1)
BGP(ピアグループの確認)
BGP(Local Preferenceの設定 その1)
BGP(Local Preferenceの確認)
BGP(MED属性の設定 その1)
BGP(MED属性の確認)
BGP(AS_PATH属性 その1)
BGP(AS_PATH属性 その3)
BGP(AS_PATHフィルタ・filter-list その2)
BGP(配布リスト・distribute-list その1)
BGP(配布リスト・distribute-list その3)
BGP(PREFIXフィルタ その2)
BGP(近隣関係の形成)
BGP(基本設定 ベストパスの確認 その2)
BGP(基本設定 next-hop-self その4)
BGP(基本設定 iBGPの設定 その6)
BGP(基本設定 ループバックでピア その8)
BGP(基本設定 iBGPとIGP その10)
BGP(経路決定プロセス)
BGP(経路決定プロセスの確認 その2)
BGP(同期化の設定 その1)
BGP(eBGPマルチホップ その1)
BGPルートの生成(networkコマンド)
BGPルートの生成(IGPから再配送 その2)
BGPルートの生成(経路集約 その2)
BGPルートの生成(経路集約 その4)
BGP(iBGPはフルメッシュでピアを張る)
BGP(ルートリフレクションの設定)
BGP(複数のルートリフレクタ)
BGP(複数のルートリフレクタの確認)
BGP(コンフェデレーションの設定)
BGP(コンフェデレーションの確認 その2)
BGP(コミュニティの設定)
BGP(ORIGINアトリビュート)
BGP(バックドア その2)
BGP(ピアグループとは)
BGP(ピアグループの設定 その2)
BGP(Local Preference属性とは)
BGP(Local Preferenceの設定 その2)
BGP(MED属性とは)
BGP(MED属性の設定 その2)
BGP(帯域幅・bandwidthを設定する)
BGP(AS_PATH属性 その2)
BGP(AS_PATHフィルタ・filter-list その1)
BGP(AS_PATHフィルタ・filter-list その3)
BGP(配布リスト・distribute-list その2)
BGP(PREFIXフィルタ その1)
BGP(PREFIXフィルタ その3)
<関連メニュー>
CCNA実機で学ぶ
CCNP実機で学ぶ
アライドテレシス実機で学ぶ
TCP/IP入門・無料ネットワークツール

Copyright(c)2006- @network Cisco・アライド実機で学ぶ All rights reserved.