Skip to content
Ask AI

SFLOW Configuration

[Command] show sflow

[Purpose] Display sFLOW configuration information

[View] System configuration view

[Use Cases]

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

[Command] show sflow interface ethernet interface_name

[Purpose] Display the packet sampling rate for FLOW sampling

[View] System configuration view

[Use Cases]

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

[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]

sonic# configure
sonic(config)# sflow enable

[Command] sflow collector name A.B.C.D [rf vrf_name| port ] no sflow collector name

[Purpose] Configure sFlow collector address

[Parameter]

ParameterDescription
nameCollector name, used for internal identification
A.B.C.DCollector IP address
portThe UDP destination port number for sending sFlow packets,the default value is 6343

[View] System configuration view

[Use Cases]

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

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

[Purpose] Configure the IP address of the sFlow Agent

[Parameter]

ParameterDescription
{ethernet|vlan|loopback} idSpecify a Layer 3 interface and use its IP address as the Agent IP address.

[View] System configuration view

[Use Cases]

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

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

[Purpose] Configure sFlow Counter sampling interval

[Parameter]

ParameterDescription
numberValid range: 5-300, Unit: seconds
0disable counter sample

[View] System configuration view

[Use Cases]

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

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

[Purpose] Configure sFlow sampling rate

[Parameter]

ParameterDescription
numberValid range: 8000-100000, The number of data packets sampled within a specified time interval

[View] Interface view

[Use Cases]

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

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

[Purpose] Configure sflow sample-direction

[View] Interface view and system configuration view

[Use Cases]

sonic(config)# sflow sample-direction rx