好消息,超酷的在线虚拟网络实验室上线了!点击开始实验

为获得更好的浏览效果,建议您使用 Firefox 或者 Chrome 浏览器



 

5.3.1  PIM SM 配置举例

 

组网需求

RouterARouterBRouterC组成一个PIM-SM的组播网络,其中RouterA连接组播源,RouterBRouterC连接不同的接收者,RouterA作为RPBSR。如组网图所示:

  配置思路

l           RouterARouterBRouterC上分别配置单播路由协议,使各设备和组播源、接收者

    之间路由可达

 

l           RouterARouterBRouterC上分别使能组播路由协议,并配置各接口的PIM-SM

   议,连接接收者的接口配置IGMPv2协议

 

l           RouterA上配置C-RPC-BSR

 

配置步骤

 

设备A的配置

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

#

 

 

设备B的配置

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

#

 

设备C的配置

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: 00:13:46

     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: 00:13:46, Expires: 00:03:06

 

 (10.10.1.2, 225.1.1.1)

     RP: 1.1.1.1

     Protocol: pim-sm, Flag: SPT ACT

     UpTime: 00:00:42

     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: 00:00:42, Expires: 00:03:06

 

 

 

X Close
X Close