---
title: IPMC Counter
slug: aidc/ipmc-counter
createdAt: 2025-12-01T11:11:10.000Z
---

## <font color="#1d50a2">IPMC Counter View</font>

<font color="#1d05a2">Table 1 IPMC Counter View</font>

| **Command**                                                                                                                                                        | **Purpose**                                   |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------- |
| **show counters mroute** \[**configured-pattern** *src-ip-prefix/mask group-ip-prefix/mask* **vrf** *vrf-name*\|**entry** *src-ip* *group-ip* **vrf** *vrf-name*]  | Display multicast routes counter information. |
| **clear counters mroute** \[**configured-pattern** *src-ip-prefix/mask group-ip-prefix/mask* **vrf** *vrf-name*\|**entry** *src-ip* *group-ip* **vrf** *vrf-name*] | Clear multicast routes counter.               |

### <font color="#1d50a2">show counters mroute \[configured-pattern *src-ip-prefix/mask group-ip-prefix/mask* vrf *vrf-name* | entry *src-ip group-ip* vrf *vrf-name*\]</font>

**\[Command]**
**show counters mroute** \[**configured-pattern** *src-ip-prefix/mask group-ip-prefix/mask* **vrf** *vrf-name* | **entry** *src-ip* *group-ip* **vrf** *vrf-name*]

**\[Purpose]**
Display multicast routes counter information.

**\[Parameters]**

| **Parameter**          | **Description**              |
| ---------------------- | ---------------------------- |
| *src-ip-prefix/mask*   | IP Prefix for source address |
| *group-ip-prefix/mask* | IP Prefix for group address  |
| *src-ip*               | Source address               |
| *group-ip*             | Group address                |
| *vrf-name*             | The name of VRF              |

**\[View]**
Privileged User View

**\[Notes]**
The CX308P-48Y-N-V2, CX532P-N-V2 and CX732Q-N-V2 support counting for only 4 mroutes and support packet counting only, not byte counting; other device models support counting for up to 2048 mroutes and support both packet and byte counting.

**\[Use Cases]**

```plaintext
sonic# show counters mroute
MRoute pattern                     VRF         Matched mroutes        Packets          Bytes
---------------------------------  ----------  ---------------------  ---------------  ------------------
Vrfmroute1|0.0.0.0/0|225.0.0.0/16  Vrfmroute1  0.0.0.0,225.0.0.2      103,785,264,483  6,849,827,455,878
                                               10.14.255.1,225.0.0.1  90,121,982,616   5,948,050,852,656
default|0.0.0.0/0|226.0.0.0/16     default     10.14.0.1,226.0.0.1    0                0
                                               10.14.0.2,226.0.0.1    0                0
sonic# show counters mroute entry 0.0.0.0 225.0.0.2 vrf mroute1
MRoute             VRF         MRoute pattern                     Packets          Bytes
-----------------  ----------  ---------------------------------  ---------------  -----------------
0.0.0.0,225.0.0.2  Vrfmroute1  Vrfmroute1|0.0.0.0/0|225.0.0.0/16  104,064,707,094  6,868,270,668,204
sonic# show counters mroute configured-pattern 0.0.0.0/0 225.0.0.0/16 vrf mroute1
MRoute pattern          VRF         Matched mroutes        Packets          Bytes
----------------------  ----------  ---------------------  ---------------  -----------------
0.0.0.0/0|225.0.0.0/16  Vrfmroute1  0.0.0.0,225.0.0.2      107,178,683,072  7,073,793,082,752
                                    10.14.255.1,225.0.0.1  93,515,401,205   6,172,016,479,53
```

### <font color="#1d50a2">clear counters mroute \[configured-pattern *src-ip-prefix/mask group-ip-prefix/mask* vrf *vrf-name* | entry *src-ip group-ip* vrf *vrf-name*\]</font>

**\[Command]**
**clear counters mroute** \[**configured-pattern** *src-ip-prefix/mask group-ip-prefix/mask* **vrf** *vrf-name* | **entry** *src-ip* *group-ip* **vrf** *vrf-name*]

**\[Purpose]**
Clear multicast routes counter.

**\[Parameters]**

| **Parameter**          | **Description**              |
| ---------------------- | ---------------------------- |
| *src-ip-prefix/mask*   | IP Prefix for source address |
| *group-ip-prefix/mask* | IP Prefix for group address  |
| *src-ip*               | Source address               |
| *group-ip*             | Group address                |
| *vrf-name*             | The name of VRF              |

**\[View]**
Privileged User View

**\[Use Cases]**

```plaintext
sonic# clear counters mroute
Flow Counters were successfully cleared
```

## <font color="#1d50a2">IPMC Counter Config</font>

<font color="#1d05a2">Table 2 IPMC Counter Config</font>

| **Command**                                                                                                | **Purpose**                          |
| ---------------------------------------------------------------------------------------------------------- | ------------------------------------ |
| **counter mroute enable**                                                                                  | Enable counter for multicast routes. |
| **counter mroute poll-interval** *interval*                                                                | Configure counter polling interval.  |
| **counter mroute pattern** *src-ip-prefix/mask group-ip-prefix/mask* **vrf** *vrf-name* \[**max** *count*] | Configure pattern for counter.       |

### <font color="#1d50a2">counter mroute enable</font>

**\[Command]**
**counter mroute enable**

**\[Purpose]**
Enable counter for multicast routes.

**\[View]**
Global Configuration View

**\[Use Cases]**

```plaintext
sonic#sonic# configure terminal
sonic(config)# counter mroute enable
```

### <font color="#1d50a2">counter mroute poll-interval *interval*</font>

**\[Command]**
**counter mroute poll-interval** *interval*

**\[Purpose]**
Configure counter polling interval.

**\[Parameters]**

| **Parameter** | **Description**                                                                                            |
| ------------- | ---------------------------------------------------------------------------------------------------------- |
| *interval*    | Polling interval.The unit is millisecond. The range of interval is \[1000,30000] and the default is 10000. |

**\[View]**
Global Configuration View

**\[Use Cases]**

```plaintext
sonic# configure terminal
sonic(config)# counter mroute poll-interval 1000
```

### <font color="#1d50a2">counter mroute pattern *src-ip-prefix/mask group-ip-prefix/mask* vrf *vrf-name* \[max *count*\]</font>

**\[Command]**
**counter mroute pattern** *src-ip-prefix/mask group-ip-prefix/mask* **vrf** *vrf-name* \[**max** *count*]

**\[Purpose]**
Configure pattern for counter.

**\[Parameters]**

| **Parameter**          | **Description**                                                                  |
| ---------------------- | -------------------------------------------------------------------------------- |
| *src-ip-prefix/mask*   | IP Prefix for source address.                                                    |
| *group-ip-prefix/mask* | IP Prefix for group address.                                                     |
| *vrf-name*             | The name of VRF.                                                                 |
| *count*                | Maximum number of counters for single pattern, default value 30, range \[1,2000] |

**\[View]**
Global Configuration View

**\[Use Cases]**

```plaintext
sonic# configure terminal
sonic(config)# counter mroute pattern 100.20.1.0/24 226.1.0.0/24 vrf default max 10
```

