Configure the Agent IP Address and Enable sFlow Globally
Configure the sFlow agent IPv4 address, and then enable sFlow before the system can monitor and capture traffic statistics to send to an sFlow collector. By default, sFlow is globally disabled.
You can configure sFlow on Segmented Management Instance interfaces OOB, VLAN, and CLIP. You can also use routing VLANs or loopback IPs as the source IP address. Configure the agent IP address to match the Management Instance interface, routing VLAN or loopback IP address.
Procedure
Example
Displays sFlow configuration:
Switch:1(config)#show sflow =============================================================================================== sFlow Global Configuration =============================================================================================== Global State : Enabled Agent IP : 192.0.2.27
Displays sflow collector configuration:
Switch:1(config)#show sflow collector ======================================================================================= sFlow Collector Information ======================================================================================= Id Owner Collector-IP Port Timeout(secs) Reachable via --------------------------------------------------------------------------------------- 1 sflow1 192.0.2.26 6343 497 192.0.2.15 2 sflow2 192.0.2.27 6343 531 192.0.2.16 ---------------------------------------------------------------------------------------
Displays sFlow port configuration:
Switch:1(config)#show sflow interface ==================================================================================================== sFlow Port Configuration Info ==================================================================================================== Port Packet-Sample-Rate Max-Header-Size Counter-interval Collector-list (in secs) ---------------------------------------------------------------------------------------------------- 1/1 0 255 525 1,2 1/2 0 255 525 1,2
Displays sFlow statistics:
Switch:1(config)#show sflow statistics ==================================================================================================== sFlow Statistics Info ==================================================================================================== Collector-id sFlow-Datagrams ---------------------------------------------------------------------------------------------------- 1 1001 2 0 ----------------------------------------------------------------------------------------------------
Variable Definitions
The following table defines parameters for the sflow commands related to configuring sFlow as the source IP.
Variable |
Value |
---|---|
agent-ip |
Specifies the agent-ip address (IPv4). |
collector <1–2> |
Specifies the id to export sFlow datagrams to the collector id. Use the no operator to remove an sflow collector id and a collector name. no sflow collector <1–2> owner WORD<1–20> To configure the default value, enter default sflow collector <1–2> |
address {A.B.C.D.} |
Specifies the collector IP address. Use the no operator to remove an sflow collector address. no sflow collector <1–2> address {A.B.C.D} |
owner WORD<1-20> |
Specifies the sFlow collector name. |
port <1–65535> |
Specifies the destination UDP port. The default port is 6343. To configure the default value, enter default sflow collector <1–2> port |
timeout <1–65535> |
Specifies the time remaining (in seconds) before the collector is released. The default timeout is 0, which means the timeout is not used and the collector sends data forever. To configure the default value, enter default sflow collector <1–2> timeout |
sampling-rate <1024-1000000> |
Configures the packet sampling rate on a port. The default value is 0 (disabled). To configure the default value, enter default sflow sampling-rate. |
counter-interval <1-3600> |
Specifies the polling interval on a port to determine how often the sFlow agent polls and exports counters for a configured interface. The default value is 0 (disabled). |
max-header-size <64-256> |
Specifies the maximum number of bytes to be copied from the sampled packet. The default is 128 bytes. |