NBAR enables creation of different flows for each application seen between any two IP hosts by applying a flow monitor having
a flow record that collects the application name as a key or a nonkey field.
Finding Feature Information
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.
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 NBAR Application Recognition
If the predefined Flexible NetFlow records are not suitable for your traffic requirements, you can create a user-defined (custom)
record using the Flexible NetFlow collect and match commands. Before you can create a customized record, you must decide the criteria that you are going to use for the key and
nonkey fields.
If you want to create a customized record for detecting network attacks, you must include the appropriate key and nonkey
fields in the record to ensure that the router creates the flows and captures the data that you need to analyze the attack
and respond to it. Flexible NetFlow uses Network-based Application recognition (NBAR) to create different flows for each application
seen between any two IP hosts by applying a flow monitor having a flow record that collects the application name as a key
field.
How to Configure Flexible NetFlow NBAR Application Recognition
Creating a
Flow
Record
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.
SUMMARY STEPS
enable
configureterminal
flowrecordrecord-name
descriptiondescription
match {ip |
ipv6} {destination |
source}
address
Repeat Step 5
as required to configure additional key fields for the record.
match flow cts {source | destination} group-tag
collectinterface {input | output}
Repeat the
above step as required to configure additional nonkey fields for the record.
end
showflowrecordrecord-name
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 {ip |
ipv6} {destination |
source}
address
Example:
Device(config-flow-record)# match ipv4 destination address
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.
Step 6
Repeat Step 5
as required to configure additional key fields for the record.
—
Step 7
match flow cts {source | destination} group-tag
Example:
Device(config-flow-record)# match flow cts source group-tag
Device(config-flow-record)# match flow cts destination group-tag
Note
This example configures the CTS source group tag and destination group tag as a key field for the record. For information
about the other key fields available for the matchipv4/ ipv6 command, and the other match commands that are available to configure key fields.
Note
Ingress:
In an incoming packet, if a header is present, SGT will reflect the same value as the header. If no value is present, it
will show zero.
The DGT value will not depend on the ingress port SGACL configuration.
Egress:
If either propagate SGT or CTS is disabled on the egress interface, then SGT will be zero.
In an outgoing packet, if SGACL configuration that corresponds to the (SGT, DGT) exists, DGT will be non-zero.
If SGACL is disabled on the egress port/VLAN or if global SGACL enforcement is disabled, then DGT will be zero
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.
Step 9
Repeat the
above step as required to configure additional nonkey fields for the record.
—
Step 10
end
Example:
Device(config-flow-record)# end
Exits
Flexible NetFlow flow record configuration mode and returns to privileged EXEC
mode.
Step 11
showflowrecordrecord-name
Example:
Device# show flow record FLOW_RECORD-1
(Optional)
Displays the current status of the specified flow record.
Step 12
showrunning-configflowrecordrecord-name
Example:
Device# show running-config flow record FLOW_RECORD-1
(Optional)
Displays the configuration of the specified flow record.
Creating a 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. These record formats can be a user-defined format. An advanced user can create a customized format using
the flowrecord command.
Before you begin
If you want to use
a customized record, 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.
SUMMARY STEPS
enable
configureterminal
flowmonitormonitor-name
descriptiondescription
record {record-name}
cache {timeout {active} seconds | type {
normal
}
Repeat Step 6
as required to finish modifying the cache parameters for this 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.
Configuration Examples for Flexible NetFlow NBAR Application Recognition
Example: Configuring Flexible NetFlow for Network-Based Application Recognition
!
flow record rm_1
match application name
match ipv4 source address
match ipv4 destination address
collect interface input
collect interface output
collect counter packets
!
flow monitor mm_1
record rm_1
!
interface FastEthernet0/0
ip address 172.16.2.2 255.255.255.0
ip flow monitor mm_1 input
!
end
The Cisco Support and Documentation website provides online resources to download documentation, software, and tools. Use
these resources to install and configure the software and to troubleshoot and resolve technical issues with Cisco products
and technologies. Access to most tools on the Cisco Support and Documentation website requires a Cisco.com user ID and password.
Feature Information for Flexible NetFlow NBAR Application Recognition
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 NBAR Application Recognition
Feature Name
Releases
Feature Information
Flexible NetFlow--NBAR Application Recognition
Network-based Application recognition (NBAR) enables creation of different flows for each application seen between any two
IP hosts by applying a flow monitor having a flow record that collects the application name as a key or a nonkey field.
The following commands were introduced or modified: collect application name, match application name, option (Flexible NetFlow), show flow monitor.