---
title: PIM-ASM Configuration
slug: enterprise-v5p2/pim-asm-configuration
createdAt: 2025-12-03T04:50:14.021Z
---

# <font color="#1d50a2">Introduction</font>

PIM stands for Protocol Independent Multicast, which means it can utilize the unicast routing table generated by static routing or any unicast routing protocol (including RIP, OSPF, IS-IS, BGP, etc.) to provide routing for IP multicast. Multicast routing is independent of the unicast routing protocol used, as long as the corresponding multicast routing table entries can be generated through the unicast routing protocol. As a multicast routing solution, it directly leverages the routing information from the unicast routing table to perform RPF (Reverse Path Forwarding) checks on multicast packets. Once the checks are passed, multicast routing table entries are created to forward the multicast packets. As an intra-domain multicast routing protocol, PIM supports two modes: dense mode (PIM-DM) and sparse mode (PIM-SM).

PIM-SM (ASM) operates as a sparse network model, and its implementation involves the following key aspects:

- Maintenance of a critical PIM router in the network: the Rendezvous Point (RP), which serves any group members or multicast sources that may appear. All PIM routers in the network are aware of the RP's location.
- When a group member appears (a user host joins a multicast group G via IGMP), the last-hop router sends a Join message toward the RP. This process creates (\*, G) entries hop-by-hop, forming a Rendezvous Point Tree (RPT) rooted at the RP.
- When an active multicast source emerges (the source sends the first multicast packet to group G), the first-hop router encapsulates the multicast data in Register messages and unicasts them to the RP. The RP then creates (S, G) entries, registering the source information.

# <font color="#1d50a2">Basic Concepts</font>

## <font color="#1d50a2">RPT Check</font>

The router looks up the egress interface corresponding to the multicast source or RP in the unicast routing table (when using SPT, it looks up the egress interface for the multicast source; when using RPT, it looks up the egress interface for the RP). This egress interface is the RPF interface. If the multicast packet is received from the RPF interface, the RPF check passes, and the packet is forwarded to downstream interfaces; otherwise, it is discarded. In addition to correctly forwarding packets according to the multicast routing configuration, the RPF check can also prevent potential loops.

## <font color="#1d50a2">Neighbor Discovery</font>

On a PIM router, every interface enabled with the PIM protocol will send out Hello messages. The Hello message is encapsulated in a multicast packet with a destination address of 224.0.0.13 (representing all PIM routers on the same network segment), a source address of the interface’s IP address, and a TTL value of 1.

The purpose of the Hello message is to: discover PIM neighbors, negotiate various PIM protocol parameters, and maintain neighbor relationships.

## <font color="#1d50a2">DR Election</font>

On a network segment where multicast sources or group members are located, multiple PIM routers are typically connected. These PIM routers become neighbors by exchanging Hello messages, which carry DR priority and the interface address of the segment. Each PIM router compares its own conditions with the information in the received Hello messages to elect a Designated Router (DR), which will be responsible for sending and receiving multicast packets on behalf of the source or group members. The election rules are as follows:

- The router with the higher DR priority wins (provided all PIM routers on the segment support DR priority).
- If DR priorities are equal, or if at least one PIM router on the segment does not support carrying DR priority in Hello messages, the router with the higher IP address wins.If the current DR fails, PIM neighbor relationships will timeout, triggering a new round of DR election among the remaining PIM neighbors.

In the ASM model, the DR primarily serves the following functions:

- On a shared segment connected to a multicast source, the DR is responsible for sending Register messages to the RP. The DR connected to the multicast source is referred to as the source-side DR.
- On a shared segment connected to group members, the DR is responsible for sending Join messages toward the RP. The DR connected to group members is referred to as the member-side DR.

## <font color="#1d50a2">RP Discovery</font>

The Rendezvous Point (RP) is a critical PIM router in the network, responsible for processing registration messages from source-side DRs and handling join requests from group members. All PIM routers in the network must be aware of the RP’s address, which functions as a central hub for coordinating multicast supply and demand information.

A single RP can serve multiple multicast groups simultaneously, but each multicast group can be associated with only one RP. Currently, the RP can be configured using the following methods:

**Static RP**: The same RP address is manually configured on all PIM routers in the network, statically defining the location of the RP.

**Dynamic RP**: Several PIM routers within the PIM domain are configured as Candidate-RPs (C-RPs) to dynamically participate in RP election. Additionally, a Candidate-BSR (C-BSR) must be configured and elected as the Bootstrap Router (BSR). The BSR collects advertisement messages from C-RPs and distributes the RP information to all PIM routers within the PIM-SM domain.&#x20;

## <font color="#1d50a2">RPT Construction</font>

The PIM-SM RPT (Rendezvous Point Tree) is a multicast distribution tree with the RP as its root and PIM routers connected to group members as leaves. When a group member appears (e.g., a user host joins multicast group G via IGMP), the member-side DR sends a Join message toward the RP. This process creates (\*, G) entries hop-by-hop along the path to the RP, forming an RPT rooted at the RP.

During RPT construction, each PIM router performing the Join message forwarding conducts an RPF check: it looks up the unicast route to the RP, where the egress interface of this route is considered the upstream interface, and the next hop becomes the RPF neighbor. The Join message is then forwarded hop by hop from the member-side DR until it reaches the RP.

## <font color="#1d50a2">Multicast Source Registration</font>

In a PIM-SM network, any newly active multicast source must first "register" with the RP before its multicast traffic can be delivered to group members. The detailed process is as follows:

- The multicast source sends multicast packets to the source-side DR.
- Upon receiving these multicast packets, the source-side DR encapsulates them within Register messages and forwards them to the RP.
- After receiving the Register message, the RP decapsulates it, creates an (S, G) entry, and forwards the multicast data along the RPT to reach group members.

## <font color="#1d50a2">Assert</font>

When multiple PIM routers connected to the same network segment pass the RPF check and attempt to forward multicast packets to that segment, the Assert mechanism is used to ensure that only one PIM router forwards multicast packets to the segment. After receiving identical multicast packets from a neighbor router, a PIM router multicasts an Assert message to all PIM routers on the local segment, using the permanent group address 224.0.0.13 as the destination. Upon receiving the Assert message, other PIM routers compare their own parameters with those carried in the received message to participate in an Assert election. The election rules are as follows:

The router with the higher unicast routing protocol priority wins.

- If priorities are equal, the router with the lower cost to the multicast source wins.
- If all of the above are identical, the router with the highest IP address on the downstream interface wins.

Based on the Assert election result, routers perform the following actions:

- The winning router's downstream interface is called the Assert Winner and is responsible for forwarding subsequent multicast packets to the segment.
- The losing router's downstream interface is called the Assert Loser and will cease forwarding multicast packets to the segment. The PIM router also removes this interface from the downstream interface list in the (S, G) entry.

After the Assert election, only one downstream interface remains active on the segment, forwarding only one copy of the multicast traffic. All Assert Losers may periodically resume multicast packet forwarding, triggering recurring Assert elections.

# <font color="#1d50a2">PIM Basic Configuration</font>

## <font color="#1d50a2">PIM Interface</font>

| **Operation**                        | **Command**                            | **Description**                                                                                   |
| ------------------------------------ | -------------------------------------- | ------------------------------------------------------------------------------------------------- |
| Enter the system  configuration view | **configure  terminal**                |                                                                                                   |
| Enter interface view                 | **interface ethernet** *interface\_id* | *interface\_id*  refers to the interface identifier, which can also be a VLANIf/LAGIf  interface. |
| Enable PIM                           | **ip pim**                             | Enable PIM on the interface                                                                       |
| Enable multicast routing  forwarding | **multicast-enable**                   | Enable multicast routing forwarding on the  interface                                             |

## <font color="#1d50a2">Static RP Configuration</font>

| **Operation**                        | **Command**                        | **Description**                                                                            |
| ------------------------------------ | ---------------------------------- | ------------------------------------------------------------------------------------------ |
| Enter the system  configuration view | **configure  terminal**            |                                                                                            |
| Config statis RP address             | **ip pim rp** *A.B.C.D  A.B.C.D/M* | *A.B.C.D*  represents the RP address; *A.B.C.D/M* represents the multicast group  address. |

##

| **Operation**                                                   | **Command**                                                                                                            | **Description**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| --------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Enter the system configuration view                             | **configure terminal**                                                                                                 |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| Config C-BSR address                                            | **ip pim bsr candidate-bsr source&#x20;***interface*                                                                   | Specify the IP address of the C-BSR.                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| Config C-BSR priority                                           | **ip pim bsr candidate-bsr priority&#x20;***priority*                                                                  | Configure C-BSR priority, default 64, range: 0-255; a larger value indicates higher priority.<br />The rules for C-BSR to compete for BSR are as follows:<br />1. C-BSR priority, the larger the ID, the higher the priority.<br />2. C-BSR IP address, the larger the address, the higher the priority.                                                                                                                                                                                          |
| Config C-RP address                                             | **ip pim bsr candidate-rp source&#x20;***interface&#x20;***inteval&#x20;***interval&#x20;***priority&#x20;***priority* | Specify the C-RP IP address, advertisement interval, and priority. Priority defaults to 192, range 0-255; a smaller value indicates higher priority.<br />The rules for C-RP to compete for RP are as follows:<br />1. Mask length of the multicast group range covered by the C-RP<br />2. C-RP priority, the smaller the ID, the higher the priority<br />3. Hash value, the larger the value, the higher the priority<br />4. C-RP IP address, the larger the address, the higher the priority |
| Configure the multicast group address range covered by the C-RP | **ip pim bsr candidate-rp group&#x20;***A.B.C.D/M*                                                                     | A.B.C.D/M is the multicast group address segment. During C-RP election, the longest mask match of the multicast address range has higher priority.                                                                                                                                                                                                                                                                                                                                                |

## <font color="#1d50a2"> Source-side DR Configuration</font>

| **Operation**                            | **Command**                                 | **Description**                                                                         |
| ---------------------------------------- | ------------------------------------------- | --------------------------------------------------------------------------------------- |
| Enter the system configuration view      | **configure terminal**                      |                                                                                         |
| Enter interface view                     | **interface ethernet&#x20;***interface\_id* | Interface connected to the multicast source.                                            |
| Enable PIM functionality.                | **ip pim**                                  | Enable PIM on the interface.                                                            |
| Enable multicast routing and forwarding. | **multicast-enable**                        | Enable multicast routing and forwarding on the interface.                               |
| Enable source‑side DR registration.      | **unknown-multicast trap**                  | Enable unknown multicast traffic to be sent to the CPU for source‑side DR registration. |

## <font color="#1d50a2">Static Mroute Configuration</font>

| **Operation**                        | **Command**                                             | **Description**                                                                                                                                                                                                                                                       |
| ------------------------------------ | ------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Enter the system  configuration view | **configure  terminal**                                 |                                                                                                                                                                                                                                                                       |
| Enter interface view                 | **interface ethernet** *interface\_id*                  | *interface\_id*  refers to the interface identifier, which can also be a VLANIf/LAGIf  interface.                                                                                                                                                                     |
| Config static Mroute  entry          | **ip mroute ethernet** *interface\_id  A.B.C.D A.B.C.D* | *interface\_id*  refers to the outgoing interface in the multicast routing table entry; *A.B.C.D*  represent the parameters of the (S, G) entry.   When configuring static multicast routes, ensure that both the interface and  outgoing interface have PIM enabled. |

## <font color="#1d50a2">Source-side DR Configuration</font>

| **Operation**                            | **Command**                                 | **Description**                                                                         |
| ---------------------------------------- | ------------------------------------------- | --------------------------------------------------------------------------------------- |
| Enter the system configuration view      | **configure terminal**                      |                                                                                         |
| Enter interface view                     | **interface ethernet&#x20;***interface\_id* | Interface connected to the multicast source.                                            |
| Enable PIM functionality.                | **ip pim**                                  | Enable PIM on the interface.                                                            |
| Enable multicast routing and forwarding. | **multicast-enable**                        | Enable multicast routing and forwarding on the interface.                               |
| Enable source‑side DR registration.      | **unknown-multicast trap**                  | Enable unknown multicast traffic to be sent to the CPU for source‑side DR registration. |

