Configuring Flexible NetFlow on a Cisco Device
- Last Updated: December 11, 2024
- 3 minute read
- WhatsUp Gold
- Version 2024
Flexible NetFlow is a performance-optimized NetFlow implementation. You can also use it for Cisco Network Based Application Recognition (NBAR) summaries. To configure a network device to use Flexible NetFlow, perform with the following configuration steps:
- Create a flow monitor
- Define the flow record (use one of the two configuration methods)
- Create a flow exporter
These tasks are described in the following sections, using an example configuration to illustrate how to complete the tasks from the Cisco IOS command-line interface (CLI).
Creating a flow monitor
The following example illustrates how to configure a Flexible NetFlow enabled device to utilize Flexible NetFlow in support of NBAR and Network Traffic Analysis application monitoring. For more information, see the Cisco documentation for configuring Flexible NetFlow.
To create a flow monitor:
- Enter the privileged EXEC mode, then enter the global configuration mode.
Router>enableRouter#configure terminal - Create a flow monitor and enter the flow monitor configuration mode.
Router(config)#flow monitor application-monRouter(config-flow-monitor)#description app traffic analysisRouter(config-flow-monitor)#cache timeout active 60
Defining a flow record
There are two methods to define a flow record to use Flexible NetFlow. The first, and simplest to configure option, is to run a command on the Cisco device to configure sources with a predefined format as follows:
(Option 1) To define a flow record:
- Run the following command on the Cisco device for which you want configure Flexible NetFlow sources:
record netflow ipv4original-input- or --
record netflow ipv6 original-input- or -
record netflow original-input
(Option 2) To define a flow record:
- Enter the privileged EXEC mode, then enter the global configuration mode.
Router >enableRouter#configure terminal - Enter the flow monitor configuration mode.
Router(config)#flow monitor application-mon - Name the record and enter a description.
Router(config-flow-monitor)#flow record nbar-appmonRouter(config-flow-record)#description NBAR Flow Monitor - Define key boxes, using the
matchkeyword.Router(config-flow-record)#match ipv6 tosRouter(config-flow-record)#match ipv6 protocolRouter(config-flow-record)#match ipv6 source addressRouter(config-flow-record)#match ipv6 destination addressRouter(config-flow-record)#match transport source-portRouter(config-flow-record)#match transport destination-portRouter(config-flow-record)#match interface inputRouter(config-flow-record)#match application nameNote: By using the application name as a match parameter, you can utilize Network Based Application Recognition (NBAR) to collect statistics and report on network usage by individual applications. - Define nonkey boxes, using the
collectkeyword.Router(config-flow-record)#collect interface outputRouter(config-flow-record)#collect counter bytesRouter(config-flow-record)#collect counter packetsRouter(config-flow-record)#collect transport tcp flags(for networks using the BGP protocol, include the following two commands)Router(config-flow-record)#collect routing source asRouter(config-flow-record)#collect routing destination as - Enter the flow monitor configuration mode and configure the flow monitor to use the newly configured record.
Router(config)#flow monitor application-monRouter(config-flow-monitor)#record nbar-appmon
Creating a flow exporter
When the record is complete, you can create the flow exporter. This component exports records from the flow monitor on the network device to the flow collector, in this case Flow Monitor.
To create a flow exporter:
- Enter the privileged EXEC mode, then enter the global configuration mode.
Router >enableRouter#configure terminal - Create and describe the flow exporter.
Router(config)#flow exporter export-to-progress-flow-monitorRouter(config-flow-exporter)#description Flexible NF v9 - Set the destination flow collector IP address.
Router(config-flow-exporter)#destination <Collector IP Address>
- Define the PDU type and destination port.
Router(config-flow-exporter)#transport udp 9999Note: Port 9999 is the default port for Flow Monitor - Set options for exporter operation.
Router(config-flow-exporter)#template data timeout
- Enter the global configuration mode and configure the flow monitor to use the new flow exporter.
Router#configure terminalRouter(config)#exporter export-to-progress_flow_monitor