
160
Enable sFlow (including flow sampling and counter sampling) on Ethernet1/0/1 to monitor traffic on the
port. The device sends sFlow packets through Ethernet1/0/3 to the sFlow collector, which analyzes the
sFlow packets and displays results.
Figure 55
Network diagram
Configuration procedure
1.
Configure the sFlow agent and sFlow collector
# Configure the IP address of vlan-interface 1 on Device as 3.3.3.1/16.
<Device> system-view
[Device] interface vlan-interface 1
[Device-Vlan-interface1] ip address 3.3.3.1 16
[Device-Vlan-interface1] quit
# Specify the IP address for the sFlow agent.
[Device] sflow agent ip 3.3.3.1
Source Address:
# Specify sFlow collector ID 2, IP address 3.3.3.2, the default port number, and description of
netserver
for the sFlow collector.
[Device] sflow collector 2 ip 3.3.3.2 description netserver
2.
Configure counter sampling
# Set the counter sampling interval to 120 seconds.
[Device] interface ethernet 1/0/1
[Device-Ethernet1/0/1] sflow counter interval 120
# Specify sFlow collector 2 for counter sampling.
[Device-Ethernet1/0/1] sflow counter collector 2
3.
Configure flow sampling
# Set the Flow sampling mode and sampling interval.
[Device-Ethernet1/0/1] sflow sampling-mode random
[Device-Ethernet1/0/1] sflow sampling-rate 4000
# Specify sFlow collector 2 for flow sampling.
[Device-Ethernet1/0/1] sflow flow collector 2
# Display the sFlow configuration and operation information.
[Device-Ethernet1/0/1] display sflow
sFlow Version: 5
sFlow Global Information: