5.2.1 PIM DM 配置举例
组网需求
RouterA、RouterB和RouterC组成一个PIM-DM的组播网络,其中RouterA连接组播源,RouterB和RouterC连接不同的接收者。如组网图所示:
l RouterA、RouterB和RouterC上分别配置单播路由协议,使各设备和组播源、接收者之间路由可达
l
RouterA、RouterB和RouterC上分别使能组播路由协议,并配置各接口的PIM-DM协议,连接接收者的接口配置IGMPv2协议
1、配置步骤
#全局启动组播路由
[RouterA]multicast
routing-enable
#配置连接组播源的接口地址,并且启用PIM-DM协议
[RouterA]interface
gigabitethernet3/1/1
[RouterA-GigabitEthernet3/1/1]ip
address 10.10.1.1 24
[RouterA-GigabitEthernet3/1/1]pim
dm
#配置连接RouterB的接口地址,并且启用PIM-DM协议
[RouterA]interface
gigabitethernet3/1/3
[RouterA-GigabitEthernet3/1/3]ip
address 10.30.1.1 24
[RouterA-GigabitEthernet3/1/3]pim
dm
#配置连接RouterC的接口地址,并且启用PIM-DM协议
[RouterA]interface
gigabitethernet3/1/2
[RouterA-GigabitEthernet3/1/2]ip
address 10.20.1.1 24
[RouterA-GigabitEthernet3/1/2]pim
dm
#发布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 dm
#
interface
GigabitEthernet3/1/2
ip address 10.20.1.1
255.255.255.0
pim dm
#
interface
GigabitEthernet3/1/3
ip address 10.30.1.1
255.255.255.0
pim dm
#
ospf
1
import-route direct
area 0.0.0.0
network 10.0.0.0
0.255.255.255
#
1、配置步骤
#全局启动组播路由
[RouterB]multicast
routing-enable
#配置连接RouterA的接口地址,并且启用PIM-DM协议
[RouterB]interface
gigabitethernet3/1/3
[RouterB-GigabitEthernet3/1/3]ip
address 10.30.1.2 24
[RouterB-GigabitEthernet3/1/3]pim
dm
#配置连接RouterC的接口地址,并且启用PIM-DM协议
[RouterB]interface
gigabitethernet3/1/2
[RouterB-GigabitEthernet3/1/2]ip
address 10.40.1.1 24
[RouterB-GigabitEthernet3/1/2]pim
dm
#配置连接HostA的接口地址,并且启用PIM-DM和IGMPv2协议
[RouterB]interface
gigabitethernet3/1/1
[RouterB-GigabitEthernet3/1/1]ip
address 10.101.1.1 24
[RouterB-GigabitEthernet3/1/1]pim
dm
[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 dm
igmp enable
#
interface
GigabitEthernet3/1/2
ip address 10.40.1.1
255.255.255.0
pim dm
#
interface
GigabitEthernet3/1/3
ip address 10.30.1.2
255.255.255.0
pim dm
#
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-DM协议
[RouterC]interface
gigabitethernet3/1/2
[RouterC-GigabitEthernet3/1/2]ip
address 10.20.1.2 24
[RouterC-GigabitEthernet3/1/2]pim
dm
#配置连接RouterB的接口地址,并且启用PIM-DM协议
[RouterC]interface
gigabitethernet3/1/3
[RouterC-GigabitEthernet3/1/3]ip
address 10.40.1.2 24
[RouterC-GigabitEthernet3/1/3]pim
dm
#配置连接HostB的接口地址,并且启用PIM-DM和IGMPv2协议
[RouterC]interface
gigabitethernet3/1/1
[RouterC-GigabitEthernet3/1/1]ip
address 10.102.1.1 24
[RouterC-GigabitEthernet3/1/1]pim
dm
[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 dm
igmp enable
#
interface
GigabitEthernet3/1/2
ip address 10.40.1.1
255.255.255.0
pim dm
#
interface
GigabitEthernet3/1/3
ip address 10.20.1.2
255.255.255.0
pim dm
#
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-dm, 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-dm, 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-dm, UpTime: