NetFlow and sFlow Configuration Guide on Cisco 8000 Series Routers, Cisco IOS XR Releases

PDF

NetFlow and sFlow Configuration Guide on Cisco 8000 Series Routers, Cisco IOS XR Releases

Configure and verify NetFlow and sFlow using CLI commands

Get quick access to NetFlow and sFlow CLI commands that you can use to configure NetFlow and sFlow protocols for traffic monitoring.


Configure and verify NetFlow and sFlow protocols for traffic monitoring using command-line interface (CLI) commands.

  • Enable traffic monitoring and analysis on Cisco IOS XR devices.

  • Use CLI commands to configure NetFlow and sFlow features.

  • Verify protocol operation and data collection.

The Cisco Command Reference Guide provides a comprehensive list of command-line interface (CLI) commands for configuring and verifying NetFlow and sFlow implementations.

Cisco IOS XR supports configuring NetFlow and sFlow using both traditional CLI commands and programmatically through YANG data models.

  • NetFlow and sFlow are used for traffic monitoring and network analysis.

  • CLI commands allow manual configuration and verification of these protocols.

Before you begin

Ensure you have access to a Cisco IOS XR device with administrative privileges.

  • Verify that NetFlow and sFlow features are supported on your device and software version.

  • Confirm that you have the necessary credentials to access the CLI.

Follow these steps to configure and verify NetFlow and sFlow using CLI commands.

Procedure

1.

Enter the CLI on your Cisco IOS XR device.

Example:

router#

Access the device using SSH, console, or Telnet as appropriate.

  • Ensure you are in privileged EXEC mode.

If...

Then...

You do not have administrative privileges

Request access from your network administrator.

NetFlow or sFlow features are not supported

Upgrade your device or software to a supported version.

CLI access is unavailable

Use YANG models or another supported configuration method.

  • Configure NetFlow using CLI commands.
  • Configure sFlow using CLI commands.

You are ready to configure NetFlow and sFlow protocols for traffic monitoring.

2.

Configure NetFlow protocol using CLI commands.

Example:

router(config)# flow exporter EXPORTER_NAME
router(config-flow-exporter)# destination <IP_ADDRESS>
router(config-flow-exporter)# transport udp <PORT>
router(config-flow-exporter)# exit
router(config)# flow monitor MONITOR_NAME
router(config-flow-monitor)# record netflow ipv4
router(config-flow-monitor)# exporter EXPORTER_NAME
router(config-flow-monitor)# exit
router(config)# interface <INTERFACE>
router(config-if)# flow monitor MONITOR_NAME ingress

Replace EXPORTER_NAME, MONITOR_NAME, IP_ADDRESS, PORT, and INTERFACE with your specific values.

  • Configure flow exporter and monitor for NetFlow data collection.

  • Apply the monitor to the desired interface.

If...

Then...

Exporter configuration fails

Verify IP address and port settings.

Monitor is not applied to interface

Check interface name and monitor configuration.

NetFlow data is not collected

Review exporter and monitor settings for errors.

NetFlow protocol is configured for traffic monitoring.

3.

Configure sFlow protocol using CLI commands.

Example:

router(config)# sflow agent <INTERFACE>
router(config)# sflow collector <IP_ADDRESS> <PORT>
router(config)# sflow sampling-rate <RATE>
router(config)# sflow enable

Replace INTERFACE, IP_ADDRESS, PORT, and RATE with your specific values.

  • Configure sFlow agent, collector, and sampling rate.

  • Enable sFlow protocol for traffic monitoring.

If...

Then...

sFlow agent configuration fails

Verify interface and collector settings.

Sampling rate is incorrect

Adjust sampling rate to match network requirements.

sFlow data is not collected

Review agent and collector configuration for errors.

sFlow protocol is configured for traffic monitoring.

4.

Verify NetFlow and sFlow configuration using CLI commands.

Example:

router# show flow monitor MONITOR_NAME
router# show sflow

Use the show commands to verify NetFlow and sFlow operation.

  • Check NetFlow monitor statistics and exported data.

  • Review sFlow agent and collector status.

If...

Then...

Monitor statistics are missing

Verify monitor and exporter configuration.

sFlow collector status is inactive

Check collector IP address and port settings.

Exported data is not received

Review network connectivity and configuration.

NetFlow and sFlow operation is verified.

NetFlow and sFlow protocols are configured and verified for traffic monitoring on Cisco IOS XR devices.

What to do next

Review collected traffic data and adjust configuration as needed for optimal monitoring.

  • Monitor network performance and update exporter or collector settings if required.