##

| **Operation**           | **Command**               |
| ----------------------- | ------------------------- |
| View the PIM interface  | **show ip pim interface** |
| View the PIM neighbors  | **show ip pim neighbors** |
| View the RP address     | **show ip pim rp-info**   |
| View the Mroute entries | **show ip mroute**        |
| View the RPF interface  | **show ip pim rpf**       |

# <font color="#1d50a2">Configuration Example</font>

## <font color="#1d50a2">Static RP Configuration Example</font>

The host and the multicast source are interconnected at Layer 3 through three switches, with all switches running the OSPF protocol. The requirement is to enable the host (PC) to access video services from the multicast source via the Layer 3 network through video-on-demand.

::Image[]{src="https://app.archbee.com/api/optimize/zl-MD6bX0o2Ab3p8w66u1/i7tfiQ2G5rCU3qYhuG6G9-20251203-045410.png" size="62" width="847" height="477" position="center" showCaption="false"}

<font color="#1d50a2">**Procedure**</font>

1. Device A
   \# Configure ip address of interfaces

```text
sonic(config)# interface ethernet 1
sonic(config-if-1)# ip address 30.1.1.2/30
sonic(config)# interface ethernet 2
sonic(config-if-2)# ip address 20.1.1.1/30
```

:::Paragraph{indent="1"}
\# Configure ospf neighbor and distribute route
:::

```text
sonic(config)# router ospf
sonic(config-router)# ospf router-id 30.1.1.2
sonic(config-router)# network 30.1.1.0/30 area 0.0.0.0
sonic(config-router)# network 20.1.1.0/30 area 0.0.0.0
```

:::Paragraph{indent="1"}
\# Configure the PIM interface, enable multicast routing and forwarding, set a static RP address, and activate the source-side DR's capability to forward unknown multicast traffic.
:::

```text
sonic(config)# interface ethernet 1
sonic(config-if-1)# multicast-enable
sonic(config-if-1)# ip pim
sonic(config)# interface ethernet 2
sonic(config-if-2)# multicast-enable
sonic(config-if-2)# ip pim
sonic(config)# ip pim rp 20.1.1.2 224.1.1.0/24
sonic(config)# unknown-multicast trap
```

2. Device B
   \# Configure ip address of interfaces

```text
sonic(config)# interface ethernet 1
sonic(config-if-1)# ip address 10.1.1.1/30
sonic(config)# interface ethernet 2
sonic(config-if-2)# ip address 20.1.1.2/30
```

:::Paragraph{indent="1"}
\# Configure ospf neighbor and distribute route
:::

```text
sonic(config)# router ospf
sonic(config-router)# ospf router-id 20.1.1.2
sonic(config-router)# network 10.1.1.0/30 area 0.0.0.0
sonic(config-router)# network 20.1.1.0/30 area 0.0.0.0
```

:::Paragraph{indent="1"}
\# Configure the PIM interface, enable multicast routing and forwarding, set a static RP address, and activate the source-side DR's capability to forward unknown multicast traffic.
:::

```text
sonic(config)# interface ethernet 1
sonic(config-if-1)# multicast-enable
sonic(config-if-1)# ip pim
sonic(config)# interface ethernet 2
sonic(config-if-2)# multicast-enable
sonic(config-if-2)# ip pim
sonic(config)# ip pim rp 20.1.1.2 224.1.1.0/24
```

3. Device C
   \# Configure ip address of interfaces

```text
sonic(config)# vlan 100
sonic(config)# interface ethernet 10
sonic(config-if-10)# switchport access vlan 100
sonic(config)# interface ethernet 1
sonic(config-if-1)# ip address 10.1.1.2/30
sonic(config)# interface vlan 100
sonic(config-vlanif-100)# ip address 100.1.1.1/24
sonic(config-vlanif-100)# exit
```

