Table Of Contents
Prerequisites for Configuring NetFlow MIB and Top Talkers
Restrictions for Configuring NetFlow MIB and Top Talkers
Information About Configuring NetFlow MIB and Top Talkers
NetFlow MIB and Top Talkers Overview
NetFlow MIB and Top Talkers Benefits
How to Configure NetFlow Top Talkers using Cisco IOS CLI Commands or SNMP Commands
Configuring SNMP Support on the Networking Device
Configuring Parameters for the NetFlow Main Cache
Identifying the Interface Number to use for Enabling NetFlow with SNMP
Configuring NetFlow on Cisco Routers
Configuring NetFlow Top Talkers
Configuring NetFlow Top Talkers Match Criteria
Verifying the NetFlow Top Talkers Configuration
Configuration Examples for NetFlow Top Talkers
Configuring NetFlow Top Talkers using SNMP Commands: Example
Configuring NetFlow Top Talkers Match Criteria using SNMP Commands: Example
NetFlow MIB and Top Talkers
NetFlow is a technology that provides highly granular per-flow statistics on traffic in a Cisco router. The NetFlow MIB and Top Talkers feature uses NetFlow functionality to obtain information regarding heaviest traffic patterns and most-used applications in the network.
History for the NetFlow MIB and Top Talkers Feature
Finding Support Information for Platforms and Cisco IOS Software Images
Use Cisco Feature Navigator to find information about platform support and Cisco IOS software image support. Access Cisco Feature Navigator at http://www.cisco.com/go/fn. You must have an account on Cisco.com. If you do not have an account or have forgotten your username or password, click Cancel at the login dialog box and follow the instructions that appear.
Contents
•
Prerequisites for Configuring NetFlow MIB and Top Talkers
•
Restrictions for Configuring NetFlow MIB and Top Talkers
•
Information About Configuring NetFlow MIB and Top Talkers
•
How to Configure NetFlow Top Talkers using Cisco IOS CLI Commands or SNMP Commands
•
Configuration Examples for NetFlow Top Talkers
Prerequisites for Configuring NetFlow MIB and Top Talkers
Before you enable NetFlow and NetFlow Top Talkers, you must:
•
Configure the router for IP routing
•
Ensure that one of the following is enabled on your router, and on the interfaces that you want to configure NetFlow on: Cisco Express Forwarding (CEF), distributed CEF, or fast switching
•
Understand the resources required on your router because NetFlow consumes additional memory and CPU resources.
Restrictions for Configuring NetFlow MIB and Top Talkers
Cisco IOS Releases 12.2(14)S, 12.0(22)S, or 12.2(15)T
If your router is running a version of Cisco IOS prior to releases 12.2(14)S, 12.0(22)S, or 12.2(15)T the ip route-cache flow command is used to enable NetFlow on an interface.
If your router is running Cisco IOS release 12.2(14)S, 12.0(22)S, 12.2(15)T, or later the ip flow ingress command is used to enable NetFlow on an interface.
Information About Configuring NetFlow MIB and Top Talkers
To configure the NetFlow MIB and Top Talkers feature, you should understand the following concepts:
•
NetFlow MIB and Top Talkers Overview
•
NetFlow MIB and Top Talkers Benefits
NetFlow MIB and Top Talkers Overview
NetFlow collects traffic flow statistics on routing devices. NetFlow has been used for a variety of applications, including traffic engineering, usage-based billing, and denial of service (DoS) attack monitoring.
The usual implementation of NetFlow exports NetFlow data to a collector. The NetFlow MIB and Top Talkers feature can be used for security monitoring or accounting purposes for top talkers, and matching and identifying key users of the network. This feature is also useful for a network location where a traditional NetFlow export operation is not possible. The NetFlow MIB and Top Talkers feature does not require a collector to obtain information regarding flows. Instead, these flows are placed in a special cache where they can be viewed. The NetFlow MIB part of the NetFlow MIB and Top Talkers feature allows you to configure the NetFlow Top Talkers feature using SNMP.
The flows that are generating the heaviest system traffic are known as the "top talkers."
The NetFlow Top Talkers feature allows flows to be sorted so that they can be viewed. The top talkers can be sorted by either of the following criteria:
•
By the total number of packets in each top talker
•
By the total number of bytes in each top talker
In addition to sorting top talkers, you can further organize your output by specifying criteria that the top talkers must match, such as source or destination IP address or port. The match command is used to specify this criterion. For a full list of the matching criteria that you can select, refer to the match command in the Cisco IOS command reference documentation.
NetFlow MIB and Top Talkers Benefits
Top talkers can be useful for analyzing network traffic in any of the following ways:
•
Security—You can view the list of top talkers to see if traffic patterns consistent with a denial of service (DoS) attack are present in your network.
•
Load balancing—You can identify the most heavily used parts of the system and move network traffic over to less-used parts of the system.
•
Traffic analysis—Consulting the data retrieved from the NetFlow MIB and Top Talkers feature can assist you in general traffic study and planning for your network.
An additional benefit of the NetFlow MIB and Top Talkers feature is that it can be configured for a router either by entering CLI commands or by entering SNMP commands on a network management system (NMS) workstation. The SNMP commands are sent to the router and processed by a MIB. You do not have to be connected to the router console to extract the list of top talkers information if an NMS workstation is configured to communicate using SNMP to your network device. For more information on configuring your network device to use MIB functionality for the NetFlow MIB and Top Talkers feature, see the "Configuring SNMP Support on the Networking Device" section.
How to Configure NetFlow Top Talkers using Cisco IOS CLI Commands or SNMP Commands
Note
Some of the tasks in this section include examples of the SNMP CLI syntax used to set configuration parameters on the router, and to read values from MIB objects on the router. These SNMP CLI syntax examples are taken from a Linux workstation using public domain SNMP tools. The SNMP CLI syntax for your workstation might be different. Refer to the documentation that was provided with your SNMP tools for the correct syntax for your network management workstation.
This section contains the following subsections:
•
Configuring SNMP Support on the Networking Device
•
Configuring Parameters for the NetFlow Main Cache
•
Identifying the Interface Number to use for Enabling NetFlow with SNMP
•
Configuring NetFlow on Cisco Routers
•
Configuring NetFlow Top Talkers
•
Configuring NetFlow Top Talkers Match Criteria
•
Verifying the NetFlow Top Talkers Configuration
Configuring SNMP Support on the Networking Device
If you want to configure the Top Talkers feature using the Cisco IOS CLI, you do not need to perform this task.
If you want to configure the Top Talkers feature using the NetFlow MIB and SNMP, you must perform this task.
Before the you can use SNMP commands to configure the Top Talkers feature you must configure SNMP support on your networking device. To enable the SNMP support on the networking device perform the steps in this task.
Note
The SNMP community read-only (RO) string for the examples is public. The SNMP community read-write (RW) string for the examples is private. You should use more complex strings for these values in your configurations.
Note
For more information on configuring SNMP support on your networking device, refer to the Configuring SNMP Support chapter of the Cisco IOS Configuration Fundamentals and Network Management Configuration Guide, Release 12.3
SUMMARY STEPS
1.
enable
2.
configure terminal
3.
snmp-server community string ro
4.
snmp-server community string rw
5.
end
DETAILED STEPS: Router CLI Commands
Configuring Parameters for the NetFlow Main Cache
This optional task describes the procedure for modifying the parameters for the NetFlow main cache. Perform the steps in this optional task using either the router CLI commands or the SNMP commands to modify the parameters for the NetFlow main cache.
SUMMARY STEPS
Router CLI Commands
1.
enable
2.
configure terminal
3.
ip flow-cache entries number
4.
ip flow-cache timeout active minutes
5.
ip flow-cache timeout inactive seconds
6.
end
SNMP Commands
1.
snmpset -c private -m all -v2c [ip-address | hostname] cnfCICacheEntries.type unsigned number
2.
snmpset -c private -m all -v2c [ip-address | hostname] cnfCIActiveTimeOut.type unsigned number
3.
snmpset -c private -m all -v2c [ip-address | hostname] ccnfCIInactiveTimeOut.type unsigned number
DETAILED STEPS: Router CLI Commands
DETAILED STEPS: SNMP Commands
Identifying the Interface Number to use for Enabling NetFlow with SNMP
If you want to configure the Top Talkers feature using the Cisco IOS CLI, you do not need to perform this task.
If you want to configure the Top Talkers feature using the NetFlow MIB and SNMP, you must perform this task.
Before you can use SNMP to enable NetFlow on an interface you must identify the SNMP interface number on the router. To identify the interface number for the interface that you want to enable NetFlow on perform the steps in this required task.
SUMMARY STEPS
1.
enable
2.
show snmp mib ifmib ifindex type number
3.
Repeat Step 2 to identify the SNMP interface number for any other interfaces that you plan to enable NetFlow on.
DETAILED STEPS
Step 1
enable
Enters privileged EXEC mode. Enter the password if prompted.
Router> enableStep 2
show snmp mib ifmib ifindex type number
Displays the SNMP interface number for the interface specified.
Router# show snmp mib ifmib ifindex GigabitEthernet6/2Ethernet0/0: Ifindex = 60Step 3
Repeat Step 2 to identify the SNMP interface number for any other interfaces that you plan to enable NetFlow on.
Configuring NetFlow on Cisco Routers
Perform the steps in this required task using either the router CLI commands or the SNMP commands to enable NetFlow on the router.
SUMMARY STEPS
Router CLI Commands
1.
enable
2.
configure terminal
3.
interface type number
4.
ip flow {ingress | egress}
5.
exit
6.
Repeat Steps 3 through 5 to enable NetFlow on other interfaces
7.
end
SNMP Commands
1.
snmpset -c private -m all -v2c [ip-address | hostname] cnfCINetflowEnable.interface-number integer [0 | 1 | 2 | 3]
2.
Repeat Step 1 to enable NetFlow on other interfaces.
DETAILED STEPS: Router CLI Commands
DETAILED STEPS: SNMP Commands
Configuring NetFlow Top Talkers
This task describes the procedure for configuring the NetFlow Top Talkers feature. Perform the steps in this required task using either the router CLI commands or the SNMP commands to configure the NetFlow Top Talkers feature on the router.
SUMMARY STEPS
Router CLI Commands
1.
enable
2.
configure terminal
3.
ip flow-top-talkers
4.
top number
5.
sort by [packets | bytes]
6.
cache-timeout milliseconds
7.
end
SNMP Commands
1.
snmpset -c private -m all -v2c [ip-address | hostname] cnfTopFlowsTopN.0 unsigned number
2.
snmpset -c private -m all -v2c [ip-address | hostname] cnfTopFlowsSortBy.0 integer [1 | 2 | 3]
3.
snmpset -c private -m all -v2c [ip-address | hostname] cnfTopFlowsCacheTimeout.0 unsigned milliseconds
DETAILED STEPS: Router CLI Commands
DETAILED STEPS: SNMP Commands
Configuring NetFlow Top Talkers Match Criteria
You can limit the traffic that is displayed by the NetFlow Top Talkers feature by configuring match criteria. The match criteria is applied to data in the main cache. The data in the main cache that meets the match criteria is displayed when you enter the show ip flow top-talkers command. To limit the traffic that is displayed by the NetFlow MIB and Top Talkers feature perform the steps in this optional task.
Before configuring NetFlow MIB and Top Talkers match criteria, you should understand the following:
•
NetFlow Top Talkers Match Criteria Specified by CLI Commands
•
NetFlow Top Talkers Match Criteria Specified by SNMP Commands
NetFlow Top Talkers Match Criteria Specified by CLI Commands
You can use the match CLI command to specify match criteria to restrict the display of top talkers for the NetFlow MIB and Top Talkers feature. If you do not provide matching criteria, all top talkers are displayed.
Note
When configuring a matching source, destination or nexthop address, both the address and a mask must be configured. The configuration will remain unchanged until both have been specified.
Note
cnfTopFlowsMatchSampler matches flows from a named flow sampler. cnfTopFlowsMatchClass matches flows from a named class map.
Note
When you are configuring Top Talkers to match bytes and packets, the values that are matched are the total number of bytes and packets in the flow so far. For example, it is possible to match flows containing a specific number of packets, or flows with more or less than a set number of bytes.
The match command has the following syntax:
match {[byte-range [max-byte-number min-byte-number | max max-byte-number | min min-byte-number] | class-map map-name | destination [address ip-address [mask | /nn] | as as-number | port [max-port-number min-port-number | max max-port-number | min min-port-number] | direction [ingress | egress] | flow-sampler flow-sampler-name | input-interface interface-type interface-number | nexthop-address ip-address [mask | /nn] | output-interface interface-type interface-number | packet-range [max-packets min-packets | max max-packets | min min-packets] | protocol [protocol-number | udp | tcp] | source [address ip-address [mask | /nn] | as as-number | port max-port-number min-port-number | max max-port-number | min min-port-number] | tos [tos-byte | dscp dscp | precedence precedence]
no match {byte-range | class-map | destination [address | as | port] | direction | flow-sampler | input-interface | protocol | source [address | as | port] | tos}
Table 1 describes the CLI commands that provide match criteria options for top talker display. You can use these commands to restrict the display of top talkers.
NetFlow Top Talkers Match Criteria Specified by SNMP Commands
If you are using SNMP commands to configure NetFlow Top Talkers, refer to the Table 2 for router CLI commands and equivalent SNMP commands.
Note
Some of the SNMP match criteria options, such as the cnfTopFlowsMatchSrcAddress option, require that you enter multiple SNMP commands on the same line. For example, snmpset -c private -m all -v2c 10.4.9.62 cnfTopFlowsMatchSrcAddressType.0 integer 1 cnfTopFlowsMatchSrcAddress.0 decimal 172.16.10.0 cnfTopFlowsMatchSrcAddressMask.0 unsigned 24.
Table 2 Router CLI Commands and Equivalent SNMP Commands
Router CLI Command SNMP Commandmatch source address [ip-address] [mask | /nn]
cnfTopFlowsMatchSrcAddress decimal ip-address
cnfTopFlowsMatchSrcAddressType integer type1
cnfTopFlowsMatchSrcAddressMask unsigned mask
match destination address [ip-address] [mask | /nn]
cnfTopFlowsMatchDstAddress decimal ip-address
cnfTopFlowsMatchDstAddressType integer type1
cnfTopFlowsMatchDstAddressMask unsigned mask
match nexthop address [ip-address] [mask | /nn]
cnfTopFlowsMatchNhAddress decimal ip-address
cnfTopFlowsMatchNhAddressType integer type1
cnfTopFlowsMatchNhAddressMask unsigned mask
match source port min port
cnfTopFlowsMatchSrcPortLo integer port
match source port max port
cnfTopFlowsMatchSrcPortHi integer port
match destination port min port
cnfTopFlowsMatchDstPortLo integer port
match destination port max port
cnfTopFlowsMatchDstPortHi integer port
match source as as-number
cnfTopFlowsMatchSrcAS integer as-number
match destination as as-number
cnfTopFlowsMatchDstAS integer as-number
match input-interface interface
cnfTopFlowsMatchInputIf integer interface
match output-interface interface
cnfTopFlowsMatchOutputIf integer interface
match tos [tos-value | dscp dscp-value | precedence precedence-value]
cnfTopFlowsMatchTOSByte integer tos-value2
match protocol [protocol-number | tcp | udp]
cnfTopFlowsMatchProtocol integer protocol-number
match flow-sampler flow-sampler-name
cnfTopFlowsMatchSampler string flow-sampler-name
match class-map class
cnfTopFlowsMatchClass string class
match packet-range min minimum-range
cnfTopFlowsMatchMinPackets unsigned minimum-range
match packet-range max maximum-range
cnfTopFlowsMatchMaxPackets unsigned maximum-range
match byte-range min minimum-range
cnfTopFlowsMatchMinBytes unsigned minimum-range
match byte-range max maximum-range
cnfTopFlowsMatchMaxPackets unsigned maximum-range
1 The only IP version type that is currently supported is IPv4 (type 1).
2 tos-value is 6 bits for DSCP, 3 bits for precedence, and 8 bits (one byte) for ToS.
Configuring Source IP Address Top Talkers Match Criteria
Perform the steps in this optional task using either the router CLI commands or the SNMP commands to add source IP address match criteria to the Top Talkers configuration.
Prerequisites
You must configure NetFlow Top Talkers before you perform this task.
SUMMARY STEPS
Router CLI Commands
1.
enable
2.
configure terminal
3.
ip flow-top-talkers
4.
match source address {ip-address/nn | ip-address mask}
5.
end
SNMP Commands
1.
snmpset -c private -m all -v2c [ip-address | hostname] cnfTopFlowsMatchSrcAddressType.0 integer 1 cnfTopFlowsMatchSrcAddress.0 decimal ip-address cnfTopFlowsMatchSrcAddressMask.0 unsigned mask
DETAILED STEPS: Router CLI Commands
Command or Action PurposeStep 1
enable
Example:Router> enable
(Required) Enables privileged EXEC mode.
•
Enter your password if prompted.
Step 2
configure terminal
Example:Router# configure terminal
(Required) Enters global configuration mode.
Step 3
ip flow-top-talkers
Example:
Router(config)# ip flow-top-talkers(Required) Enters NetFlow top talkers configuration mode.
Step 4
match source address {ip-address/nn | ip-address mask}
Example:Router(config-flow-top-talkers)#
match source address172.16.10.0/24(Required) Specifies a match criterion.
•
The source address keyword specifies that the match criterion is based on the source IP address.
•
The ip-address argument is the IP address of the source, destination, or next-hop address to be matched.
•
The mask argument is the address mask, in dotted decimal format.
•
The /nn argument is the address mask as entered in CIDR format. The match source address 172.16.10.0/24 is equivalent to the match source address 172.16.10.0 255.255.255.0 command.
Note
You must configure at least one of the possible match criteria before matching can be used to limit the traffic that is displayed by the Top talkers feature. Additional match criteria are optional.
Note
For a full list of the matching criteria that you can select, refer to the "NetFlow Top Talkers Match Criteria Specified by CLI Commands" section.
Step 5
end
Example:Router(config-flow-top-talkers)# end
(Required) Exits the current configuration mode and returns to privileged EXEC mode.
DETAILED STEPS: SNMP Commands
Command or Action PurposeStep 1
snmpset -c private -m all -v2c [ip-address | hostname] cnfTopFlowsMatchSrcAddressType.0 integer 1 cnfTopFlowsMatchSrcAddress.0 decimal ip-address cnfTopFlowsMatchSrcAddressMask.0 unsigned mask
Example:workstation% snmpset -c private -m all -v2c 10.4.9.62 cnfTopFlowsMatchSrcAddressType.0 integer 1 cnfTopFlowsMatchSrcAddress.0 decimal 172.16.10.0 cnfTopFlowsMatchSrcAddressMask.0 unsigned 24
(Required) Specifies a match criterion.
•
The IP address type of 1 in the cnfTopFlowsMatchSrcAddressType.0 integer 1 command specifies an IP version 4 (IPv4) address for the IP address type. IPv4 is currently the only IP version that is supported.
•
The ip-address argument in cnfTopFlowsMatchSrcAddress.0 decimal ip-address is the IPv4 source IP address to match in the traffic that is being analyzed.
•
The mask argument in cnfTopFlowsMatchSrcAddressMask.0 unsigned mask is the number of bits in the mask for the IPv4 source IP address to match in the traffic that is being analyzed.
Note
You must configure at least one of the possible match criteria before matching can be used to limit the traffic that is displayed by the Top talkers feature. Additional match criteria are optional.
Note
To remove the cnfTopFlowsMatchSrcAddress match criterion from the configuration, specify an IP address type of 0 (unknown) with the cnfTopFlowsMatchSrcAddressType.0 integer 0 command.
Note
For a list of router CLI commands and their corresponding SNMP commands, refer to the "Router CLI Commands and Equivalent SNMP Commands" table .
Verifying the NetFlow Top Talkers Configuration
To verify the NetFlow Top Talkers configuration, perform the steps in this optional task using either router CLI command or the SNMP commands.
SUMMARY STEPS
Router CLI Commands
1.
show ip flow top-talkers
SNMP Command
1.
snmpset -c private -m all -v2c [ip-address | hostname] cnfTopFlowsGenerate.0 integer 1
2.
snmpwalk -c public -m all -v2c [

