IPv6 multicastの動作確認を行います。IPv6ではdense modeが存在せず、sparse modeのみとなります。また、動的なRP設定はBSRのみとなりました。このページではBSRを使用した環境の動作確認をおこないます。
コマンド一覧
このシナリオで重要なコマンド一覧は以下の通りです。
Router(config)# ipv6 multicast-routing Router(config)# interface <interface> Router(config-if)# no ipv6 pim Router(config)# ipv6 pim rp-address <addr> [ <acl> ] [ bidir ] Router(config)# ipv6 pim bsr candidate rp <rp_addr> group-list <acl> interval <sec> priority <value> bidir Router(config)# ipv6 pim bsr candidate bsr 2001:1::1 <mask_length> priority <value> Router(config)# ipv6 route <prefix> <next_hop> multicast
構成図
これ以降の動作確認は、以下の環境で行います。
動作確認の都合上、R1, R3間でMulticastを有効にしていません。
[ip address]
e0/0 e0/1
:2+--------+:2
2001:12::/64┌----+ R2 +----┐2001:23::/64
│ +--------+ │
│ │
:1│e0/0 e0/1│:3
+--------+ +---+----+ +---+----+ +--------+
| Host 1 +----------+ R1 +----------+ R3 +----------+ Host 3|
+--------+:101 :1+--------+:1 :3+--------+:3 :303+--------+
e0/3 e0/3 e0/2 e0/2 e0/3 e0/3
2001:11::/64 2001:13::/64 2001:33::/64
R1 Loopback0 R2 Loopback0 R3 Loopback0
2001:1::1/64 2001:2::2/64 2001:3::3/64
[multicast domain]
e0/0 e0/1
:2+--------+:2
2001:12::/64┌----+ R2 +----┐2001:23::/64
│ +--------+ │
│ │
:1│e0/0 e0/1│:3
+---+----+ +---+----+
----+ R1 + + R3 +----
:1+--------+ +--------+:3
e0/3 e0/3
2001:11::/64 2001:33::/64
R1 Loopback0 R2 Loopback0 R3 Loopback0
2001:1::1/64 2001:2::2/64 2001:3::3/64
[R1] ipv6 unicast-routing ! interface Loopback0 ip address 10.1.1.1 255.255.255.255 ipv6 address 2001:1::1/64 ipv6 address FE80::1 link-local ipv6 ospf 1 area 0 ! interface Ethernet0/0 no ip address ipv6 address 2001:12::1/64 ipv6 address FE80::1 link-local ipv6 ospf 1 area 0 ! interface Ethernet0/2 no ip address ipv6 address 2001:13::1/64 ipv6 address FE80::1 link-local ipv6 ospf 1 area 0 ! interface Ethernet0/3 no ip address ipv6 address 2001:11::1/64 ipv6 ospf 1 area 0 [R2] ipv6 unicast-routing ! interface Loopback0 ip address 10.2.2.2 255.255.255.255 ipv6 address 2001:2::2/64 ipv6 address FE80::2 link-local ipv6 ospf 1 area 0 ! interface Ethernet0/0 no ip address half-duplex ipv6 address 2001:12::2/64 ipv6 address FE80::2 link-local ipv6 ospf 1 area 0 ! interface Ethernet0/1 no ip address half-duplex ipv6 address 2001:23::2/64 ipv6 address FE80::2 link-local ipv6 ospf 1 area 0 [R3] ipv6 unicast-routing ! interface Loopback0 ip address 10.3.3.3 255.255.255.255 ipv6 address 2001:3::3/64 ipv6 address FE80::3 link-local ipv6 ospf 1 area 0 ! interface Ethernet0/1 no ip address ipv6 address 2001:23::3/64 ipv6 address FE80::3 link-local ipv6 ospf 1 area 0 ! interface Ethernet0/2 no ip address ipv6 address 2001:13::3/64 ipv6 address FE80::3 link-local ipv6 ospf 1 area 0 ! interface Ethernet0/3 no ip address ipv6 address 2001:33::3/64 ipv6 address FE80::3 link-local ipv6 ospf 1 area 0 [Host1] interface Ethernet0/3 no ip address ipv6 address 2001:11::101/64 ipv6 address FE80::101 link-local ! ipv6 route ::/0 2001:11::1 [Host3] interface Ethernet0/3 no ip address ipv6 address 2001:33::303/64 ipv6 address FE80::303 link-local ! ipv6 route ::/0 2001:33::3
設定全文は下記ファイルです。詳細設定は下記を参照ください。
IPv6 PIM
仕様説明
IPv6マルチキャストルーティングを有効化すると、全てのinterfaceでIPv6 PIMが自動的に有効になります。PIMが有効になったinterfaceはsparse modeとして動作します。IPv4 PIMと異なり、IPv6 PIMにはdense modeが存在しません。
IPv6マルチキャストルーティングを有効にするには以下のコマンドを入力して下さい。
Router(config)# ipv6 multicast-routing
IPv6 PIMを無効化したい場合は、以下のコマンドをinterfaceに対して入力します。
Router(config)# interface <interface> Router(config-if)# no ipv6 pim
IPv6 PIM 設定
動作確認の都合上、R1, R2間の除きPIM neighborを確立させます。IPv6マルチキャストルーティングを有効化し、PIMを無効化したいinterfaceに対してno ipv6 pimコマンドを入力します。
[R1] ipv6 multicast-routing ! interface Ethernet0/2 no ipv6 pim [R2] ipv6 multicast-routing [R3] ipv6 multicast-routing ! interface Ethernet0/2 no ipv6 pim
IPv6 PIM 確認
PIMの確認コマンドはIPv4と殆ど同じです。
[R1]
R1#show ipv6 pim interface
Interface PIM Nbr Hello DR
Count Intvl Prior
VoIP-Null0 off 0 30 1
Address: ::
DR : not elected
Loopback0 off 0 30 1
Address: ::
DR : not elected
Ethernet0/0 on 1 30 1
Address: FE80::1
DR : FE80::2
Ethernet0/1 off 0 30 1
Address: ::
DR : not elected
Ethernet0/2 off 0 30 1
Address: FE80::1
DR : not elected
Ethernet0/3 on 0 30 1
Address: FE80::CE00:1FF:FE3C:3
DR : this system
Tunnel0 off 0 30 1
Address: FE80::CE00:1FF:FE3C:0
DR : not elected
R1#
R1#
R1#show ipv6 pim neighbor
PIM Neighbor Table
Mode: B - Bidir Capable, G - GenID Capable
Neighbor Address Interface Uptime Expires Mode DR pri
FE80::2 Ethernet0/0 00:07:13 00:01:27 B G DR 1
R1#
[R2]
<omitted>
[R3]
<omitted>
RP static configuration
仕様説明
IPv6マルチキャストにおいて、staticにRPを設定するには以下のコマンドを使用します。
Router(config)# ipv6 pim rp-address <addr> [ <acl> ] [ bidir ]
RP 設定
R1をFF80::/11に対するRPとして設定します。
[R1] ipv6 access-list RP_RANGE sequence 10 permit ipv6 any FF80::/11 ! ipv6 pim rp-address 2001:1::1 RP_RANGE [R2] ipv6 access-list RP_RANGE sequence 10 permit ipv6 any FF80::/11 ! ipv6 pim rp-address 2001:1::1 RP_RANGE [R3] ipv6 access-list RP_RANGE sequence 10 permit ipv6 any FF80::/11 ! ipv6 pim rp-address 2001:1::1 RP_RANGE
RP 確認
以下のコマンドでIPv6マルチキャストが使用するアドレスの範囲を表示できます。もし、RPを認識しているならばRP経由で通信できるアドレスの範囲が表示され、RPを認識していないならばSSM用途のFF30::/12のみが表示されます。
[R1] R1#show ipv6 pim range-list Static SSM Exp: never Learnt from : :: FF33::/32 Up: 00:42:18 FF34::/32 Up: 00:42:18 FF35::/32 Up: 00:42:18 FF36::/32 Up: 00:42:18 FF37::/32 Up: 00:42:18 FF38::/32 Up: 00:42:18 FF39::/32 Up: 00:42:18 FF3A::/32 Up: 00:42:18 FF3B::/32 Up: 00:42:18 FF3C::/32 Up: 00:42:18 FF3D::/32 Up: 00:42:18 FF3E::/32 Up: 00:42:18 FF3F::/32 Up: 00:42:18 Static SM RP: 2001:1::1 Exp: never Learnt from : :: FF80::/11 Up: 00:02:08 R1# [R2] <omitted> [R3] <omitted>
RP BSR configuration
仕様説明
IPv6 PIMにおいて動的にRPを設定できる方法は、BSRのみです。Auto RPはIPv6でサポートされていません。
RP Candidator, BSR Routerの設定は以下の通りです。コマンドライン体系がIPv4と異なる事とinterfaceではなくIPv6 addressを指定しなければならない事に注意して下さい。
Router(config)# ipv6 pim bsr candidate rp <rp_addr> group-list <acl> interval <sec> priority <value> bidir Router(config)# ipv6 pim bsr candidate bsr 2001:1::1 <mask_length> priority <value>
multicast packetがRPF failureにより破棄されてしまう場合は、以下のコマンドでmulticast static routeを定義する事ができます。
Router(config)# ipv6 route <prefix> <next_hop> multicast
RP 設定
R2をRP Candidator、R1をBSR Routerとして設定します。
[R1] no ipv6 pim rp-address 2001:1::1 RP_RANGE ipv6 pim bsr candidate bsr 2001:1::1 [R2] no ipv6 pim rp-address 2001:1::1 RP_RANGE ipv6 pim bsr candidate rp 2001:2::2 [R3] no ipv6 pim rp-address 2001:1::1 RP_RANGE
RP 確認
各ルータがRPを認識しているかどうかを確認します。R3はSSM用途のアドレスしか表示されていない事からRPを認識していない事が分かります。
[R1] R1#show ipv6 pim range-list <omitted> FF3E::/32 Up: 00:57:24 FF3F::/32 Up: 00:57:24 BSR SM RP: 2001:2::2 Exp: 00:01:36 Learnt from : 2001:1::1 FF00::/8 Up: 00:00:53 R1# [R2] R2#show ipv6 pim range-list <omitted> FF3E::/32 Up: 00:56:03 FF3F::/32 Up: 00:56:03 BSR SM RP: 2001:2::2 Exp: 00:02:06 Learnt from : 2001:1::1 FF00::/8 Up: 00:01:23 R2# [R3] R3#show ipv6 pim range-list Static SSM Exp: never Learnt from : :: FF33::/32 Up: 00:55:31 FF34::/32 Up: 00:55:31 FF35::/32 Up: 00:55:31 FF36::/32 Up: 00:55:31 FF37::/32 Up: 00:55:31 FF38::/32 Up: 00:55:31 FF39::/32 Up: 00:55:31 FF3A::/32 Up: 00:55:31 FF3B::/32 Up: 00:55:31 FF3C::/32 Up: 00:55:31 FF3D::/32 Up: 00:55:31 FF3E::/32 Up: 00:55:31 FF3F::/32 Up: 00:55:31 R3#
BSR 確認
以下がBSR確認コマンドのヘルプストリングですが、慣れないうちは何を見れば良いのか分かりません。それでは、順を追って確認しましょう。
R1#show ipv6 pim bsr ? candidate-rp Candidate RP state machine election BSR election state information rp-cache PIM BSR Group Cache R1#show ipv6 pim bsr
RP Candidatorとしての設定を確認するコマンドが、”show ipv6 pim bsr candidate-rp”です。実際にR2の設定を確認すると以下の通りです。なお、このコマンドはRP Candidator以外で実行すると何も出力されません。
[R1]
R1#show ipv6 pim bsr candidate-rp
No C-RP information found
R1#
[R2]
R2#show ipv6 pim bsr candidate-rp
PIMv2 C-RP information
Candidate RP: 2001:2::2 SM
All Learnt Scoped Zones, Priority 192, Holdtime 150
Advertisement interval 60 seconds
Next advertisement in 00:00:44
R2#
[R3]
R3#show ipv6 pim bsr candidate-rp
No C-RP information found
R3#
BSR messageによる情報を表示されるコマンドが、”show ipv6 pim bsr election”です。このコマンドを使ってBSR messageが届いているかどうかを把握しましょう。
以下出力の場合は、R3にBSR messageが届いていない事が分かります。
[R1]
R1#show ipv6 pim bsr election
PIMv2 BSR information
BSR Election Information
Scope Range List: ff00::/8
This system is the Bootstrap Router (BSR)
BSR Address: 2001:1::1
Uptime: 00:18:00, BSR Priority: 10, Hash mask length: 126
RPF: FE80::1,Ethernet0/0
BS Timer: 00:00:03
This system is candidate BSR
Candidate BSR address: 2001:1::1, priority: 10, hash mask length: 126
R1#
[R2]
R2#show ipv6 pim bsr election
PIMv2 BSR information
BSR Election Information
Scope Range List: ff00::/8
BSR Address: 2001:1::1
Uptime: 00:18:36, BSR Priority: 10, Hash mask length: 126
RPF: FE80::1,Ethernet0/0
BS Timer: 00:01:36
R2#
[R3]
R3#show ipv6 pim bsr election
No BSR information found
R3#
BSRが収集したRP Candidatorの情報を表示するコマンドが、”show ipv6 pim bsr candidate-rp”です。show ip pim rp mappingに非常に似た出力ですが、BSR Router以外で実行しても何も出力させません。
[R1]
R1#show ipv6 pim bsr rp-cache
PIMv2 BSR C-RP Cache
BSR Candidate RP Cache
Group(s) FF00::/8, RP count 1
RP 2001:2::2 SM
Priority 192, Holdtime 150
Uptime: 00:29:46, expires: 00:01:38
R1#
[R2]
R2#show ipv6 pim bsr rp-cache
No BSR RP-Cache information found
R2#
[R3]
R3#show ipv6 pim bsr rp-cache
No BSR RP-Cache information found
R3#
なお、IPv6 BSRに関するトラブル発生について、私がお勧めする切り分け順序は以下の通りです。
- RP CandidatorがBSRを認識しているかどうか”show ipv6 pim bsr election”により確認
- RP CandidatorからBSRへのRPに関するmessageが届いているかを”show ipv6 pim bsr rp-cache”により確認
- BSRからRPに関する情報が全ルータに届いているかを”show ipv6 pim bsr election”により確認
static mroute
BSR messageがRPF failureによって破棄された可能性を疑う場合は、ルーティングテーブルから素早く判断するのが理想です。しかし、ルーティングがあまりに複雑な場合は、以下のデバッグコマンドで追跡する事もできます。
[R3] R3#debug ipv6 pim bsr IPv6 Bootstrap Router debugging is on R3# *Mar 1 01:48:05.619: IPv6 BSR: Received BSR message from FE80::2 for 2001:1::1, BSR priority 10 hash mask length 126 *Mar 1 01:48:05.623: IPv6 BSR: BSR message from FE80::2/Ethernet0/1 for 2001:1::1 RPF failed, dropped *Mar 1 01:49:05.887: IPv6 BSR: Received BSR message from FE80::2 for 2001:1::1, BSR priority 10 hash mask length 126 *Mar 1 01:49:05.891: IPv6 BSR: BSR message from FE80::2/Ethernet0/1 for 2001:1::1 RPF failed, dropped R3#
R3に以下multicast static routeを定義し、BSR messageを受信できるようにします。設定後、R3がRPを認識している事を確認して下さい。
[R3]
ipv6 route 2001:1::/64 2001:23::2 multicast
R3#show ipv6 pim bsr election
PIMv2 BSR information
BSR Election Information
Scope Range List: ff00::/8
BSR Address: 2001:1::1
Uptime: 00:03:18, BSR Priority: 10, Hash mask length: 126
RPF: FE80::2,Ethernet0/1
BS Timer: 00:01:51
R3#
R3#
R3#
R3#show ipv6 pim range-list
<omitted>
FF3E::/32 Up: 01:41:47
FF3F::/32 Up: 01:41:47
BSR SM RP: 2001:2::2 Exp: 00:01:39 Learnt from : 2001:1::1
FF00::/8 Up: 00:04:51
R3#
疎通確認
MLD join
Host3からHost1への疎通が可能な事を確認します。
Host1をマルチキャストグループFF08::1に参加させ、R1はHost1からのMLD joinを受信した事を確認します。
[Host1]
interface Ethernet0/3
ipv6 mld join-group FF08::1
[R1]
R1#show ipv6 mld groups
MLD Connected Group Membership
Group Address Interface Uptime Expires
FF08::1 Ethernet0/3 00:00:10 00:04:10
R1#
R1#
R1#show ipv6 mroute
Multicast Routing Table
Flags: D - Dense, S - Sparse, B - Bidir Group, s - SSM Group,
C - Connected, L - Local, I - Received Source Specific Host Report,
P - Pruned, R - RP-bit set, F - Register flag, T - SPT-bit set,
J - Join SPT
Timers: Uptime/Expires
Interface state: Interface, State
(*, FF08::1), 00:00:14/never, RP 2001:2::2, flags: SCJ
Incoming interface: Ethernet0/0
RPF nbr: FE80::2
Immediate Outgoing interface list:
Ethernet0/3, Forward, 00:00:14/never
R1#
疎通確認
Host3からHost1へのping応答を確認します。なお、IPv6 pingはマルチキャストやlink localに対するpingは送信元Interfaceを指定する必要があります(e0/0のような省略表記不可)。
Host3#ping FF08::1 Output Interface: Ethernet0/3 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to FF08::1, timeout is 2 seconds: Packet sent with a source address of 2001:33::303 Reply to request 0 received from 2001:11::101, 304 ms Reply to request 1 received from 2001:11::101, 180 ms Reply to request 2 received from 2001:11::101, 84 ms Reply to request 3 received from 2001:11::101, 48 ms Reply to request 4 received from 2001:11::101, 28 ms Success rate is 100 percent (5/5), round-trip min/avg/max = 28/128/304 ms 5 multicast replies and 0 errors. Host3#
register process
送信元treeの考え方はIPv4と同じで、送信元treeを作成するためにregister messageをRPに送信します。
IPv6の場合はregister messageの実装方法が、IPv4とやや異なります。IPv4ではパケットを受信してからカプセル化の処理を行いますが、IPv6ではregister messageが転送されるトンネルをパケット転送前に予め作成しておきます。このトンネルは、以下コマンドにより表示させる事ができます。
[R3] R3#show ipv6 pim tunnel Tunnel0* Type : PIM Encap RP : Embedded RP Tunnel Source: 2001:3::3 Tunnel1* Type : PIM Encap RP : 2001:2::2 Source: 2001:23::3 R3#
上記pingを送信した直後に、R3のマルチキャストルーティングテーブルを見ます。すると、Outgoing interfaceがTunnel1になっています。Tunnel1はregister messageが通過するトンネルです。
[R3]
R3#show ipv6 mroute
Multicast Routing Table
Flags: D - Dense, S - Sparse, B - Bidir Group, s - SSM Group,
C - Connected, L - Local, I - Received Source Specific Host Report,
P - Pruned, R - RP-bit set, F - Register flag, T - SPT-bit set,
J - Join SPT
Timers: Uptime/Expires
Interface state: Interface, State
(2001:33::303, FF08::1), 00:00:02/00:03:27, flags: SFT
Incoming interface: Ethernet0/3
RPF nbr: 2001:33::303, Registering
Immediate Outgoing interface list:
Tunnel1, Forward, 00:00:02/never
R3#
上記確認から数秒経つと、Outgoing interfaceがe0/1に変わっています。これはregister stopを受信し、送信元ツリーが作成されトンネルを使う必要がなくなった事を意味します。
[R3]
R3#show ipv6 mroute
Multicast Routing Table
Flags: D - Dense, S - Sparse, B - Bidir Group, s - SSM Group,
C - Connected, L - Local, I - Received Source Specific Host Report,
P - Pruned, R - RP-bit set, F - Register flag, T - SPT-bit set,
J - Join SPT
Timers: Uptime/Expires
Interface state: Interface, State
(2001:33::303, FF08::1), 00:00:08/00:03:21, flags: SFT
Incoming interface: Ethernet0/3
RPF nbr: 2001:33::303
Immediate Outgoing interface list:
Ethernet0/1, Forward, 00:00:04/00:03:25
R3#
仕様理解のためパケットも観察しましょう。上記通信でやりとりされるパケットは以下の通りです。IPv4と同じで、カプセルの内側がマルチキャストでカプセルの外側がユニキャストになっています。
[register]
Ethernet II, Src: cc:02:12:34:00:01 (cc:02:12:34:00:01), Dst: cc:01:0c:38:00:01 (cc:01:0c:38:00:01)
Internet Protocol Version 6, Src: 2001:23::3 (2001:23::3), Dst: 2001:2::2 (2001:2::2)
Protocol Independent Multicast
0010 .... = Version: 2
.... 0001 = Type: Register (1)
Reserved byte(s): 00
Checksum: 0x9e64 [correct]
PIM options
Flags: 0x00000000
0... .... .... .... .... .... .... .... = Not border
.0.. .... .... .... .... .... .... .... = Not Null-Register
Internet Protocol Version 6, Src: 2001:33::303 (2001:33::303), Dst: ff08::1 (ff08::1)
Internet Control Message Protocol v6
[register-stop]
Ethernet II, Src: cc:01:0c:38:00:01 (cc:01:0c:38:00:01), Dst: cc:02:12:34:00:01 (cc:02:12:34:00:01)
Internet Protocol Version 6, Src: 2001:2::2 (2001:2::2), Dst: 2001:23::3 (2001:23::3)
Protocol Independent Multicast
0010 .... = Version: 2
.... 0010 = Type: Register-stop (2)
Reserved byte(s): 00
Checksum: 0x7681 [correct]
PIM options
Group: ff08::1/128
Source: 2001:33::303
