01-H3C S12500 PIM-SM典型配置举例
本章节下载: 01-H3C S12500 PIM-SM典型配置举例 (166.29 KB)
Copyright © 2013 杭州华三通信技术有限公司 版权所有,保留一切权利。 非经本公司书面许可,任何单位和个人不得擅自摘抄、复制本文档内容的部分或全部, 并不得以任何形式传播。本文档中的信息可能变动,恕不另行通知。 |
目 录
PIM-SM(Protocol Independent Multicast-Sparse Mode,稀疏模式协议无关组播)属于稀疏模式的组播路由协议,使用“拉(Pull)模式”传送组播数据,通常适用于组播组成员分布相对分散、范围较广的大中型网络。
本文档中的配置均是在实验室环境下进行的配置和验证,配置前设备的所有参数均采用出厂时的缺省配置。如果您已经对设备进行了配置,为了保证配置效果,请确认现有配置和以下举例中的配置不冲突。
如图1所示,三层交换机Switch A、Switch B和Switch C之间采用OSPF协议进行互连,单播路由正常。接收者通过组播方式接收视频点播信息,末梢用户网络N1、N2、N3中存在不同视频信息的接收者。
要求在该网络中采用PIM-SM协议实现组播数据的分发,并通过自举机制来动态选举RP,同时配置静态RP以避免动态RP故障而使通信中断。
图1 PIM-SM配置组网图
设备 |
接口 |
IP地址 |
设备 |
接口 |
IP地址 |
Switch A |
Vlan-int100(GE3/0/1) |
10.10.1.1/24 |
Switch C |
Vlan-int102(GE3/0/1) |
10.102.1.1/24 |
|
Vlan-int12(GE3/0/2) |
10.12.1.1/24 |
|
Vlan-int13(GE3/0/3) |
10.13.1.3/24 |
|
Vlan-int13(GE3/0/3) |
10.13.1.1/24 |
|
Vlan-int23(GE3/0/2) |
10.23.1.3/24 |
|
|
|
|
Vlan-int33(GE3/0/4) |
10.33.1.3/24 |
Switch B |
Vlan-int101(GE3/0/1) |
10.101.1.1/24 |
|
|
|
|
Vlan-int12(GE3/0/2) |
10.12.1.2/24 |
|
|
|
|
Vlan-int23(GE3/0/3) |
10.23.1.2/24 |
|
|
|
· 为了确保一个C-RP故障时,另一个C-RP能够生效,将Switch A的VLAN接口12和Switch B的VLAN接口23均配置为C-RP,其中前者的优先级较高;同时为了确保上述两个接口都发生故障时静态RP能够生效,将Swtich C的VLAN接口13配置为静态RP。
· 为了能动态选举出RP,还需要在Switch A和Switch B上配置C-BSR来自动选举产生BSR,以负责收集C-RP发来的宣告报文。
本举例是在S12500-CMW520-R1825P01版本上进行配置和验证的。
· 同一台设备所有接口上所使能的PIM模式必须相同。
· BSR和RP接口必须使能PIM-SM。
· 在边界设备连接用户网络的接口上必须使能IGMPv2功能,以建立和维护各组播组的成员关系。
(1) 使能组播路由功能
<SwitchA> system-view
System View: return to User View with Ctrl+Z.
[SwitchA] multicast routing-enable
(2) 配置各接口及接口地址,并使能PIM-SM
# 配置连接组播源的接口及接口地址,使能PIM-SM。
[SwitchA] vlan 100
[SwitchA-vlan100] port GigabitEthernet 3/0/1
[SwitchA-vlan100] quit
[SwitchA] interface Vlan-interface 100
[SwitchA-Vlan-interface100] ip address 10.10.1.1 24
[SwitchA-Vlan-interface100] pim sm
[SwitchA-Vlan-interface100] undo shutdown
[SwitchA-Vlan-interface100] quit
[SwitchA] interface GigabitEthernet 3/0/1
[SwitchA-GigabitEthernet3/0/1] undo shutdown
[SwitchA-GigabitEthernet3/0/1] quit
# 配置连接Switch B的接口及接口地址,使能PIM-SM。
[SwitchA] vlan 12
[SwitchA-vlan12] port GigabitEthernet 3/0/2
[SwitchA-vlan12] quit
[SwitchA] interface Vlan-interface 12
[SwitchA-Vlan-interface12] ip address 10.12.1.1 24
[SwitchA-Vlan-interface12] pim sm
[SwitchA-Vlan-interface12] undo shutdown
[SwitchA-Vlan-interface12] quit
[SwitchA] interface GigabitEthernet 3/0/2
[SwitchA-GigabitEthernet3/0/2] undo shutdown
[SwitchA-GigabitEthernet3/0/2] quit
# 配置连接Switch C的接口及接口地址,使能PIM-SM。
[SwitchA] vlan 13
[SwitchA-vlan13] port GigabitEthernet 3/0/3
[SwitchA-vlan13] quit
[SwitchA] interface Vlan-interface 13
[SwitchA-Vlan-interface13] ip address 10.13.1.1 24
[SwitchA-Vlan-interface13] pim sm
[SwitchA-Vlan-interface13] undo shutdown
[SwitchA-Vlan-interface13] quit
[SwitchA] interface GigabitEthernet 3/0/3
[SwitchA-GigabitEthernet3/0/3] undo shutdown
[SwitchA-GigabitEthernet3/0/3] quit
(3) 配置C-RP和静态RP
# 指定VLAN接口12的IP地址为C-BSR和C-RP,其中C-RP的优先级为10。
[SwitchA] pim
[SwitchA-pim] c-bsr vlan-interface 12
[SwitchA-pim] c-rp vlan-interface 12 priority 10
# 指定Switch C的VLAN接口13的IP地址为静态RP的IP地址。
[SwitchA-pim] static-rp 10.13.1.3
[SwitchA-pim] quit
(4) 配置单播路由协议,以建立正确的单播路由表项
[SwitchA] ospf 1
[SwitchA-ospf-1] import-route direct
[SwitchA-ospf-1] area 0.0.0.0
[SwitchA-ospf-1-area-0.0.0.0] network 10.0.0.0 0.255.255.255
[SwitchA-ospf-1-area-0.0.0.0] network 1.1.1.1 0.0.0.0
[SwitchA-ospf-1-area-0.0.0.0] quit
[SwitchA-ospf-1] quit
(1) 使能组播路由功能
<SwitchB> system-view
System View: return to User View with Ctrl+Z.
[SwitchB] multicast routing-enable
(2) 配置各接口及接口地址,并使能PIM-SM
# 配置连接Switch A的接口及接口地址,使能PIM-SM。
[SwitchB] vlan 12
[SwitchB-vlan12] port GigabitEthernet 3/0/2
[SwitchB-vlan12] quit
[SwitchB] interface Vlan-interface 12
[SwitchB-Vlan-interface12] ip address 10.12.1.2 24
[SwitchB-Vlan-interface12] pim sm
[SwitchB-Vlan-interface12] undo shutdown
[SwitchB-Vlan-interface12] quit
[SwitchB] interface GigabitEthernet 3/0/2
[SwitchB-GigabitEthernet3/0/2] undo shutdown
[SwitchB-GigabitEthernet3/0/2] quit
# 配置连接Switch C的接口及接口地址,使能PIM-SM。
[SwitchB] vlan 23
[SwitchB-vlan23] port GigabitEthernet 3/0/3
[SwitchB-vlan23] quit
[SwitchB] interface Vlan-interface 23
[SwitchB-Vlan-interface23] ip address 10.23.1.2 24
[SwitchB-Vlan-interface23] pim sm
[SwitchB-Vlan-interface23] undo shutdown
[SwitchB-Vlan-interface23] quit
[SwitchB] interface GigabitEthernet 3/0/3
[SwitchB-GigabitEthernet3/0/3] undo shutdown
[SwitchB-GigabitEthernet3/0/3] quit
# 配置连接网络N1的接口及接口地址,使能PIM-SM和IGMP(缺省情况下,IGMP的版本为IGMPv2)。
[SwitchB] vlan 101
[SwitchB-vlan101] port GigabitEthernet 3/0/1
[SwitchB-vlan101] quit
[SwitchB] interface Vlan-interface 101
[SwitchB-Vlan-interface101] ip address 10.101.1.1 24
[SwitchB-Vlan-interface101] pim sm
[SwitchB-Vlan-interface101] igmp enable
[SwitchB-Vlan-interface101] undo shutdown
[SwitchB-Vlan-interface101] quit
[SwitchB] interface GigabitEthernet 3/0/1
[SwitchB-GigabitEthernet3/0/1] undo shutdown
[SwitchB-GigabitEthernet3/0/1] quit
(3) 配置C-RP和静态RP
# 指定VLAN接口23的IP地址为C-BSR和C-RP,其中C-RP的优先级为20。
[SwitchB] pim
[SwitchB-pim] c-bsr vlan-interface 23
[SwitchB-pim] c-rp vlan-interface 23 priority 20
# 指定Switch C的VLAN接口13的IP地址为静态RP的IP地址。
[SwitchB-pim] static-rp 10.13.1.3
[SwitchB-pim] quit
(4) 配置单播路由协议,以建立正确的单播路由表项
[SwitchB] ospf 1
[SwitchB-ospf-1] import-route direct
[SwitchB-ospf-1] area 0.0.0.0
[SwitchB-ospf-1-area-0.0.0.0] network 10.0.0.0 0.255.255.255
[SwitchB-ospf-1-area-0.0.0.0] quit
[SwitchB-ospf-1] quit
(1) 使能组播路由功能
<SwitchC> system-view
System View: return to User View with Ctrl+Z.
[SwitchC] multicast routing-enable
(2) 配置各接口及接口地址,并使能PIM-SM
# 配置连接SwitchA的接口及接口地址,使能PIM-SM。
[SwitchC] vlan 13
[SwitchC-vlan13] port GigabitEthernet 3/0/3
[SwitchC-vlan13] quit
[SwitchC] interface Vlan-interface 13
[SwitchC-Vlan-interface13] ip address 10.13.1.3 24
[SwitchC-Vlan-interface13] pim sm
[SwitchC-Vlan-interface13] undo shutdown
[SwitchC-Vlan-interface13] quit
[SwitchC] interface GigabitEthernet 3/0/3
[SwitchC-GigabitEthernet3/0/3] undo shutdown
[SwitchC-GigabitEthernet3/0/3] quit
# 配置连接SwitchB的接口及接口地址,使能PIM-SM。
[SwitchC] vlan 23
[SwitchC-vlan23] port GigabitEthernet 3/0/2
[SwitchC-vlan23] quit
[SwitchC] interface Vlan-interface 23
[SwitchC-Vlan-interface23] ip address 10.23.1.3 24
[SwitchC-Vlan-interface23] pim sm
[SwitchC-Vlan-interface23] undo shutdown
[SwitchC-Vlan-interface23] quit
[SwitchC] interface GigabitEthernet 3/0/2
[SwitchC-GigabitEthernet3/0/2] undo shutdown
[SwitchC-GigabitEthernet3/0/2] quit
# 配置连接网络N2的接口及接口地址,使能PIM-SM和IGMP(缺省情况下,IGMP的版本为IGMPv2)。
[SwitchC] vlan 102
[SwitchC-vlan102] port GigabitEthernet 3/0/1
[SwitchC-vlan102] quit
[SwitchC] interface Vlan-interface 102
[SwitchC-Vlan-interface102] ip address 10.102.1.1 24
[SwitchC-Vlan-interface102] pim sm
[SwitchC-Vlan-interface102] igmp enable
[SwitchC-Vlan-interface102] undo shutdown
[SwitchC-Vlan-interface102] quit
[SwitchC] interface GigabitEthernet 3/0/1
[SwitchC-GigabitEthernet3/0/1] undo shutdown
[SwitchC-GigabitEthernet3/0/1] quit
# 配置连接网络N3的接口及接口地址,使能PIM-SM和IGMP(缺省情况下,IGMP的版本为IGMPv2)。
[SwitchC] vlan 33
[SwitchC-vlan33] port GigabitEthernet 3/0/4
[SwitchC-vlan33] quit
[SwitchC] interface Vlan-interface 33
[SwitchC-Vlan-interface33] ip address 10.33.1.3 24
[SwitchC-Vlan-interface33] pim sm
[SwitchC-Vlan-interface33] igmp enable
[SwitchC-Vlan-interface33] undo shutdown
[SwitchC-Vlan-interface33] quit
[SwitchC] interface GigabitEthernet 3/0/4
[SwitchC-GigabitEthernet3/0/4] undo shutdown
[SwitchC-GigabitEthernet3/0/4] quit
(3) 配置静态RP。指定VLAN接口13的IP地址为静态RP的IP地址
[SwitchC] pim
[SwitchC-pim] static-rp 10.13.1.3
[SwitchC-pim] quit
(4) 配置单播路由协议,以建立正确的单播路由表项
[SwitchC] ospf 1
[SwitchC-ospf-1] import-route direct
[SwitchC-ospf-1] area 0.0.0.0
[SwitchC-ospf-1-area-0.0.0.0] network 10.0.0.0 0.255.255.255
(1) 按照如上配置后,查看配置信息发现Switch A、Switch B、Switch C两两之间建立PIM邻居关系。
# 查看SwitchA上的PIM邻居信息。
[SwtichA] display pim neighbor
VPN-Instance: public net
Total Number of Neighbors = 2
Neighbor Interface Uptime Expires Dr-Priority Mode
10.12.1.2 Vlan12 00:00:05 00:01:20 1
10.13.1.3 Vlan13 00:00:25 00:01:21 1
# 查看SwitchB上的PIM邻居信息。
[SwtichB] display pim neighbor
VPN-Instance: public net
Total Number of Neighbors = 2
Neighbor Interface Uptime Expires Dr-Priority Mode
10.12.1.1 Vlan12 00:00:05 00:01:40 1
10.23.1.3 Vlan23 00:00:20 00:01:41 1
# 查看SwitchC上的PIM邻居信息。
[SwtichC] display pim neighbor
VPN-Instance: public net
Total Number of Neighbors = 2
Neighbor Interface Uptime Expires Dr-Priority Mode
10.13.1.1 Vlan13 00:00:25 00:01:30 1
10.23.1.2 Vlan23 00:00:20 00:01:31 1
(2) 通过使用display pim rp-info命令可以查看PIM-SM域中的RP信息。
# 查看SwitchA上所有组播组对应的RP信息。
[SwitchA] display pim rp-info
VPN-Instance: public net
PIM-SM BSR RP information:
Group/MaskLen: 224.0.0.0/4
RP: 10.12.1.1
Priority: 10
HoldTime: 150
Uptime: 01:43:33
Expires: 00:01:57
PIM-SM static RP information:
Static RP: 10.13.1.3
Switch B、Switch C上的显示信息与Switch A类似。
(3) 查看交换机的PIM路由表信息
# Host A指定加入组播组G(225.1.1.1)后,查看Switch B上的PIM路由表信息,可以看出具体的(S,G)表项,(*,G)与(S,G)表项总数、PIM的模式、入接口、上游邻居、RPF邻居和下游接口信息。
[SwitchB] display pim routing-table
VPN-Instance: public net
Total 1 (*, G) entry; 1 (S, G) entry
(*, 225.1.1.1)
RP: 10.12.1.1
Protocol: pim-sm, Flag: WC
UpTime: 00:04:13
Upstream interface: Vlan-interface12
Upstream neighbor: 10.12.1.1
RPF prime neighbor: 10.12.1.1
Downstream interface(s) information:
Total number of downstreams: 1
1: Vlan-interface101
Protocol: igmp, UpTime: 00:04:13, Expires: -
(10.10.1.2, 225.1.1.1)
RP: 10.12.1.1
Protocol: pim-sm, Flag: SPT ACT
UpTime: 00:00:26
Upstream interface: Vlan-interface12
Upstream neighbor: 10.12.1.1
RPF prime neighbor: 10.12.1.1
Downstream interface(s) information:
Total number of downstreams: 1
1: Vlan-interface101
Protocol: pim-sm, UpTime: - , Expires: -
Switch A、Switch C上的显示信息与Switch B类似。
· Switch A
#
vlan 12 to 13
#
vlan 100
#
multicast routing-enable
#
interface Vlan-interface12
ip address 10.12.1.1 255.255.255.0
pim sm
#
interface Vlan-interface13
ip address 10.13.1.1 255.255.255.0
pim sm
#
interface Vlan-interface100
ip address 10.10.1.1 255.255.255.0
pim sm
#
interface LoopBack0
ip address 1.1.1.1 255.255.255.255
pim sm
#
interface GigabitEthernet3/0/1
port link-mode bridge
port access vlan 100
#
interface GigabitEthernet3/0/2
port link-mode bridge
port access vlan 12
#
interface GigabitEthernet3/0/3
port link-mode bridge
port access vlan 13
#
ospf 1
import-route direct
area 0.0.0.0
network 10.0.0.0 0.255.255.255
network 1.1.1.1 0.0.0.0
#
pim
c-bsr Vlan-interface12
c-rp Vlan-interface12 priority 10
static-rp 10.13.1.3
#
· Switch B
#
vlan 12
#
vlan 23
#
vlan 101
#
multicast routing-enable
#
interface Vlan-interface12
ip address 10.12.1.2 255.255.255.0
pim sm
#
interface Vlan-interface23
ip address 10.23.1.2 255.255.255.0
pim sm
#
interface Vlan-interface101
ip address 10.101.1.1 255.255.255.0
igmp enable
pim sm
#
interface GigabitEthernet3/0/1
port link-mode bridge
port access vlan 101
#
interface GigabitEthernet3/0/2
port link-mode bridge
port access vlan 12
#
interface GigabitEthernet3/0/3
port link-mode bridge
port access vlan 23
#
ospf 1
import-route direct
area 0.0.0.0
network 10.0.0.0 0.255.255.255
#
pim
c-bsr Vlan-interface23
c-rp Vlan-interface23 priority 20
static-rp 10.13.1.3
#
· Switch C
#
vlan 13
#
vlan 23
#
vlan33
#
vlan 102
#
multicast routing-enable
#
interface Vlan-interface13
ip address 10.13.1.3 255.255.255.0
pim sm
#
interface Vlan-interface23
ip address 10.23.1.3 255.255.255.0
pim sm
#
interface Vlan-interface33
ip address 10.33.1.3 255.255.255.0
igmp enable
pim sm
#
interface Vlan-interface102
ip address 10.102.1.1 255.255.255.0
igmp enable
pim sm
#
interface GigabitEthernet3/0/1
port link-mode bridge
port access vlan 102
#
interface GigabitEthernet3/0/2
port link-mode bridge
port access vlan 23
#
interface GigabitEthernet3/0/3
port link-mode bridge
port access vlan 13
#
interface GigabitEthernet3/0/4
port link-mode bridge
port access vlan 33
#
ospf 1
import-route direct
area 0.0.0.0
network 10.0.0.0 0.255.255.255
#
pim
static-rp 10.13.1.3
#
· 《H3C S12500系列路由交换机 IP组播配置指导》中的“PIM”
· 《H3C S12500系列路由交换机 IP组播命令参考》中的“PIM”
不同款型规格的资料略有差异, 详细信息请向具体销售和400咨询。H3C保留在没有任何通知或提示的情况下对资料内容进行修改的权利!