Configuring Netflow Export on an IOS Device


Follow the steps below to configure Netflow export on a Cisco IOS device.


Tip Refer the Cisco Version Matrix for information on Cisco platforms and IOS versions supporting Netflow

Enabling Netflow Export

Enter global configuration mode on the router or MSFC, and issue the following commands for each interface on which you want to enable Netflow:


interface {interface} {interface_number}

ip route-cache flow

bandwidth <kbps>



Tip In some recent IOS releases Cisco Express Forwarding has to be enabled. Issue the command ip cef in global configuration mode on the router or MSFC for this.


This enables Netflow on the specified interface alone. Remember that on a Cisco IOS device, Netflow is enabled on a per-interface basis. The bandwidth command is optional, and is used to set the speed of the interface in kilobits per second. Interface speed or link speed value is used to later calculate percentage utilization values in traffic graphs.

Exporting Netflow Data

Issue the following commands to export Netflow data to the server on which NetFlow Analyzer is running:


Command Purpose
ip flow-export destination {hostname|ip_address} 9996 Exports the Netflow cache entries to the specified IP address. Use the IP address of the NetFlow Analyzer server and the configured Netflow listener port. The default port is 9996.
ip flow-export source {interface} {interface_number} Sets the source IP address of the Netflow exports sent by the device to the specified IP address. NetFlow Analyzer will make SNMP requests of the device on this address.
ip flow-export version 5 [peer-as | origin-as] Sets the Netflow export version to version 5. NetFlow Analyzer supports only version 5 and version 7. If your router uses BGP you can specify that either the origin or peer AS is included in exports - it is not possible to include both.
ip flow-cache timeout active 1

Breaks up long-lived flows into 1-minute fragments. You can choose any number of minutes between 1 and 60. If you leave it at the default of 30 minutes your traffic reports will have spikes.

It is important to set this value to 1 minute in order to generate alerts and view troubleshooting data.

ip flow-cache timeout inactive 15 Ensures that flows that have finished are periodically exported. The default value is 15 seconds. You can choose any number of seconds between 10 and 600. However, if you choose a value greater than 250 seconds, NetFlow Analyzer may report traffic levels that are too low.
snmp-server ifindex persist Enables ifIndex persistence (interface names) globally. This ensures that the ifIndex values are persisted during device reboots.


Tip For more information on BGP reporting in NetFlow Analyzer, look up the section on Configuring Netflow for BGP


Verifying Device Configuration

Issue the following commands in normal (not configuration) mode to verify whether Netflow export has been configured correctly:


Command Purpose
show ip flow export Shows the current Netflow configuration
show ip cache flow These commands summarize the active flows and give an indication of how much Netflow data the device is exporting
show ip cache verbose flow

A Sample Device Configuration

The following is a set of commands issued on a router to enable Netflow version 5 on the FastEthernet 0/1 interface and export to the machine on port 9996.


router#configure terminal
router-2621(config)#interface FastEthernet 0/1
router-2621(config-if)#ip route-cache flow
router-2621(config)#ip flow-export destination 9996
router-2621(config)#ip flow-export source FastEthernet 0/1
router-2621(config)#ip flow-export version 5
router-2621(config)#ip flow-cache timeout active 1
router-2621(config)#ip flow-cache timeout inactive 15
router-2621(config)#snmp-server ifindex persist
router#show ip flow export
router#show ip cache flow

*repeat these commands to enable Netflow for each interface

Turning off Netflow

Issue the following commands in global configuration mode to stop exporting Netflow data:


Command Purpose
no ip flow-export destination {hostname|ip_address} {port_number} This will stop exporting Netflow cache entries to the specified destination IP address on the specified port number
interface {interface} {interface_number} This will disable Netflow export on the specified interface. Repeat the commands for each interface on which you need to disable Netflow.
no ip route-cache flow




For further information on configuring your IOS device for Netflow data export, refer Cisco's Netflow commands documentation

Copyright © 2019, ZOHO Corp. All Rights Reserved.