02-S12500_sFlow_Configuration_Examples
Chapters Download (85.77 KB)
Title | Size | Download |
---|---|---|
02-S12500_sFlow_Configuration_Examples | 85.77 KB |
This document provides Sampled Flow (sFlow) configuration examples.
sFlow is a traffic monitoring technology. It provides the following sampling mechanisms:
· Flow sampling—Obtains packet information.
· Counter sampling—Obtains interface counter information.
The configuration examples in this document were created and verified in a lab environment, and all the devices were started with the factory default configuration. When you are working on a live network, make sure you understand the potential impact of every command on your network.
This document assumes that you have basic knowledge of H3C sFlow.
As shown in Figure 1, configure flow sampling and counter sampling on GigabitEthernet 3/0/2 to monitor traffic on the port.
The device sends sFlow packets through GigabitEthernet 3/0/1 to the sFlow collector.
This configuration example was created and verified on S12500-CMW710-R7129.
The device supports only the determine flow sampling mode.
You can configure sFlow only on Ethernet interfaces.
1. Configure IP addresses for interfaces, as shown in Figure 1. (Details not shown.)
2. On the device, add GigabitEthernet 3/0/1 that connects the sFlow collector to VLAN 30. (Details not shown.)
3. Configure the sFlow agent and configure information about the sFlow collector:
# Configure the IP address of the sFlow agent. (This example uses the IP address of VLAN-interface 30 as the IP address of the sFlow agent.)
[Device] sflow agent ip 30.0.0.1
# Configure information about the sFlow collector: specify the sFlow collector ID as 1, IP address as 30.0.0.2, UDP port number as 6343 (the default), and description as CLI.
[Device] sflow collector 1 ip 30.0.0.2 description CLI
4. Configure flow sampling:
# Set the flow sampling mode to determine and sampling rate to 4000.
[Device] interface GigabitEthernet 3/0/2
[Device-GigabitEthernet3/0/2] undo shutdown
[Device-GigabitEthernet3/0/2] sflow sampling-mode determine
[Device-GigabitEthernet3/0/2] sflow sampling-rate 4000
# Specify sFlow collector 1 for flow sampling.
[Device-GigabitEthernet3/0/2] sflow flow collector 1
5. Configure counter sampling:
# Set the counter sampling interval to 120 seconds.
[Device-GigabitEthernet3/0/2] sflow counter interval 120
# Specify sFlow collector 1 for counter sampling.
[Device-GigabitEthernet3/0/2] sflow counter collector 1
# Display the sFlow configuration and operation information.
[Device] display sflow
sFlow datagram version: 5
Global Information:
Agent IP:30.0.0.1(CLI)
Source address:
Collector Information:
ID IP Port Aging Size VPN-instance Description
1 30.0.0.2 6343 N/A 1400 CLI
Port Information:
Interface CID Interval(s) FID MaxHLen Rate Mode Status
GE3/0/2 1 120 1 128 4000 Determine Active
The output shows the following:
· GigabitEthernet 3/0/2 enabled with sFlow is active.
· The counter sampling interval is 120 seconds (the sFlow agent collects traffic statistics from the port every 120 seconds.
· The flow sampling rate is 4000 (the sFlow agent samples one packet from every 4000 packets). The sFlow feature operates correctly.
[Device] display current-configuration
#
sflow agent ip 30.0.0.1
sflow collector 1 ip 30.0.0.2 description "CLI"
#
vlan 10
#
vlan 20
#
vlan 30
#
interface Vlan-interface30
ip address 30.0.0.1 255.255.255.0
#
interface GigabitEthernet3/0/2
port link-mode bridge
port access vlan 10
sflow sampling-rate 4000
sflow flow collector 1
sflow counter interval 120
sflow counter collector 1
#
interface GigabitEthernet3/0/1
port link-mode bridge
port access vlan 30
#
· H3C S12500 Routing Switch Series Network Management and Monitoring Configuration Guide
· H3C S12500 Routing Switch Series Network Management and Monitoring Command Reference