Your software release may not support all the features documented in this module. For the latest caveats and feature information, see
Bug Search Tool and the release notes for your platform and software release. To find information about the features documented in this module, and to see a list of the releases in which each feature is supported, see the feature information table at the end of this module.
Use Cisco Feature Navigator to find information about platform support and Cisco software image support. To access Cisco Feature Navigator, go to
www.cisco.com/go/cfn. An account on Cisco.com is not required.
Information About Flexible NetFlow IPv4 Unicast Flows
Perform this task to configure a customized flow record.
Customized flow records are used to analyze traffic data for a specific purpose. A customized flow record must have at least one
match criterion for use as the key field and typically has at least one
collect criterion for use as a nonkey field.
There are hundreds of possible permutations of customized flow records. This task shows the steps that are used to create one of the possible permutations. Modify the steps in this task as appropriate to create a customized flow record for your requirements.
6. Repeat Step 5 as required to configure additional key fields for the record.
7.collectinterface {input |
output}
8. Repeat Step 7 as required to configure additional nonkey fields for the record.
9.end
10.showflowrecordrecord-name
11.showrunning-configflowrecordrecord-name
DETAILED STEPS
Command or Action
Purpose
Step 1
enable
Example:
Device> enable
Enables privileged EXEC mode.
Enter your password if prompted.
Step 2
configureterminal
Example:
Device# configure terminal
Enters global configuration mode.
Step 3
flowrecordrecord-name
Example:
Device(config)# flow record FLOW-RECORD-1
Creates a flow record and enters Flexible NetFlow flow record configuration mode.
This command also allows you to modify an existing flow record.
Step 4
descriptiondescription
Example:
Device(config-flow-record)# description Used for basic traffic analysis
(Optional) Creates a description for the flow record.
Step 5
match {ipv4 |
ipv6}{destination |
source}
address
Example:
Device(config-flow-record)# match ipv4 destination address
Configures a key field for the flow record.
Note
This example configures the IPv4 destination address as a key field for the record. For information about the other key fields available for the
matchipv4 command, and the other
match commands that are available to configure key fields, refer to the
Cisco IOS Flexible NetFlow Command Reference .
Step 6
Repeat Step 5 as required to configure additional key fields for the record.
Configures the input interface as a nonkey field for the record.
Note
This example configures the input interface as a nonkey field for the record. For information on the other
collect commands that are available to configure nonkey fields, refer to the
Cisco IOS Flexible NetFlow Command Reference.
Step 8
Repeat Step 7 as required to configure additional nonkey fields for the record.
--
Step 9
end
Example:
Device(config-flow-record)# end
Exits Flexible NetFlow flow record configuration mode and returns to privileged EXEC mode.
Step 10
showflowrecordrecord-name
Example:
Device# show flow record FLOW_RECORD-1
(Optional) Displays the current status of the specified flow record.
Step 11
showrunning-configflowrecordrecord-name
Example:
Device# show running-config flow record FLOW_RECORD-1
(Optional) Displays the configuration of the specified flow record.
Configuring the Flow Exporter
To configure the flow exporter, perform the following required task.
Note
Each flow exporter supports only one destination. If you want to export the data to multiple destinations, you must configure multiple flow exporters and assign them to the flow monitor.
You can export to a destination using either an IPv4 or IPv6 address.
(Optional) Configures options data parameters for the exporter.
You can configure all three options concurrently.
The range for the
seconds argument is 1 to 86,400. Default: 600.
Step 10
output-features
Example:
Device(config-flow-exporter)# output-features
(Optional) Enables sending export packets using quality of service (QoS) and encryption.
Step 11
templatedatatimeoutseconds
Example:
Device(config-flow-exporter)# template data timeout 120
(Optional) Configure resending of templates based on a timeout.
The range for the
seconds argument is 1 to 86400 (86400 seconds = 24 hours).
Step 12
transportudpudp-port
Example:
Device(config-flow-exporter)# transport udp 650
Specifies the UDP port on which the destination system is listening for exported datagrams.
The range for the
udp-port argument is from 1 to 65536.
Step 13
ttlseconds
Example:
Device(config-flow-exporter)# ttl 15
(Optional) Configures the time-to-live (TTL) value for datagrams sent by the exporter.
The range for the
seconds argument is from 1 to 255.
Step 14
end
Example:
Device(config-flow-exporter)# end
Exits flow exporter configuration mode and returns to privileged EXEC mode.
Step 15
showflowexporterexporter-name
Example:
Device# show flow exporter FLOW_EXPORTER-1
(Optional) Displays the current status of the specified flow exporter.
Step 16
showrunning-configflowexporterexporter-name
Example:
Device# show running-config flow exporter FLOW_EXPORTER-1
(Optional) Displays the configuration of the specified flow exporter.
Creating a Customized Flow Monitor
Perform this required task to create a customized flow monitor.
Each flow monitor has a separate cache assigned to it. Each flow monitor requires a record to define the contents and layout of its cache entries.
An advanced user can create a customized format using the
flowrecord command.
Before You Begin
If you want to use a customized record instead of using one of the Flexible NetFlow predefined records, you must create the customized record before you can perform this task.
If you want to add a flow exporter to the flow monitor for data export, you must create the exporter before you can complete this task.
Note
You must use the
noipflowmonitor command to remove a flow monitor from all of the interfaces to which you have applied it before you can modify the parameters for the
record command on the flow monitor. For information about the
ipflowmonitor command, refer to the
Cisco IOS Flexible NetFlow Command Reference.
(Optional) Enables the collection of size distribution statistics for Flexible NetFlow monitors.
Step 10
exporterexporter-name
Example:
Device(config-flow-monitor)# exporter EXPORTER-1
(Optional) Specifies the name of an exporter that was created previously.
Step 11
end
Example:
Device(config-flow-monitor)# end
Exits Flexible NetFlow flow monitor configuration mode and returns to privileged EXEC mode.
Step 12
showflowmonitor[[name]
monitor-name [cache [format {csv |
record |
table}]] [statistics]]
Example:
Device# show flow monitor FLOW-MONITOR-2 cache
(Optional) Displays the status and statistics for a Flexible NetFlow flow monitor.
Step 13
showrunning-configflowmonitormonitor-name
Example:
Device# show running-config flow monitor FLOW_MONITOR-1
(Optional) Displays the configuration of the specified flow monitor.
Configuring a Flow Monitor for IPv4 or IPv6 Traffic Using the Predefined Record
To configure a flow monitor for IPv4/IPv6 traffic using the Flexible NetFlow "NetFlow IPv4/IPv6 original input" predefined record for the flow monitor, perform the following required task.
Each flow monitor has a separate cache assigned to it. Each flow monitor requires a record to define the contents and layout of its cache entries. The record format can be one of the predefined record formats, or an advanced user may create his or her own record format using the
collect and
matchcommands in Flexible NetFlow flow record configuration mode.
Note
You must remove a flow monitor from all of the interfaces to which you have applied it before you can modify the
record format of the flow monitor.
SUMMARY STEPS
1.enable
2.configureterminal
3.flowmonitormonitor-name
4.descriptiondescription
5.recordnetflow{ipv4|ipv6}original-input
6.end
7.showflowmonitor[[name]
monitor-name [cache [format {csv |
record |
table}]][statistics]]
8.showrunning-configflowmonitormonitor-name
DETAILED STEPS
Command or Action
Purpose
Step 1
enable
Example:
Device> enable
Enables privileged EXEC mode.
Enter your password if prompted.
Step 2
configureterminal
Example:
Device# configure terminal
Enters global configuration mode.
Step 3
flowmonitormonitor-name
Example:
Device(config)# flow monitor FLOW-MONITOR-1
Creates a flow monitor and enters Flexible NetFlow flow monitor configuration mode.
This command also allows you to modify an existing flow monitor.
Step 4
descriptiondescription
Example:
Device(config-flow-monitor)# description Used for monitoring IPv4 traffic
(Optional) Creates a description for the flow monitor.
Step 5
recordnetflow{ipv4|ipv6}original-input
Example:
Device(config-flow-monitor)# record netflow ipv4 original-input
Specifies the record for the flow monitor.
Step 6
end
Example:
Device(config-flow-monitor)# end
Exits Flexible NetFlow flow monitor configuration mode and returns to privileged EXEC mode.
Step 7
showflowmonitor[[name]
monitor-name [cache [format {csv |
record |
table}]][statistics]]
Example:
Device# show flow monitor FLOW-MONITOR-2 cache
(Optional) Displays the status and statistics for a Flexible NetFlow flow monitor.
Step 8
showrunning-configflowmonitormonitor-name
Example:
Device# show flow monitor FLOW_MONITOR-1
(Optional) Displays the configuration of the specified flow monitor.
Applying a Flow Monitor to an Interface
Before it can be activated, a flow monitor must be applied to at least one interface. Perform this required task to activate a flow monitor.
Device(config-if)# ip flow monitor FLOW-MONITOR-1 input
Activates a flow monitor that was created previously by assigning it to the interface to analyze traffic.
Step 5
Repeat Steps 3 and 4 to activate a flow monitor on any other interfaces in the device over which you want to monitor traffic.
--
Step 6
end
Example:
Device(config-if)# end
Exits interface configuration mode and returns to privileged EXEC mode.
Step 7
showflowinterfacetypenumber
Example:
Device# show flow interface GigabitEthernet 0/0/0
Displays the status of Flexible NetFlow (enabled or disabled) on the specified interface.
Step 8
showflowmonitornamemonitor-namecacheformatrecord
Example:
Device# show flow monitor name FLOW_MONITOR-1 cache format record
Displays the status, statistics, and flow data in the cache for the specified flow monitor.
Configuring and Enabling Flexible NetFlow with Data Export
You must create a flow monitor to configure the types of traffic for which you want to export the cache data. You must enable the flow monitor by applying it to at least one interface to start exporting data. To configure and enable Flexible NetFlow with data export, perform this required task.
Each flow monitor has a separate cache assigned to it. Each flow monitor requires a record to define the contents and layout of its cache entries. The record format can be one of the predefined record formats, or an advanced user may create his or her own record format using the
collect and
matchcommands in Flexible NetFlow flow record configuration mode.
Note
You must remove a flow monitor from all of the interfaces to which you have applied it before you can modify the
record format of the flow monitor.
When you specify the "NetFlow original," or the "NetFlow IPv4 original input," or the "NetFlow IPv6 original input" predefined record for the flow monitor to emulate original NetFlow, the flow monitor can be used only for analyzing input (ingress) traffic.
When you specify the "NetFlow IPv4 original output" or the "NetFlow IPv6 original output" predefined record for the flow monitor to emulate the Egress NetFlow Accounting feature, the flow monitor can be used only for analyzing output (egress) traffic.
The following example shows how to configure multiple export destinations for Flexible NetFlow for IPv4 or IPv6 traffic.
This sample starts in global configuration mode:
!
flow exporter EXPORTER-1
destination 172.16.10.2
transport udp 90
exit
!
flow exporter EXPORTER-2
destination 172.16.10.3
transport udp 90
exit
!
flow monitor FLOW-MONITOR-1
record netflow ipv4 original-input
exporter EXPORTER-2
exporter EXPORTER-1
!
!
flow monitor FLOW-MONITOR-2
record netflow ipv6 original-input
exporter EXPORTER-2
exporter EXPORTER-1
!
ip cef
!
interface GigabitEthernet1/0/0
ip address 172.16.6.2 255.255.255.0
ipv6 address 2001:DB8:2:ABCD::2/48
ip flow monitor FLOW-MONITOR-1 input
ipv6 flow monitor FLOW-MONITOR-2 input
!
The following display output shows that the flow monitor is exporting data to the two exporters:
Router# show flow monitor FLOW-MONITOR-1
Flow Monitor FLOW-MONITOR-1:
Description: User defined
Flow Record: netflow original-input
Flow Exporter: EXPORTER-1
EXPORTER-2
Cache:
Type: normal (Platform cache)
Status: allocated
Size: 4096 entries / 311316 bytes
Inactive Timeout: 15 secs
Active Timeout: 1800 secs
Update Timeout: 1800 secs
Example: Configuring Flexible NetFlow Egress Accounting for IPv4 and IPv6 Traffic
The following example shows how to configure Flexible NetFlow egress accounting for IPv4 and IPv6 traffic.
This example starts in global configuration mode.
!
flow monitor FLOW-MONITOR-1
record netflow ipv4 original-output
exit
!
!
flow monitor FLOW-MONITOR-2
record netflow ipv6 original-output
exit
!
ip cef
ipv6 cef
!
interface Ethernet0/0
ip address 172.16.6.2 255.255.255.0
ipv6 address 2001:DB8:2:ABCD::2/48
ip flow monitor FLOW-MONITOR-1 output
ipv6 flow monitor FLOW-MONITOR-2 output
!
Feature Information for Flexible NetFlow--IPv4 Unicast Flows
The following table provides release information about the feature or features described in this module. This table lists only the software release that introduced support for a given feature in a given software release train. Unless noted otherwise, subsequent releases of that software release train also support that feature.
Use Cisco Feature Navigator to find information about platform support and Cisco software image support. To access Cisco Feature Navigator, go to
www.cisco.com/go/cfn. An account on Cisco.com is not required.
Table 1
Feature Information for Flexible NetFlow--IPv4 Unicast Flows
Feature Name
Releases
Feature Information
Flexible NetFlow--IPv4 Unicast Flows
12.2(33)SRC
12.2(50)SY
12.4(9)T
15.0(1)SY
15.0(1)SY1
Enables Flexible NetFlow to monitor IPv4 traffic.
Support for this feature was added for Cisco 7200 series routers in Cisco IOS Release 12.2(33)SRC.
The following commands were introduced or modified:
collectrouting,
debugflowrecord,
collectipv4,
collectipv4destination,
collectipv4fragmentation,
collectipv4section,
collectipv4source,
ipflowmonitor,
matchipv4,
matchipv4destination,
matchipv4fragmentation,
matchipv4section,
matchipv4source,
matchrouting,
record,
showflowmonitor,showflowrecord.
Cisco and the Cisco logo are trademarks or registered trademarks of Cisco and/or its affiliates in the U.S. and other countries. To view a list of Cisco trademarks, go to this URL:
www.cisco.com/go/trademarks. Third-party trademarks mentioned are the property of their respective owners. The use of the word partner does not imply a partnership relationship between Cisco and any other company. (1110R)
Any Internet Protocol (IP) addresses and phone numbers used in this document are not intended to be actual addresses and phone numbers. Any examples, command display output, network topology diagrams, and other figures included in the document are shown for illustrative purposes only. Any use of actual IP addresses or phone numbers in illustrative content is unintentional and coincidental.