:::Paragraph{indent="1"}
\# Configure ospf neighbor and distribute route
:::

```text
sonic(config)# router ospf
sonic(config-router)# ospf router-id 10.1.1.2
sonic(config-router)# network 100.1.1.0/24 area 0.0.0.0
sonic(config-router)# network 10.1.1.0/30 area 0.0.0.0
```

:::Paragraph{indent="1"}
\# Configure the PIM interface, enable multicast routing and forwarding, set a static RP address, and activate the source-side DR's capability to forward unknown multicast traffic.
:::

```text
sonic(config)# interface ethernet 1
sonic(config-if-1)# multicast-enable
sonic(config-if-1)# ip pim
sonic(config)# interface vlan 100
sonic(config-vlanif-100)# ip igmp
sonic(config-vlanif-100)# ip pim
sonic(config)# ip pim rp 20.1.1.2 224.1.1.0/24
```

<font color="#1d50a2">**Verify configuration**</font>

The PC initiates a video-on-demand request for multicast source video services. Devices A, B, and C can dynamically establish PIM entries and perform guided forwarding.

## <font color="#1d50a2">Dynamic RP Configuration Example</font>

The host and multicast source are interconnected via four Layer-3 switches, all running OSPF protocol. The host PC is required to be able to request video services from the multicast source over the Layer-3 network. The network uses dynamic RP; if the RP fails, a new RP can be elected to continue providing services.

Taking the following topology as an example: Device B and Device C are configured as C-RPs covering the multicast range 224.1.1.0/24. By setting priorities, Device B is elected as the RP, and Device C serves as the backup C-RP. When Device B fails, Device C can be elected as the new RP to continue service.

::Image[]{src="https://api.archbee.com/api/optimize/zl-MD6bX0o2Ab3p8w66u1/chqhPOXBHi9lsDSw-49KO-20251226-025310.png" size="32" width="514" height="570" position="center" showCaption="false"}

**Procedure:**

Device A

\# Configure an IP address and Loopback0 address for the interface.

```text
sonic(config)# interface ethernet 9
sonic(config-if-9)# ip address 10.1.1.2/24
sonic(config)# interface ethernet 7
sonic(config-if-7)# ip address 20.1.1.1/24
sonic(config)# interface ethernet 8
sonic(config-if-8)# ip address 21.1.1.1/24
sonic(config)# interface loopback 0
sonic(config-loif-0)# ip address 120.1.1.217/32
```

\# Configure OSPF neighbors and advertise routes.

```text
sonic(config)# router ospf
sonic(config-router)# ospf router-id 120.1.1.217
sonic(config-router)# network 10.1.1.0/24 area 0.0.0.0
sonic(config-router)# network 20.1.1.0/24 area 0.0.0.0
sonic(config-router)# network 21.1.1.0/24 area 0.0.0.0
sonic(config-router)# network 120.1.1.217/32 area 0.0.0.0
```

\# Configure PIM on the interface, enable multicast routing and forwarding, and enable source-side DR to forward unknown multicast traffic to the CPU.

```text
sonic(config)# interface ethernet 9
sonic(config-if-9)# multicast-enable
sonic(config-if-9)# ip pim
sonic(config)# interface ethernet 7
sonic(config-if-7)# multicast-enable
sonic(config-if-7)# ip pim
sonic(config)# interface ethernet 8
sonic(config-if-8)# multicast-enable
sonic(config-if-8)# ip pim
sonic(config)# interface loopback 0
sonic(config-loif-0)# ip pim
sonic(config)# unknown-multicast trap
```

\# Configure C-BSR, specifying the priority and IP address of the C-BSR.

```text
sonic(config)# ip pim bsr candidate-bsr source interface loopback 0 priority 200
```

Device B

\# Configure an IP address and Loopback0 address for the interface.

