SFLOW Configuration
show sflow
Section titled “show sflow”[Command] show sflow
[Purpose] Display sFLOW configuration information
[View] System configuration view
[Use Cases]
sonic# show sflowsFlow 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: 6343show sflow interface ethernet
Section titled “show sflow interface ethernet”[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 19sFlow interface configurations+-------------+-----------------+----------------------+| Interface | Sampling Rate | Sampling Direction |+=============+=================+======================++-------------+-----------------+----------------------+sflow enable
Section titled “sflow enable”[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# configuresonic(config)# sflow enablesflow collector
Section titled “sflow collector”[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]
sonic# configuresonic(config)# sflow collector test 192.168.0.100 6364sflow agent-id
Section titled “sflow agent-id”[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]
sonic# configuresonic(config)# sflow agent-id loopback 0sflow polling-interval
Section titled “sflow polling-interval”[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
[Use Cases]
sonic# configuresonic(config)# sflow polling-interval 100sflow sample-rate
Section titled “sflow sample-rate”[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]
sonic(config)# interface ethernet 19sonic(config-if-19)# sflow sample-rate 8500sflow sample-direction {rx|tx|both}
Section titled “sflow sample-direction {rx|tx|both}”[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