DynagenでCCIEを目指す
20100519 PIM sparse-mode BSRの使用
最終更新:
it_certification
-
view
目的
- BSRによって、RPを選出する方法を確認します。
構成
- 設定概要
- OSPFによってルーティングします。
- 構成図

- netファイル
model = 3620 [localhost] [[3620]] image = C:\Program Files\Dynamips\images\c3620-j1s3-mz.123-18.bin ram = 128 [[ROUTER R1]] f0/0 = LAN 1 [[ROUTER R2]] f0/0 = LAN 1 [[ROUTER R3]] f0/0 = LAN 1
- 初期設定 R1
! version 12.3 service timestamps debug datetime msec service timestamps log datetime msec no service password-encryption ! hostname R1 ! boot-start-marker boot-end-marker ! ! no aaa new-model ip subnet-zero ! ! ! ip cef ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! interface Loopback0 ip address 1.1.1.1 255.255.255.255 ! interface FastEthernet0/0 ip address 192.168.0.1 255.255.255.0 duplex auto speed auto ! router ospf 1 log-adjacency-changes network 0.0.0.0 255.255.255.255 area 0 ! ip http server ip classless ! ! ! ! ! ! ! ! line con 0 line aux 0 line vty 0 4 ! ! end
- 初期設定 R2
! version 12.3 service timestamps debug datetime msec service timestamps log datetime msec no service password-encryption ! hostname R2 ! boot-start-marker boot-end-marker ! ! no aaa new-model ip subnet-zero ! ! ! ip cef ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! interface Loopback0 ip address 2.2.2.2 255.255.255.255 ! interface FastEthernet0/0 ip address 192.168.0.2 255.255.255.0 duplex auto speed auto ! router ospf 1 log-adjacency-changes network 0.0.0.0 255.255.255.255 area 0 ! ip http server ip classless ! ! ! ! ! ! ! ! line con 0 line aux 0 line vty 0 4 ! ! end
- 初期設定 R3
! version 12.3 service timestamps debug datetime msec service timestamps log datetime msec no service password-encryption ! hostname R3 ! boot-start-marker boot-end-marker ! ! no aaa new-model ip subnet-zero ! ! ! ip cef ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! interface Loopback0 ip address 3.3.3.3 255.255.255.255 ! interface FastEthernet0/0 ip address 192.168.0.3 255.255.255.0 duplex auto speed auto ! router ospf 1 log-adjacency-changes network 0.0.0.0 255.255.255.255 area 0 ! ip http server ip classless ! ! ! ! ! ! ! ! line con 0 line aux 0 line vty 0 4 ! ! end
検証1 マルチキャストの設定
- マルチキャストの設定
sparse-modeでマルチキャストの設定を行います。
R1(config)#ip multicast-routing R1(config)#interface FastEthernet 0/0 R1(config-if)#ip pim sparse-mode R2(config)#ip multicast-routing R2(config)#interface FastEthernet 0/0 R2(config-if)#ip pim sparse-mode R3(config)#ip multicast-routing R3(config)#interface FastEthernet 0/0 R3(config-if)#ip pim sparse-mode
- マルチキャストの確認
マルチキャストの設定を確認します。R2, R3の確認結果については省略します。
R1#show ip pim interface Address Interface Ver/ Nbr Query DR DR Mode Count Intvl Prior 192.168.0.1 FastEthernet0/0 v2/S 2 30 1 192.168.0.3 R1# R1# R1#show ip pim neighbor PIM Neighbor Table Mode: B - Bidir Capable, DR - Designated Router, N - Default DR Priority, S - State Refresh Capable Neighbor Interface Uptime/Expires Ver DR Address Prio/Mode 192.168.0.3 FastEthernet0/0 00:00:32/00:01:39 v2 1 / DR S 192.168.0.2 FastEthernet0/0 00:00:54/00:01:38 v2 1 / S R1#
検証2 BSRの設定
- BSRの設定
R1をBSRとして設定します。
R1(config)#interface Loopback 0 R1(config-if)#ip pim sparse-mode *Mar 1 00:06:14.475: %PIM-5-DRCHG: DR change from neighbor 0.0.0.0 to 1.1.1.1 on interface Loopback0 (vrf default) R1(config-if)#exit R1(config)# R1(config)# R1(config)#ip pim bsr-candidate Loopback 0
- BSRの確認
全ルータがR1をBSRとして認識しているかどうかを確認します。
R1#show ip pim bsr-router PIMv2 Bootstrap information This system is the Bootstrap Router (BSR) BSR address: 1.1.1.1 (?) Uptime: 00:01:07, BSR Priority: 0, Hash mask length: 0 Next bootstrap message in 00:00:52 R1# R2#show ip pim bsr-router PIMv2 Bootstrap information BSR address: 1.1.1.1 (?) Uptime: 00:00:33, BSR Priority: 0, Hash mask length: 0 Expires: 00:01:36 R2# R3#show ip pim bsr-router PIMv2 Bootstrap information BSR address: 1.1.1.1 (?) Uptime: 00:01:25, BSR Priority: 0, Hash mask length: 0 Expires: 00:02:03 R3#
検証3 RP候補の設定
- RP候補の設定
R3をRP候補として設定します。
R3(config)#interface Loopback 0 R3(config-if)#ip pim sparse-mode R3(config-if)# *Mar 1 00:06:38.211: %PIM-5-DRCHG: DR change from neighbor 0.0.0.0 to 3.3.3.3 on interface Loopback0 (vrf default) R3(config-if)#exit R3(config)# R3(config)# R3(config)#access-list 1 permit 239.1.1.1 R3(config)# R3(config)# R3(config)#ip pim rp-candidate Loopback 0 group-list 1
- RPの確認
全ルータがRPを認識しているかを確認します。
R1#show ip pim rp mapping PIM Group-to-RP Mappings This system is the Bootstrap Router (v2) Group(s) 239.1.1.1/32 RP 3.3.3.3 (?), v2 Info source: 192.168.0.3 (?), via bootstrap, priority 0, holdtime 150 Uptime: 00:01:11, expires: 00:02:12 R1# R2#show ip pim rp mapping PIM Group-to-RP Mappings Group(s) 239.1.1.1/32 RP 3.3.3.3 (?), v2 Info source: 1.1.1.1 (?), via bootstrap, priority 0, holdtime 150 Uptime: 00:02:43, expires: 00:02:02 R2# R3#show ip pim rp mapping PIM Group-to-RP Mappings This system is a candidate RP (v2) Group(s) 239.1.1.1/32 RP 3.3.3.3 (?), v2 Info source: 1.1.1.1 (?), via bootstrap, priority 0, holdtime 150 Uptime: 00:02:51, expires: 00:01:52 R3#
検証4 複数RP候補の挙動
- RP候補の設定
R2をRP候補として設定します。
R2(config)#access-list 1 permit 239.1.1.1 R2(config)# R2(config)# R2(config)#ip pim rp-candidate Loopback 0 group-list 1
- RP選出方法の確認
show ip pim rp-hashコマンドでRPがどのように選ばれたかを確認します。priority値が最も小さいルータがRPとして選出されますが、priority値が全て同じ場合は、hash値が大きいもの(IPアドレスが小さいものほどpriorityが大きくなります)がRPとして選出されます。
以下のコマンド出力結果を見ると、R2がRPとして選出された事が確認できます。
以下のコマンド出力結果を見ると、R2がRPとして選出された事が確認できます。
R2#show ip pim rp-hash 239.1.1.1 RP 2.2.2.2 (?), v2 Info source: 1.1.1.1 (?), via bootstrap, priority 0, holdtime 150 Uptime: 00:01:04, expires: 00:02:15 PIMv2 Hash Value (mask 0.0.0.0) RP 2.2.2.2, via bootstrap, priority 0, hash value 1524600152 RP 3.3.3.3, via bootstrap, priority 0, hash value 450145259 R2#
- priority値の変更
R2のpriorityを変更します。
R2(config)#ip pim rp-candidate Loopback 0 group-list 1 priority 10
- RPの再確認
RPがR2からR3に変わっている事を確認します。
R2#show ip pim rp-hash 239.1.1.1 RP 3.3.3.3 (?), v2 Info source: 1.1.1.1 (?), via bootstrap, priority 0, holdtime 150 Uptime: 00:19:57, expires: 00:02:05 PIMv2 Hash Value (mask 0.0.0.0) RP 3.3.3.3, via bootstrap, priority 0, hash value 450145259 RP 2.2.2.2, via bootstrap, priority 10, hash value 1524600152 R2#
検証5 ハッシュマスク長の変更
- マルチキャストグループの追加
以下のアドレスをマルチキャストグループに追加します。
R2(config)#access-list 1 permit 239.1.1.0 R2(config)#access-list 1 permit 239.1.1.2 R2(config)#access-list 1 permit 239.1.1.3
- ハッシュ値の確認
デフォルトの状態では、全マルチキャストアドレスのハッシュ値は同じです。
R2#show ip pim rp-hash 239.1.1.0 RP 2.2.2.2 (?), v2 Info source: 1.1.1.1 (?), via bootstrap, priority 10, holdtime 150 Uptime: 00:00:40, expires: 00:01:46 PIMv2 Hash Value (mask 0.0.0.0) RP 2.2.2.2, via bootstrap, priority 10, hash value 1524600152 R2#show ip pim rp-hash 239.1.1.1 RP 3.3.3.3 (?), v2 Info source: 1.1.1.1 (?), via bootstrap, priority 0, holdtime 150 Uptime: 00:22:15, expires: 00:01:45 PIMv2 Hash Value (mask 0.0.0.0) RP 3.3.3.3, via bootstrap, priority 0, hash value 450145259 RP 2.2.2.2, via bootstrap, priority 10, hash value 1524600152 R2#show ip pim rp-hash 239.1.1.2 RP 2.2.2.2 (?), v2 Info source: 1.1.1.1 (?), via bootstrap, priority 10, holdtime 150 Uptime: 00:00:49, expires: 00:02:27 PIMv2 Hash Value (mask 0.0.0.0) RP 2.2.2.2, via bootstrap, priority 10, hash value 1524600152 R2#show ip pim rp-hash 239.1.1.3 RP 2.2.2.2 (?), v2 Info source: 1.1.1.1 (?), via bootstrap, priority 10, holdtime 150 Uptime: 00:00:53, expires: 00:02:20 PIMv2 Hash Value (mask 0.0.0.0) RP 2.2.2.2, via bootstrap, priority 10, hash value 1524600152
- ハッシュマスク長の変更
ハッシュマスク長を31に変更します。これによって上位31ビットによってハッシュ値が変わるようになります。(デフォルトのハッシュマスク長は0であるため、全アドレスのハッシュ値が同一になります)
R1(config)#ip pim bsr-candidate Loopback0 31
- ハッシュ値の確認
239.1.1.0, 239.1.1.1のハッシュ値が同一である事と、239.1.1.2, 239.1.1.3と異なっている事が確認できます。
R2#show ip pim rp-hash 239.1.1.0 RP 2.2.2.2 (?), v2 Info source: 1.1.1.1 (?), via bootstrap, priority 10, holdtime 150 Uptime: 00:04:22, expires: 00:01:25 PIMv2 Hash Value (mask 255.255.255.254) RP 2.2.2.2, via bootstrap, priority 10, hash value 825161304 R2#show ip pim rp-hash 239.1.1.1 RP 3.3.3.3 (?), v2 Info source: 1.1.1.1 (?), via bootstrap, priority 0, holdtime 150 Uptime: 00:25:58, expires: 00:01:22 PIMv2 Hash Value (mask 255.255.255.254) RP 3.3.3.3, via bootstrap, priority 0, hash value 1840069355 RP 2.2.2.2, via bootstrap, priority 10, hash value 825161304 R2#show ip pim rp-hash 239.1.1.2 RP 2.2.2.2 (?), v2 Info source: 1.1.1.1 (?), via bootstrap, priority 10, holdtime 150 Uptime: 00:04:25, expires: 00:01:24 PIMv2 Hash Value (mask 255.255.255.254) RP 2.2.2.2, via bootstrap, priority 10, hash value 1339374966 R2#show ip pim rp-hash 239.1.1.3 RP 2.2.2.2 (?), v2 Info source: 1.1.1.1 (?), via bootstrap, priority 10, holdtime 150 Uptime: 00:04:27, expires: 00:01:21 PIMv2 Hash Value (mask 255.255.255.254) RP 2.2.2.2, via bootstrap, priority 10, hash value 1339374966 R2#
添付ファイル