The sflow flow-sampling collector command specifies the target sFlow collector that receives flow sampling data.
The undo sflow flow-sampling collector command deletes the target sFlow collector that receives flow sampling data.
By default, no target sFlow collector is specified.
sflow flow-sampling collector { collector-id | all }
undo sflow flow-sampling collector { collector-id | all }
Parameter |
Description |
Value |
---|---|---|
collector-id |
Specifies the ID of the target sFlow collector that receives flow sampling data. |
The value is an integer that can be 1 or 2. |
all |
Indicates all the configured sFlow collectors. |
- |
Ethernet interface view, GE interface view, XGE interface view, 25GE interface view, MultiGE interface view, 40GE interface view, port group view
Usage scenario
An sFlow agent samples packets in a direction of an interface based on a sampling rate, analyzes packets, encapsulates sampled packets and analysis result into sFlow packets, and then sends the sFlow packets to an sFlow collector. When multiple sFlow collectors are configured, you can run the sflow flow-sampling collector command to specify one or two to receive sFlow packets. Each interface can send sFlow sampling packets to a maximum of two collectors.
When you run the sflow flow-sampling collector command to specify the first target sFlow collector on an interface, flow sampling is enabled on the interface. When you run the undo sflow flow-sampling collector command to delete the last target sFlow collector on an interface, flow sampling is disabled on the interface.
Prerequisites
An sFlow collector has been created using the sflow collector command.
Precautions
The sflow flow-sampling rate command only applies to Layer 2 physical interfaces, but does not apply to Eth-Trunk or Layer 3 interfaces. However, this command takes effect on the Layer 3 interface which is switched from a Layer 2 interface using the undo portswitch command, and can take effect on Eth-Trunk member interfaces.
# Specify sFlow collector 1 to receive the flow sampling data.
<HUAWEI> system-view [HUAWEI] interface gigabitethernet 0/0/1 [HUAWEI-GigabitEthernet0/0/1] sflow flow-sampling collector 1
# Configure a port group pg1 that has member ports GE0/0/2 and GE0/0/3, and specify sFlow collector 1 to receive flow sampling data for the port group pg1.
[HUAWEI] port-group pg1 [HUAWEI-port-group-pg1] group-member gigabitethernet 0/0/2 [HUAWEI-port-group-pg1] group-member gigabitethernet 0/0/3 [HUAWEI-port-group-pg1] sflow flow-sampling collector 1