R3303-HP HSR6800 Routers Network Management and Monitoring Configuration Guide

186
# Configure the IP address of GigabitEthernet 4/0/0 on the device as 3.3.3.1/16.
<Router> system-view
[Router] interface gigabitethernet 4/0/0
[Router-GigabitEthernet4/0/0] ip address 3.3.3.1 16
[Router-GigabitEthernet4/0/0] quit
# Configure the IP address for the sFlow agent.
[Router] sflow agent ip 3.3.3.1
# Configure parameters for an sFlow collector: specify sFlow collector ID 2, IP address 3.3.3.2,
the default port number, and description of netserver for the sFlow collector.
[Router] sflow collector 2 ip 3.3.3.2 description netserver
2. Configure counter sampling:
# Set the counter sampling interval to 120 seconds.
[Router] interface gigabitethernet 4/0/1
[Router-GigabitEthernet4/0/1] sflow counter interval 120
# Specify sFlow collector 2 for counter sampling.
[Router-GigabitEthernet4/0/1] sflow counter collector 2
3. Configure flow sampling:
# Set the flow sampling mode and the sampling rate.
[Router-GigabitEthernet4/0/1] sflow sampling-mode random
[Router-GigabitEthernet4/0/1] sflow sampling-rate 4000
# Specify sFlow collector 2 for flow sampling.
[Router-GigabitEthernet4/0/1] sflow flow collector 2
# Display the sFlow configuration and operation information.
[Router-GigabitEthernet4/0/1] display sflow
sFlow Version: 5
sFlow Global Information:
Agent IP:3.3.3.1(CLI)
Source Address:
Collector Information:
ID IP Port Aging Size Description
1 6343 0 1400
2 3.3.3.2 6543 N/A 1400 netserver
3 6343 0 1400
4 6343 0 1400
5 6343 0 1400
6 6343 0 1400
7 6343 0 1400
8 6343 0 1400
9 6343 0 1400
10 6343 0 1400
sFlow Port Information:
Interface CID Interval(s) FID MaxHLen Rate Mode Status
GE4/0/1 2 120 2 128 4000 Random Active
The output shows that GigabitEthernet 4/0/1 enabled with sFlow is active, the counter sampling
interval is 120 seconds, and the packet sampling rate is 4000.