You are on page 1of 5

H3C S12500 sFlow Configuration Examples

Copyright © 2013 Hangzhou H3C Technologies Co., Ltd. All rights reserved.
No part of this manual may be reproduced or transmitted in any form or by any means
without prior written consent of Hangzhou H3C Technologies Co., Ltd.
The information in this document is subject to change without notice.
Contents

Introduction ··································································································································································· 1 
Prerequisites ·································································································································································· 1 
Example: Configuring sFlow ······································································································································· 1 
Network requirements ······················································································································································ 1 
Software version used ······················································································································································ 1 
Configuration restrictions and guidelines ······················································································································· 2 
Configuration procedures ················································································································································ 2 
Verifying the configuration ··············································································································································· 2 
Configuration files ····························································································································································· 3 

Related documentation ················································································································································ 3 

i
Introduction
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.

Prerequisites
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.

Example: Configuring sFlow


Network requirements
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.
Figure 1 Network diagram

Software version used


This configuration example was created and verified on S12500-CMW710-R7129.

1
Configuration restrictions and guidelines
The device supports only the determine flow sampling mode.
You can configure sFlow only on Ethernet interfaces.

Configuration procedures
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

Verifying the configuration


# 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

2
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.

Configuration files
[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
#

Related documentation
• H3C S12500 Routing Switch Series Network Management and Monitoring Configuration Guide
• H3C S12500 Routing Switch Series Network Management and Monitoring Command Reference

You might also like