```text
sonic(config)# interface ethernet 11
sonic(config-if-11)# ip address 20.1.1.2/24
sonic(config)# interface ethernet 47
sonic(config-if-47)# ip address 30.1.1.1/24
sonic(config)# interface ethernet 1
sonic(config-if-1)# ip address 41.1.1.1/24
sonic(config)# interface loopback 0
sonic(config-loif-0)# ip address 120.1.1.80/32
```

\# Configure OSPF neighbors and advertise routes.

```text
sonic(config)# router ospf
sonic(config-router)# ospf router-id 120.1.1.80
sonic(config-router)# network 20.1.1.0/24 area 0.0.0.0
sonic(config-router)# network 30.1.1.0/24 area 0.0.0.0
sonic(config-router)# network 41.1.1.0/24 area 0.0.0.0
sonic(config-router)# network 120.1.1.80/32 area 0.0.0.0
```

\# Configure PIM on the interface, enable multicast routing and forwarding.

```text
sonic(config)# interface ethernet 11
sonic(config-if-11)# multicast-enable
sonic(config-if-11)# ip pim
sonic(config)# interface ethernet 47
sonic(config-if-47)# multicast-enable
sonic(config-if-47)# ip pim
sonic(config)# interface ethernet 1
sonic(config-if-1)# multicast-enable
sonic(config-if-1)# ip pim
sonic(config)# interface loopback 0
sonic(config-loif-0)# ip pim
```

\# Configure C-BSR, specifying the IP address. Configure C-RP, specifying the IP address, covered multicast group address, and priority.

```text
sonic(config)# ip pim bsr candidate-bsr source interface loopback 0
sonic(config)# ip pim bsr candidate-rp source interface loopback 0 priority 98
sonic(config)# ip pim bsr candidate-rp group 224.1.1.0/24
```

Device C

\# Configure an IP address and Loopback0 address for the interface.

```text
sonic(config)# interface ethernet 11
sonic(config-if-11)# ip address 21.1.1.2/24
sonic(config)# interface ethernet 47
sonic(config-if-47)# ip address 30.1.1.2/24
sonic(config)# interface ethernet 1
sonic(config-if-1)# ip address 40.1.1.1/24
sonic(config)# interface loopback 0
sonic(config-loif-0)# ip address 120.1.1.81/32
```

\# Configure OSPF neighbors and advertise routes.

```text
sonic(config)# router ospf
sonic(config-router)# ospf router-id 120.1.1.81
sonic(config-router)# network 21.1.1.0/24 area 0.0.0.0
sonic(config-router)# network 30.1.1.0/24 area 0.0.0.0
sonic(config-router)# network 40.1.1.0/24 area 0.0.0.0
sonic(config-router)# network 120.1.1.81/32 area 0.0.0.0
```

\# Configure PIM on the interface, enable multicast routing and forwarding.

```text
sonic(config)# interface ethernet 11
sonic(config-if-11)# multicast-enable
sonic(config-if-11)# ip pim
sonic(config)# interface ethernet 47
sonic(config-if-47)# multicast-enable
sonic(config-if-47)# ip pim
sonic(config)# interface ethernet 1
sonic(config-if-1)# multicast-enable
sonic(config-if-1)# ip pim
sonic(config)# interface loopback 0
sonic(config-loif-0)# ip pim
```

\# Configure C-BSR, specifying the IP address. Configure C-RP, specifying the IP address, covered multicast group address, and priority.

```text
sonic(config)# ip pim bsr candidate-bsr source interface loopback 0
sonic(config)# ip pim bsr candidate-rp source interface loopback 0 priority 99
sonic(config)# ip pim bsr candidate-rp group 224.1.1.0/24
```

4.       Device D

\# Configure an IP address and Loopback0 address for the interface.

```text
sonic(config)# interface ethernet 49
sonic(config-if-49)# ip address 41.1.1.2/24
sonic(config)# interface ethernet 50
sonic(config-if-50)# ip address 40.1.1.2/24
sonic(config)# interface loopback 0
sonic(config-loif-0)# ip address 120.1.1.122/32
```

\# Configure an IP address for the service interface and enable IGMP functionality.

