How to configure sFlow on S series switches

For S series switches (except S1700), two sampling modes are provided, including flow sampling and counter sampling.
1. Flow sampling is based on data packets. An sFlow agent samples and analyzes packets in a direction on a specified interface based on the sampling ratio. Then the sFlow agent encapsulates the original packets and parsing result into sFlow packets, and sends the sFlow packets to an sFlow collector.
2. Counter sampling is based on time. An sFlow agent periodically collects traffic statistics, processor statistics, and memory usage on an interface, encapsulates collected information in sFlow packets, and sends the sFlow packets to an sFlow collector.
Flow sampling and counter sampling are independent of each other. Flow sampling obtains information about flows of a specified service, whereas counter sampling obtains traffic statistics on an interface. Counter sampling is applicable for entire network status monitoring. It is recommended that you configure both the sampling modes.

The following is a configuration example:
1. Configure sFlow agent and sFlow collector information.
[HUAWEI] sflow agent ip 10.1.10.1 //Configure an IP address for the sFlow agent.
[HUAWEI] sflow collector 2 ip 10.1.10.2 description netserver //Configure sFlow collector information: ID 2, IP address 10.1.10.2, and description netserver for the sFlow collector.
2. Configure flow sampling.
[HUAWEI] interface gigabitethernet 1/0/2
[HUAWEI-GigabitEthernet1/0/2] sflow flow-sampling rate 4000 //Set the flow sampling ratio.
[HUAWEI-GigabitEthernet1/0/2] sflow flow-sampling collector 2 //Specify sFlow collector 2 as the target collector to receive sFlow packets sent by the sFlow agent.
3. Configure counter sampling.
[HUAWEI-GigabitEthernet1/0/2] sflow counter-sampling interval 120 //Set the counter sampling interval to 120s.
[HUAWEI-GigabitEthernet1/0/2] sflow counter-sampling collector 2 //Specify sFlow collector 2 as the target collector to receive sFlow packets sent by the sFlow agent.
[HUAWEI-GigabitEthernet1/0/2] quit
[HUAWEI] quit

Scroll to top