You are here: Cookbook > Routing > Realizing Multicast Forwarding Through PIM-SM Multicast Protocol

Realizing Multicast Forwarding Through PIM-SM Multicast Protocol

This example introduces how to configure the basic functions of PIM-SM to realize multicast forwarding so that users can receive data from any multicast source.

In the topology below, the multicast source sends data to the multicast group, and the multicast address is 225.0.0.1. The receivers PC1 and PC2 send IGMPv2 Report to join the multicast group, and the PIM domain adopts the PIM-SM mode. Assume that Device A is the candidate RP and candidate BSR, the interface loopback1 is the interface for electing the RP, and the interface eth0/1 is the multicast data inbound interface. By configuring the PIM-SM function on each device in the PIM domain, multicast data can be forwarded to the recipient PC in a normal multicast manner.

Configuration Steps

Step 1: Configure the IP address and unicast routing protocol of each device interface (OSPF is used in this example).

Device A

hostname(config)# interface ethernet0/1

hostname(config-if-eth0/1)# zone trust

hostname(config-if-eth0/1)# ip address 1.1.1.2/24

hostname(config-if-eth0/1)# exit

hostname(config)# interface ethernet0/2

hostname(config-if-eth0/1)# zone trust

hostname(config-if-eth0/1)# ip address 2.1.1.2/24

hostname(config-if-eth0/1)# exit

hostname(config)# ip vrouter trust-vr

hostname(config-vrouter)# router ospf

hostname(config-router)# router-id 1.1.1.1

hostname(config-router)# network 1.1.1.0/24 area 0

hostname(config-router)# network 2.1.1.0/24 area 0


Device B

hostname(config)# interface ethernet0/1

hostname(config-if-eth0/1)# zone trust

hostname(config-if-eth0/1)# ip address 2.1.1.2/24

hostname(config-if-eth0/1)# exit

hostname(config)# interface ethernet0/2

hostname(config-if-eth0/1)# zone trust

hostname(config-if-eth0/1)# ip address 3.1.1.2/24

hostname(config-if-eth0/1)# exit

hostname(config)# ip vrouter trust-vr

hostname(config-vrouter)# router ospf

hostname(config-router)# router-id 2.2.2.2

hostname(config-router)# network 2.1.1.0/24 area 0

hostname(config-router)# network 3.1.1.0/24 area 0


Device C

hostname(config)# interface ethernet0/1

hostname(config-if-eth0/1)# zone trust

hostname(config-if-eth0/1)# ip address 2.1.1.3/24

hostname(config-if-eth0/1)# exit

hostname(config)# interface ethernet0/2

hostname(config-if-eth0/1)# zone trust

hostname(config-if-eth0/1)# ip address 4.1.1.1/24

hostname(config-if-eth0/1)# exit

hostname(config)# ip vrouter trust-vr

hostname(config-vrouter)# router ospf

hostname(config-router)# router-id 3.3.3.3

hostname(config-router)# network 2.1.1.0/24 area 0

hostname(config-router)# network 4.1.1.0/24 area 0

Step 2: Enable a multicast route.

Device A

hostname(config)# ip vrouter trust-vr

hostname(config-vrouter)# ip multicast-routing

hostname(config-vrouter)# exit

hostname(config)#


Device B

hostname(config)# ip vrouter trust-vr

hostname(config-vrouter)# ip multicast-routing

hostname(config-vrouter)# exit

hostname(config)#


Device C

hostname(config)# ip vrouter trust-vr

hostname(config-vrouter)# ip multicast-routing

hostname(config-vrouter)# exit

hostname(config)#

Step 3: Enable and configure PIM-SM.

Device A

hostname(config)# ip vrouter trust-vr

hostname(config-vrouter))# router pim

hostname(config-vrouter)# pim-sm enable

hostname(config-vrouter))# exit

hostname(config)#interface ethernet0/1

hostname(config-if-eth0/1)# ip pim sparse-mode

hostname(config-if-eth0/1)# exit

hostname(config)#interface ethernet0/2

hostname(config-if-eth0/2)# ip pim sparse-mode


Device B

hostname(config)# ip vrouter trust-vr

hostname(config-vrouter))# router pim

hostname(config-vrouter)# pim-sm enable

hostname(config-vrouter))# exit

hostname(config)#interface ethernet0/1

hostname(config-if-eth0/1)# ip pim sparse-mode

hostname(config-if-eth0/1)# exit

hostname(config)#interface ethernet0/2

hostname(config-if-eth0/2)# ip pim sparse-mode


Device C

hostname(config)# ip vrouter trust-vr

hostname(config-vrouter))# router pim

hostname(config-vrouter)# pim-sm enable

hostname(config-vrouter))# exit

hostname(config)#interface ethernet0/1

hostname(config-if-eth0/1)# ip pim sparse-mode

hostname(config-if-eth0/1)# exit

hostname(config)#interface ethernet0/2

hostname(config-if-eth0/2)# ip pim sparse-mode

Step 4: Configure RP and Candidate BSR.

Device A

hostname(config)# interface loopback1

hostname(config-if-loo1))# zone trust

hostname(config-if-loo1)# ip address 2.2.2.2/24

hostname(config-if-loo1)# ip pim sparse-mode

hostname(config-if-loo1))# exit

hostname(config)# ip vrouter trust-vr

hostname(config-vrouter)# rp-candidate loopback1

hostname(config-vrouter)# bsr-candidate loopback1

hostname(config-vrouter))# exit

hostname(config)#

Step 5: Verify result.

Device A

hostname(config)# show ip mroute

U:interface up D:interface down

V:valid multicast entry I:invalid multicast entry Y:sync multicast entry

==============================================================================

source: 1.1.1.2 group : 225.0.0.1 vrouter: trust-vr

status: V update time: -

ingress interface: ethernet0/1(U)

egress interface : ethernet0/2(U)

==============================================================================

hostname(config)# show ip pim rp

PIM Rendezvous Point for Virtual Router <trust-vr>

==============================================================================

Group: 225.0.0.1, RP:2.2.2.2, v2, via bootstrap, priority 0 holdtime 35.

==============================================================================

hostname(config)# show ip pim bsr-router

PIM Bootstrap Router for Virtual Router <trust-vr>

==============================================================================

PIMv2 Bootstrap information

BSR address: 2.2.2.2

BSR Priority: 0

==============================================================================