---
title: SFLOW Configuration
slug: enterprise-v6p1/sflow-configuration
createdAt: 2025-12-04T07:55:24.041Z
---

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

### <font color="#1d50a2">show sflow</font>

**\[Command]**
**show sflow**

**\[Purpose]**
Display sFLOW configuration information

**\[View]**
System configuration view

**\[ Use Cases]**

```plaintext
sonic# show sflow
sFlow Global Information:
 sFlow Admin State:     up
 sFlow Sample Direction:   rx
 sFlow Polling Interval:   0
 sFlow AgentID:       Ethernet12
 1 Collectors configured:
  Name: 1          IP addr: 10.1.1.1    UDP port: 6343
```

### <font color="#1d50a2">show sflow interface ethernet</font>

**\[Command]**
**show sflow interface ethernet** *interface\_name*

**\[Purpose]**
Display the packet sampling rate for FLOW sampling

**\[View]**
System configuration view

**\[Use Cases]**

```plaintext
sonic# show sflow interface ethernet 19
sFlow interface configurations
+-------------+-----------------+----------------------+
| Interface   | Sampling Rate   | Sampling Direction   |
+=============+=================+======================+
+-------------+-----------------+----------------------+
```

### <font color="#1d50a2">sflow enable</font>

**\[Command]**
**sflow enable**

**\[Purpose]**
Enable sFLOW function

**\[View]**
System configuration view

**\[Usage Scenario]**
The sFlow Agent offers two sampling methods for analyzing network traffic conditions from different perspectives: Flow sampling and Counter sampling.
Flow sampling involves the sFlow Agent device sampling and analyzing packets on specified interfaces based on specific sampling directions and ratios. It aims to capture detailed information about packet data content, facilitating monitoring and analysis of network behaviors.
Counter sampling, on the other hand, involves the sFlow Agent device periodically collecting traffic statistics information from interfaces. The sampling data collected by Counter sampling is detailed in the table below. Unlike Flow sampling, Counter sampling focuses solely on the quantity of traffic on interfaces, rather than the specifics of traffic content.

**\[Use Cases]**

```plaintext
sonic# configure
sonic(config)# sflow enable
```

### <font color="#1d50a2">sflow collector</font>

**\[Command]**
**sflow collector** *name A.B.C.D* **\[rf**  *vrf\_name*| *port* **]**
**no sflow collector** *name*

**\[Purpose]**
Configure sFlow collector address

**\[Parameter]**

| **Parameter** | **Description**                                                                     |
| ------------- | ----------------------------------------------------------------------------------- |
| *name*        | Collector name, used for internal identification                                    |
| *A.B.C.D*     | Collector IP address                                                                |
| *port*        | The UDP destination port number for sending sFlow packets,the default value is 6343 |

**\[View]**
System configuration view

**\[Use Cases]**

```plaintext
sonic# configure
sonic(config)# sflow collector test 192.168.0.100 6364
```

### <font color="#1d50a2">sflow agent-id</font>

**\[Command]**
**sflow agent-id \{ethernet|vlan|loopback|link-aggregation}** *id*
**no sflow agent-id**

**\[Purpose]**
Configure the IP address of the sFlow Agent

**\[Parameter]**

| **Parameter**                        | **Description**                                                             |
| ------------------------------------ | --------------------------------------------------------------------------- |
| **\{ethernet\|vlan\|loopback}** *id* | Specify a Layer 3 interface and use its IP address as the Agent IP address. |

**\[View]**
System configuration view

**\[Use Cases]**

```plaintext
sonic# configure
sonic(config)# sflow agent-id loopback 0
```

### <font color="#1d50a2">sflow polling-interval</font>

**\[Command]**
**sflow polling-interval \{** *number* **|0}**
**no sflow polling-interval**

**\[Purpose]**
Configure sFlow Counter sampling interval

**\[Parameter]**

| **Parameter** | **Description**                   |
| ------------- | --------------------------------- |
| *number*      | Valid range: 5-300, Unit: seconds |
| 0             | disable counter sample            |

**\[View]**
System configuration view

**&#x20;\[Use Cases]**

```plaintext
sonic# configure
sonic(config)# sflow polling-interval 100
```

### <font color="#1d50a2">sflow sample-rate</font>

**\[Command]**
**sflow sample-rate** *number*
**no sflow sample-rate**

**\[Purpose]**
Configure sFlow sampling rate

**\[Parameter]**

| **Parameter** | **Description**                                                                               |
| ------------- | --------------------------------------------------------------------------------------------- |
| *number*      | Valid range: 8000-100000, The number of data packets sampled within a specified time interval |

**\[View]**
Interface view

**\[Use Cases]**

```plaintext
sonic(config)# interface ethernet 19
sonic(config-if-19)# sflow sample-rate 8500
```

### <font color="#1d50a2">sflow sample-direction \{rx|tx|both\}</font>

**\[Command]**
**sflow sample-direction \{rx|tx|both}**

**\[Purpose]**
Configure sflow sample-direction

**\[View]**
Interface view and system configuration view

**\[Use Cases]**

```plaintext
sonic(config)# sflow sample-direction rx
```

### <font color="#1d50a2">sflow disable</font>

**\[Command]**
**sflow disble**

**\[Purpose]**
Disable sFlow sampling

**\[View]**
Interface view

**\[Use Cases]**

```plaintext
sonic(config)# interface ethernet 1
sonic(config-if-1)# sflow disable
```

