5.3.1 PIM SM
配置举例
组网需求
RouterA、RouterB和RouterC组成一个PIM-SM的组播网络,其中RouterA连接组播源,RouterB和RouterC连接不同的接收者,RouterA作为RP和BSR。如组网图所示:
l RouterA、RouterB和RouterC上分别配置单播路由协议,使各设备和组播源、接收者
之间路由可达
l RouterA、RouterB和RouterC上分别使能组播路由协议,并配置各接口的PIM-SM协
议,连接接收者的接口配置IGMPv2协议
l
RouterA上配置C-RP和C-BSR
1、配置步骤
#全局启动组播路由
[RouterA]multicast
routing-enable
#配置作为BSR和RP的环回口,此接口必须配置PIM-SM
[RouterA]interface
LoopBack 0
[RouterA-LoopBack0]ip
address 1.1.1.1 32
[RouterA-LoopBack0]pim
sm
#配置连接组播源的接口地址,并且启用PIM-SM协议
[RouterA]interface
gigabitethernet3/1/1
[RouterA-GigabitEthernet3/1/1]ip
address 10.10.1.1 24
[RouterA-GigabitEthernet3/1/1]pim
sm
#配置连接RouterB的接口地址,并且启用PIM-SM协议
[RouterA]interface
gigabitethernet3/1/3
[RouterA-GigabitEthernet3/1/3]ip
address 10.30.1.1 24
[RouterA-GigabitEthernet3/1/3]pim
sm
#配置连接RouterC的接口地址,并且启用PIM-SM协议
[RouterA]interface
gigabitethernet3/1/2
[RouterA-GigabitEthernet3/1/2]ip
address 10.20.1.1 24
[RouterA-GigabitEthernet3/1/2]pim
sm
#配置网络中的BSR和RP
[RouterA]pim
[RouterA-pim]c-bsr
LoopBack 0
[RouterA-pim]c-rp
LoopBack 0
#发布PIM接口单播路由
[RouterA]ospf
[RouterA-ospf-1]import-route
direct
[RouterA-ospf-1]area
0.0.0.0
[RouterA-ospf-1-area-0.0.0.0]network
10.0.0.0 0.255.255.255
2、配置文件
#
multicast
routing-enable
#
interface
GigabitEthernet3/1/1
ip address 10.10.1.1
255.255.255.0
pim sm
#
interface
GigabitEthernet3/1/2
ip address 10.20.1.1
255.255.255.0
pim sm
#
interface
GigabitEthernet3/1/3
ip address 10.30.1.1
255.255.255.0
pim sm
#
interface
LoopBack0
ip address 1.1.1.1 255.255.255.255
pim sm
#
ospf
1
import-route direct
area 0.0.0.0
network 10.0.0.0
0.255.255.255
#
pim
c-bsr LoopBack 0
c-rp LoopBack 0
#
1、配置步骤
#全局启动组播路由
[RouterB]multicast
routing-enable
#配置连接RouterA的接口地址,并且启用PIM-SM协议
[RouterB]interface
gigabitethernet3/1/3
[RouterB-GigabitEthernet3/1/3]ip
address 10.30.1.2 24
[RouterB-GigabitEthernet3/1/3]pim
sm
#配置连接RouterC的接口地址,并且启用PIM-SM协议
[RouterB]interface
gigabitethernet3/1/2
[RouterB-GigabitEthernet3/1/2]ip
address 10.40.1.1 24
[RouterB-GigabitEthernet3/1/2]pim
sm
#配置连接HostA的接口地址,并且启用PIM-SM和IGMPv2协议
[RouterB]interface
gigabitethernet3/1/1
[RouterB-GigabitEthernet3/1/1]ip
address 10.101.1.1 24
[RouterB-GigabitEthernet3/1/1]pim
sm
[RouterC-GigabitEthernet3/1/1]igmp
enable
#发布PIM接口单播路由
[RouterB]ospf
[RouterB-ospf-1]import-route
direct
[RouterB-ospf-1]area
0.0.0.0
[RouterB-ospf-1-area-0.0.0.0]network 10.0.0.0 0.255.255.255
2、配置文件
#
multicast
routing-enable
#
interface
GigabitEthernet3/1/1
ip address 10.101.1.1
255.255.255.0
pim sm
igmp enable
#
interface
GigabitEthernet3/1/2
ip address 10.40.1.1
255.255.255.0
pim sm
#
interface
GigabitEthernet3/1/3
ip address 10.30.1.2
255.255.255.0
pim sm
#
ospf
1
import-route direct
area 0.0.0.0
network 10.0.0.0
0.255.255.255
#
1、配置步骤
#全局启动组播路由
[RouterC]multicast
routing-enable
#配置连接RouterA的接口地址,并且启用PIM-SM协议
[RouterC]interface
gigabitethernet3/1/2
[RouterC-GigabitEthernet3/1/2]ip
address 10.20.1.2 24
[RouterC-GigabitEthernet3/1/2]pim
sm
#配置连接RouterB的接口地址,并且启用PIM-SM协议
[RouterC]interface
gigabitethernet3/1/3
[RouterC-GigabitEthernet3/1/3]ip
address 10.40.1.2 24
[RouterC-GigabitEthernet3/1/3]pim
sm
#配置连接HostB的接口地址,并且启用PIM-SM和IGMPv2协议
[RouterC]interface
gigabitethernet3/1/1
[RouterC-GigabitEthernet3/1/1]ip
address 10.102.1.1 24
[RouterC-GigabitEthernet3/1/1]pim
sm
[RouterC-GigabitEthernet3/1/1]igmp
enable
#发布PIM接口单播路由
[RouterC]ospf
[RouterC-ospf-1]import-route
direct
[RouterC-ospf-1]area
0.0.0.0
[RouterC-ospf-1-area-0.0.0.0]network 10.0.0.0 0.255.255.255
2、配置文件
#
multicast
routing-enable
#
interface
GigabitEthernet3/1/1
ip address 10.102.1.1
255.255.255.0
pim sm
igmp enable
#
interface
GigabitEthernet3/1/2
ip address 10.40.1.1
255.255.255.0
pim sm
#
interface
GigabitEthernet3/1/3
ip address 10.20.1.2
255.255.255.0
pim sm
#
ospf
1
import-route direct
area 0.0.0.0
network 10.0.0.0
0.255.255.255
#
可通过以下方式验证上述配置:
假如HostA需要接收组播组G(225.1.1.1)的信息,通过使用display pim
routing-table命令可以查看路由器的PIM路由表信息。
#查看RouterB上的PIM路由表信息:
[RouterB]
display pim routing-table
Total
1 (*, G) entry; 1 (S, G) entry
(*,
225.1.1.1)
RP: 1.1.1.1
Protocol: pim-sm, Flag: WC
UpTime:
Upstream interface: GigabitEthernet3/1/3
Upstream neighbor: 10.30.1.1
RPF prime neighbor: 10.30.1.1
Downstream interface(s) information:
Total number of downstreams: 1
1: GigabitEthernet3/1/1
Protocol: igmp, UpTime:
(10.10.1.2,
225.1.1.1)
RP: 1.1.1.1
Protocol: pim-sm, Flag: SPT ACT
UpTime:
Upstream interface: GigabitEthernet3/1/3
Upstream neighbor: 10.30.1.1
RPF prime neighbor: 10.30.1.1
Downstream interface(s) information:
Total number of downstreams: 1
1: GigabitEthernet3/1/1
Protocol: pim-sm, UpTime: