15.6. SFLOW Commands

15.6.1. sflow enable

Command Purpose

Use this command to enable or disable sFlow globally.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

AQ-N5000

7.0

Base

AQ-N6000

7.0

Base

Update based on test report. Mgmt-if and Vrf not supported?

Command Syntax

sflow enable

no sflow enable

Command Mode

Global Config

Default

Disabled

Usage

Before any other sFlow command can be configured, sFlow services must be enabled globally. Use the no parameter with this command to remove all sFlow configurations and disable sFlow globally.

Examples

This example shows how to enable sFlow services globally:

Switch# configure terminal
Switch(config)# sflow enable

15.6.2. sflow agent

Command Purpose

Use this command to configure sFlow agent.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

AQ-N5000

7.0

Base

AQ-N6000

7.0

Base

Command Syntax

sflow agent ( ip IPV4_ADDR | ipv6 ipv6-addres )

no sflow agent ( ip | ipv6 )

Parameter

Parameter Description

Parameter Value

IPV4_ADDR

Agent IPv4 address

IPv4 Address

IPV6_ADDR

Agent IPv6 address

IPv6 Address

Command Mode

Global Config

Default

None

Usage

Use this command to configure IP address for sflow agent. If not configured and router-id has configured, sflow will use the valid interface with max router-id and then never change.

Examples

This example shows how to configure agent with IP address 10.0.0.254.:

Switch# configure terminal
Switch(config)# sflow agent ip 10.0.0.254

Related Commands

show sflow

15.6.3. sflow collector

Command Purpose

Use this command to configure sFlow collector.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

AQ-N5000

7.0

Base

AQ-N6000

7.0

Base

Command Syntax

sflow collector ( mgmt-if | vrf WORD | ) ( IPV4_ADDR | ipv6-addres ) ( UDP_PORT | )

no sflow collector ( mgmt-if | vrf WORD | ) ( IPV4_ADDR | ipv6-addres ) ( UDP_PORT | )

Parameter

Parameter Description

Parameter Value

mgmt-if

Management port

-

vrf WORD

VRF name

Up to 15 characters

IPV4_ADDR

Collector IPv4 address

IPv4 Address

IPV6_ADDR

Collector IPv6 address

IPv6 Address

UDP_PORT

Collector UDP port number, default is 6343

1-65535

Command Mode

Global Config

Default

None

Usage

Use this command to add a collector by specifying the combination of IP address and UDP port. Only up to two unique combinations can be allowed to add. Use the no parameter with this command to delete collector.

Examples

This example shows how to add a collector with IP address 10.0.0.254 and UDP port 3000 and mgmt-if.:

Switch# configure terminal
Switch(config)# sflow collector mgmt-if 10.0.0.254 3000

Related Commands

show sflow

15.6.4. sflow counter interval

Command Purpose

Use this command to configure sFlow polling-interval for counter sample.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

AQ-N5000

7.0

Base

AQ-N6000

7.0

Base

Command Syntax

sflow counter interval INTERVAL

no sflow counter interval

Parameter

Parameter Description

Parameter Value

INTERVAL

Interval value in second

1-2000 second

Command Mode

Global Config

Default

20 seconds

Usage

Use this command to set sFlow polling-interval for counter sample. Use the no parameter with this command to restore to the default value. Default interval value is 20 seconds.

Examples

This example shows how to set sFlow polling-interval to 10 second:

Switch# configure terminal
Switch(config)# sflow counter interval 10

Related Commands

show sflow

15.6.5. sflow counter-sampling enable

Command Purpose

Use this command to enable or disable counter sampling on specified port.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

AQ-N5000

7.0

Base

AQ-N6000

7.0

Base

Command Syntax

sflow counter-sampling enable

no sflow counter-sampling enable

Command Mode

Interface Configuration

Default

Disabled

Usage

Use this command to enable counter sampling on specified port. Use the no parameter with this command to disable counter sampling. By default, sFlow counter sampling is disabled in all ports.

This command can only be configured on a port which is not a link-agg group member. The port can be either a physical port or a link-agg port.

Examples

This example shows how to enable sFlow counter sampling on interface eth-0-1:

Switch# configure terminal
Switch(config)# interface eth-0-1
Switch(config-if)# sflow counter-sampling enable

Related Commands

show sflow

15.6.6. sflow flow-sampling rate

Command Purpose

Use this command to configure flow sampling rate.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

AQ-N5000

7.0

Base

AQ-N6000

7.0

Base

Command Syntax

sflow flow-sampling rate RATE

no sflow flow-sampling rate

Parameter

Parameter Description

Parameter Value

RATE

Sample rate value

must be a power of 2, the range is 32-1048576

Command Mode

Interface Configuration

Default

8192

Usage

Use this command to set sFlow packet sampling rate. Use no parameter with this command to set default sampling rate. Default sampling rate value is 8192.

sFlow uses CPU resources to collect samples and send samples to the collector. If a low sampling rate is set, CPU utilization can become high. To protect CPU from overwhelming, exceeded flow samples would be dropped. If a sampling rate less than default value is configured, a prompt will be given to info the potential of involving a high CPU utilization.

This command can only be configured on a port which is not a link-agg group member. The port can be either a physical port or a link-agg port.

Examples

This example shows how to set the sFlow sampling rate to 2048 on eth-0-1:

Switch# configure terminal
Switch(config)# interface eth-0-1
Switch(config-if)# sflow flow-sampling rate 2048

% Warning: sFlow sampling requires high CPU usage, especially with a low rate.
  It is suggested not configure a rate less than default value 8192.

Related Commands

show sflow

15.6.7. sflow flow-sampling enable

Command Purpose

Use this command to enable or disable packet sampling on individual port.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

AQ-N5000

7.0

Base

AQ-N6000

7.0

Base

Command Syntax

sflow flow-sampling enable ( input | output | both )

no sflow flow-sampling enable ( input | output | both )

Command Mode

Interface Configuration

Default

Disabled

Usage

Use this command to enable ingress direction of packet sampling on individual port. Use the no parameter with this command to disable packet sampling. By default, sFlow packet sampling is disabled in all ports.

This command can only be configured on a port which is not a link-agg group member. The port can be either a physical port or a link-agg port.

Examples

This example shows how to enable input packet sampling on route port eth-0-1:

Switch# configure terminal
Switch(config)# interface eth-0-1
Switch(config-if)# sflow flow-sampling enable input

Related Commands

show sflow

15.6.8. show sflow

Command Purpose

Use this command to show the running information of sflow.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

AQ-N5000

7.0

Base

AQ-N6000

7.0

Base

Command Syntax

show sflow

Command Mode

Privileged EXEC

Default

None

Usage

Use this command to show the running information of sflow.

Examples

This example shows how to show the sflow running information:

Switch# show sflow

sFlow Version: 5
sFlow Global Information:
 Agent IP address                   : 0.0.0.0
 Counter Sampling Interval      : 20 seconds
 Collector IP                       : Not configured
sFlow Port Information:
                 Flow-Sample   Flow-Sample
 Port        Counter     Flow      Direction     Rate
 --------------------------------------------------------
 eth-0-1     Disable     Enable   Input           8192       

Related Commands

sflow enable

sflow collector