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.
Before you begin
Ensure you have access to a Cisco IOS XR device with administrative privileges.
Follow these steps to configure and verify NetFlow and sFlow using CLI commands.
Procedure
-
Enter the CLI on your Cisco IOS XR device.
Access the device using SSH, console, or Telnet as appropriate.
|
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.
-
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.
|
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.
-
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.
-
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.
|
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.