```text
sonic(config)# mcast-snooping enable
sonic(config)# vlan 100
sonic(config-vlan-100)# igmp-snooping enable
sonic(config-vlan-100)# igmp-snooping version 3
sonic(config)# interface ethernet 1
sonic(config-if-1)# switchport access vlan 100
sonic(config)# interface ethernet 2
sonic(config-if-2)# switchport access vlan 100
sonic(config)# interface vlan 100
sonic(config-vlanif-100)# ip address 50.1.1.1/24
sonic(config-vlanif-100)# ip igmp
```

\# Configure OSPF neighbors and advertise routes.

```text
sonic(config)# router ospf
sonic(config-router)# ospf router-id 120.1.1.122
sonic(config-router)# network 40.1.1.0/24 area 0.0.0.0
sonic(config-router)# network 41.1.1.0/24 area 0.0.0.0
sonic(config-router)# network 50.1.1.0/24 area 0.0.0.0
sonic(config-router)# network 120.1.1.122/32 area 0.0.0.0
```

\# Configure PIM on the interface, enable multicast routing and forwarding.

```text
sonic(config)# interface ethernet 49
sonic(config-if-49)# multicast-enable
sonic(config-if-49)# ip pim
sonic(config)# interface ethernet 50
sonic(config-if-50)# multicast-enable
sonic(config-if-50)# ip pim
sonic(config)# interface loopback 0
sonic(config-loif-0)# ip pim
sonic(config)# interface vlan 100
sonic(config-vlanif-100)# multicast-enable
sonic(config-vlanif-100)# ip pim
```

\# Configure C‑BSR, specifying the IP address.

```text
sonic(config)# ip pim bsr candidate-bsr source interface loopback 0
```

**Verify configuration**

Check the BSR election result and RP address on each device respectively.

\# Device A

```text
sonic# show ip pim bsr
PIMv2 Bootstrap Router information
Current preferred BSR address: 120.1.1.217
Priority        Fragment-Tag       State           UpTime
  200             12463           BSR_ELECTED      20:08:29
sonic#
sonic# show ip pim rp-info
RP address       group/prefix-list   OIF               I am RP    Source
120.1.1.80       224.1.1.0/24        Ethernet7         no           BSR

sonic#
sonic# show ip pim bsrp-info
BSR Address 120.1.1.217
Group Address 224.1.1.0/24
--------------------------
 Rp Address  priority  Holdtime  Hash
 (ACTIVE)
 120.1.1.80  98        151       1767032558
 120.1.1.81  99        151       663517313
(PENDING)
Pending RP count :0
Partial List is empty
```

\# Device B

```text
sonic# show ip pim bsr
PIMv2 Bootstrap Router information
Current preferred BSR address: 120.1.1.217
Priority        Fragment-Tag       State              UpTime
  200             12467           ACCEPT_PREFERRED    18:28:46
Last BSM seen: 00:00:47
sonic#
sonic# show ip pim rp-info
RP address       group/prefix-list   OIF               I am RP    Source
120.1.1.80       224.1.1.0/24        Loopback0         yes           BSR
sonic#
sonic# show ip pim bsrp-info
BSR Address  120.1.1.217
Group Address 224.1.1.0/24
--------------------------
 Rp Address  priority  Holdtime  Hash
 (ACTIVE)
 120.1.1.80  98        151       1767032558
 120.1.1.81  99        151       663517313
(PENDING)
Pending RP count :0
Partial List is empty
```

&#x20;\# Device C

```text
sonic# show ip pim bsr
PIMv2 Bootstrap Router information
Current preferred BSR address: 120.1.1.217
Priority Fragment-Tag State UpTime
200 12469 ACCEPT_PREFERRED 18:30:53
Last BSM seen: 00:00:55
sonic#

sonic# show ip pim rp-info
RP address       group/prefix-list   OIF               I am RP    Source
120.1.1.80       224.1.1.0/24        Ethernet47        no           BSR

sonic#
sonic# show ip pim bsrp-info
BSR Address 120.1.1.217
Group Address 224.1.1.0/24
--------------------------
 Rp Address  priority  Holdtime  Hash
 (ACTIVE)
 120.1.1.80  98        151       1767032558
 120.1.1.81  99        151       663517313

(PENDING)
Pending RP count :0
Partial List is empty
```

Device D

```text
sonic# show ip pim bsr
PIMv2 Bootstrap Router information
Current preferred BSR address: 120.1.1.217
Priority        Fragment-Tag       State              UpTime
  200             12471           ACCEPT_PREFERRED    17:36:24
Last BSM seen: 00:00:21
sonic#
sonic# show ip pim rp-info
RP address       group/prefix-list   OIF               I am RP    Source
120.1.1.80       224.1.1.0/24        Ethernet49        no           BSR
sonic#
sonic# show ip pim bsrp-info
BSR Address  120.1.1.217
Group Address 224.1.1.0/24
--------------------------
 Rp Address  priority  Holdtime  Hash
 (ACTIVE)
 120.1.1.80  98        151       1767032558
 120.1.1.81  99        151       663517313
(PENDING)
Pending RP count :0
Partial List is empty
```

The dynamic RP network converges correctly, with DeviceA elected as the BSR and DeviceB elected as the RP for the multicast address range 224.1.1.0/24.
At this point, the PC can initiate on-demand services within the 224.1.1.0/24 segment normally, and DeviceB can establish multicast forwarding entries to guide data forwarding.
After DeviceB fails, the dynamic RP convergence results on each device are as follows:

Device A

```text
sonic# show ip pim bsr
PIMv2 Bootstrap Router information
Current preferred BSR address: 120.1.1.217
Priority        Fragment-Tag       State           UpTime
  200             12483           BSR_ELECTED      20:23:13
Last BSM seen: 00:00:16
sonic#
sonic# show ip pim rp-info
RP address       group/prefix-list   OIF               I am RP    Source
120.1.1.81       224.1.1.0/24        Ethernet8         no           BSR
sonic#
sonic# show ip pim bsrp-info
BSR Address  120.1.1.217
Group Address 224.1.1.0/24
--------------------------
 Rp Address  priority  Holdtime  Hash
 (ACTIVE)
 120.1.1.81  99        151       663517313
(PENDING)
Pending RP count :0
Partial List is empty

```

Device C

```text
sonic# show ip pim bsr
PIMv2 Bootstrap Router information
Current preferred BSR address: 120.1.1.217
Priority        Fragment-Tag       State              UpTime
  200             12484           ACCEPT_PREFERRED    18:42:11
Last BSM seen: 00:00:01
sonic#
sonic# show ip pim rp-info
RP address       group/prefix-list   OIF               I am RP    Source
120.1.1.81       224.1.1.0/24        Loopback0         yes           BSR
sonic#
sonic# show ip pim bsrp-info
BSR Address  120.1.1.217
Group Address 224.1.1.0/24
--------------------------
 Rp Address  priority  Holdtime  Hash
 (ACTIVE)
 120.1.1.81  99        151       663517313
(PENDING)
Pending RP count :0
Partial List is empty
```

Device D

```text
sonic# show ip pim bsr
PIMv2 Bootstrap Router information
Current preferred BSR address: 120.1.1.217
Priority        Fragment-Tag       State              UpTime
  200             12488           ACCEPT_PREFERRED    00:01:09
Last BSM seen: 00:00:09
sonic#
sonic# show ip pim rp-info
RP address       group/prefix-list   OIF               I am RP    Source
120.1.1.81       224.1.1.0/24        Ethernet50        no           BSR
sonic#
sonic# show ip pim bsrp-info
BSR Address  120.1.1.217
Group Address 224.1.1.0/24
--------------------------
 Rp Address  priority  Holdtime  Hash
 (ACTIVE)
 120.1.1.81  99        151       663517313
(PENDING)
Pending RP count :0
Partial List is empty
```

The dynamic RP network has converged correctly, with DeviceC elected as the RP for the multicast address range 224.1.1.0/24.
At this point, the PC can normally initiate on‑demand services within the 224.1.1.0/24 segment, and DeviceC can establish multicast forwarding entries to guide data forwarding.

