sFlow Commands

This module provides command line interface (CLI) commands for configuring sFlow on the Cisco 8000 Series Routers.

To use commands of this module, you must be in a user group associated with a task group that includes appropriate task IDs. If the user group assignment is preventing you from using any command, contact your AAA administrator for assistance.

hw-module profile netflow sflow-enable

To enable sFlow on a specified node location, use the hw-module profile netflow sflow enable command in the configuration mode.

hw-module profile netflow sflow enable location node-id

Syntax Description

node-id

The node-id argument is entered in the rack/slot/module notation.

Command Default

sFlow is disabled

Command Modes

Configuration

Command History

Release Modification
Release 7.2.12

This command was introduced.

Usage Guidelines

The Netflow, IPFIX315 and sFlow features are mutually exclusive. Therefore, Netflow, IPFIX315 and sFlow should not be configured on the same node. However, some nodes can have Netflow, IPFIX315 and other nodes can have sFlow configurations.

You must reload the router for the configurations to take effect.

Examples

This example shows how to enable sFlow on the node location 0/0/CPU0:

Router(config)# hw-module profile netflow sflow-enable location 0/0/CPU0 

record sflow

To activate an sFlow flow record, use the record sflow command in flow monitor map configuration mode. To deactivate the flow record, use the no form of this command.

record sflow

Syntax Description

This command has no keywords or arguments.

Command Default

None

Command Modes

Flow monitor map configuration

Command History

Release Modification
Release 7.2.12

This command was introduced.

Usage Guidelines

No specific guidelines impact the use of this command.

Examples

This example shows how to configure an sFlow flow record:


Router# configure
Router(config)# flow monitor-map SAMPLE-MON-1
Router(config-fmm)# record sflow

sflow options

To configure sFlow related options, use the sflow options command in flow monitor map configuration mode.

sflow options [ extended-gateway | extended-router | if-counters polling-interval <time-in-seconds> | input ifindex physical | Output ifindex physical | sample-header size <bytes> ]

Syntax Description

extended-gateway

(Optional) Enables extended-gateway flow data type. When enabled, the following information is exported to the sFlow agent:

  • Next-hop IP

  • Autonomous system number of router, source and source peer

  • Autonomous system path to the destination

  • Communities

extended-router

(Optional) Enables extended-router flow data type. When enabled the following information is exported to the sFlow agent:

  • Next-hop IP

  • Source and destination mask lengths

if-counters polling-interval <time-in-seconds>

(Optional) Specifies polling interval for polling interface counters. The range is from 15-120 seconds.

When enabled, the sFlow agent collects the interface statistics from interface counters.

input ifindex physical

(Optional) Specifies ifindex-related options. When enabled the input (physical) interface SNMP ifindex on which the packet arrived is exported to the external collector.

output ifindex physical

(Optional) Specifies ifindex-related options. When enabled the output (physical) interface SNMP ifindex on which the packet departed is exported to the external collector.

sample-header size <bytes>

(Optional) Specifies maximum sample-header size to be exported.

The size is expressed in bytes. The default size is 128 bytes.

Range: 128 - 343 bytes (from Cisco IOS XR Release 7.3.4 onwards)

Range: 128 - 200 bytes (prior to Cisco IOS XR Release 7.3.4)

Command Default

None

Command Modes

Flow monitor map configuration

Command History

Release Modification
Release 7.3.4

Maximum value for configuring sample-header size is increased to 343 bytes.

Release 7.2.12

This command was introduced.

Usage Guidelines

No specific guidelines impact the use of this command.

Examples

This example shows how to configure various sFlow options:

Router(config)#flow monitor-map SAM-MON-1
Router(config-fmm)#sflow options
Router(config-fmm-sflow)#extended-gateway
Router(config-fmm-sflow)#extended-router
Router(config-fmm-sflow)#sample-header size 164
Router(config-fmm-sflow)#if-counters polling-interval 30
Router(config-fmm-sflow)#input ifindex physical
Router(config-fmm-sflow)#commit

version sflow v5

To configure version 5 as an export version for sFlow, use the version sflow v5 command in flow exporter map configuration mode. To remove the current export version configuration and return to the default configuration, use the no form of this command.

version sflow v5 [ options {interface-table | sampler-table | vrf-table} timeout timeout-value | template {data | options } timeout timeout-value ]

Syntax Description

options

(Optional) Specifies export of options template. Options template provides extra information about the flow records. The options template include these options:

  • interface-table

  • sampler-table

  • vrf-table

For each options template, specify timeout value (in seconds) during which the exporter has to retransmit each active options template.

template

(Optional) Specifies export parameters of the template such as data template and options template timeout configurations.

timeout timeout-value

Specifies custom timeout value (in seconds) during which the exporter has to retransmit each active template. The range of timeout-value is 1 to 604800 seconds.

Command Default

None

Command Modes

Flow exporter map configuration

Command History

Release Modification
Release 7.2.12

This command was introduced.

Usage Guidelines

When you issue the version sflow v5 command, the CLI prompt changes to config-fem-ver, indicating that you have entered the version submode of the flow exporter map configuration mode.

Examples

This example shows how to configure sFlow v5 as an exporter in a flow exporter map configuration submode:


Router# configure
Router(config)# flow exporter-map SAMPLE-1
Router(config-fem)# version sflow v5
Router(config-fem-ver)# 

router-id

To configure the sFlow agent ID with a specific IPv4 or IPv6 address, use the router-id command in flow exporter map configuration mode.

router-id address { ipv4 | ipv6 }

Syntax Description

address ipv4| ipv6

Specifies the router id in IPv4 or IPv6 address format.

Command Default

None

Command Modes

Flow exporter map configuration

Command History

Release Modification
Release 7.10.1

This command was introduced.

Examples

This example shows how to configure sFlow agent ID for an IPv4 address in flow exporter map configuration submode:

Router#configure
Router(config)#flow exporter-map E
Router(config-fem)#router-id address 209.165.201.1 
Router(config-fem)#commit