The networking device must be running a Cisco IOSd release that supports Cisco IOS Flexible NetFlow.
One of the following must be enabled on your router and on any interfaces on which you want to enable Flexible NetFlow:
Cisco Express Forwarding IPv6 or
Distributed Cisco Express Forwarding IPv6.
Restrictions For IPv6 Netflow
The following restrictions apply to IPv6 Netflow configurations:
Locally generated traffic (traffic that is generated by the router, Cisco WLC 5760, on which the Flexible NetFlow Output Accounting feature is configured) is not counted as flow traffic for the Output Flexible NetFlow Accounting feature.
The Flexible NetFlow Output Accounting feature counts CEF-switched packets only. Process switched transit packets are not counted.
Information About IPv6 Netflow
NetFlow is a monitoring feature used on customer applications for network monitoring, user monitoring and profiling, network planning, security analysis, billing and accounting, and data warehousing and mining. You can use Flexible NetFlow on uplink ports to monitor user-defined flows, collect flow statistics, and perform per-flow policing. It collects and exports flow statistics to a collector device.
Note
Flexible NetFlow is supported only on the Catalyst 3750-X and 3560-X switch running the IP base or IP services feature set and equipped with the network services module. It is not supported on switches running the NPE or the LAN base image.
Note
Not all of the Flexible NetFlow commands in the command reference are available on the switch. Unsupported commands are either not visible or generate an error message if entered.
With Flexible NetFlow, traffic is processed and packets are classified into flows. New flows are inserted in the NetFlow table, and statistics are automatically updated. You must configure both ingress and egress NetFlow monitoring. The network services module supports one monitor per interface per direction.
Flexible NetFlow consists of the following components:
Records— These are combinations of key and non-key fields assigned to monitor Flexible NetFlow monitors to define the cache used to store data.
Flow monitors— These are applied to interfaces to perform network traffic monitoring. A flow monitor includes a user-defined record, an optional flow exporter, and a cache that is automatically created when the monitor is applied to the first interface. The switch supports normal caches that age out according to settings.
Flow exporters— These export the data in the flow monitor cache to a remote system, such as a server running NetFlow collector.
Flow samplers— These reduce the load that Flexible NetFlow puts on the networking device to monitor traffic by limiting the number of packets that are analyzed.
You can configure unidirectional flow (destination or source-address based flows), and flow aging. The following features are supported on the network services module:
Configuring collection statistics for Layer 2-switched (non-routing) traffic, Layer 3 (CAPWAP) IPv4 and IPv6 traffic, and Layer 4 TCP, IGMP, and ICMP traffic.
NetFlow analysis is performed on traffic crossing the physical interfaces on the network services module. The switch processes egress (outbound) traffic after forwarding decisions are performed. Locally switched or routed traffic is forced through service module ports by configuring private VLANs or protected ports.
The following NetFlow characteristics are not supported:
Netflow-5 protocol
Predefined flow records
ISL
Policy-based NetFlow
Cisco TrustSec monitoring
Though other modules that can be installed in the switch have 1-Gigabit and 10-Gigabit uplink interfaces, NetFlow is supported only on the network services module.
Flexible Netflow (FNF) allows the user to define a flow record (a particular set of key, non-key, counter and time-stamp fields of interest) that is optimal for a particular application by selecting the fields from a big collection of pre-defined fields, using CLI configuration commands.
The collection of the pre-defined fields includes the following fields:
Data-link layer (L2) header fields
IPv4 header fields
IPv6 header fields
Transport layer (L4) header fields
Application layer (L5) header fields
Routing attributes (generic, IPv4, IPv6)
Interface fields
Counter fields
Timestamp fields
How To Configure IPv6 Netflow
Configuring a Customized Flow Record
You can match the following fields for the flow record:
IPv4 or IPv6 destination address
Datalink fields, to identify Layer 2 source and destination address and VLAN for traffic entering or leaving the interfaces, providing the MAC address of the directly connected host. Class of Service (CoS) and Ethertype datalink header fields are also available.
Transport field source and destination ports, to identify the type of application: ICMP, IGMP, or TCP traffic.
You can collect the following fields for the flow record:
The total number of bytes, flows or packets sent by the exporter (exporter) or the number of bytes or packets in a 64-bit counter (long). The timestamp based on system uptime from the time the first packet was sent or from the time the most recent (last) packet was seen.
The SNMP index of the input or output interface. The interface for traffic entering or leaving the service module is based on the switch forwarding cache. This field is typically used in conjunction with datalink, IPv4, and IPv6 addresses, and provides the actual first-hop interface for directly connected hosts.
A value of 0 means that interface information is not available in the cache.
Some NetFlow collectors require this information in the flow record.
The following steps configure the customized flow record:
Configures the interface key field for the flow record.
Step 12
collect transport tcp flags {ack | cwr | ece | fin | psh | rst | syn | urg}
Example:
Switch(config-flow-record)# collect transport tcp flags ack
Configures transports tcp flag fields for the flow record.
Step 13
end
Example:
Switch(config)# end
Returns to privileged EXEC mode. Alternatively, you can also press Ctrl-z to exit global configuration mode.
Switch(config)# flow record
Switch(config-flow-record)# description record to monitor network traffic
Switch(config-flow-record)# match ipv6 destination address
Switch(config-flow-record)# match datalink [dot1q | ethertype | mac | vlan]
Switch(config-flow-record)# match transport [destination-port | icmp |igmp | source-port]
Switch(config-flow-record)# match interface input
Switch(config-flow-record)# match flow direction
Switch(config-flow-record)#collect counter bytes layer2 long
Switch(config-flow-record)# collect timestamp absolute first
Switch(config-flow-record)# collect interface [input | output]
Switch(config-flow-record)# collect transport tcp flags ack
Switch(config-flow-record)# end
Configuring the Flow Exporters
The following steps are used to configure the NetFlow exporter.
Note
The optional export-protocol flow exporter configuration command specifies the NetFlow export protocol used by the exporter. The switch supports only netflow-v9. Though visible in the CLI help, netflow-5 is not supported.
(Optional) Configures the flow exports destination.
Step 5
dscp<0-63>
Example:
Switch(config-flow-exporter)# dscp 23
(Optional) Configures differentiated services code point (DSCP) parameters for datagrams sent by the exporter. The DSCP range is from 0 to 63. The default is 0.
(Optional) Configures options data parameters for the exporter. You can configure all three options concurrently. The range for the timeout is 1 to 86400 seconds. The default is 600.
cache {timeout [active| inactive|update] (seconds) | type (normal)}
Example:
Switch(config-flow-monitor)# cache type normal
(Optional) Modifies the flow monitor cache parameters such as timeout values, number of cache entries, and the cache type.
timeout active seconds—Configures the active flow timeout. This defines the granularity of the traffic analysis. The range is from 1 to 604800 seconds. The default is 1800. Typical values are 60 or 300 seconds. See the Configuring Data Export for Cisco IOS Flexible NetFlow with Flow Exporters document for recommended values.
type normal—Configures normal flow removal from the flow cache.
Note
Although visible in the command line help, the entries keyword and inactive and update timeouts are not supported.
Step 6
cache {timeout [active| inactive|update] (seconds) | type (normal)}
Example:
Switch(config-flow-monitor)# cache type normal
Repeat step 5 to configure additional cache parameters for the flow monitor.
(Optional) Specifies the name of an exporter that was created previously.
Step 8
cache {timeout [active| inactive|update] (seconds) | type (normal)}
Example:
Switch(config-flow-monitor)# cache type normal
Repeat step 5 to configure additional cache parameters for the flow monitor.
Step 9
end
Example:
Switch(config)# end
Returns to privileged EXEC mode. Alternatively, you can also press Ctrl-z to exit global configuration mode.
Switch(config)# flow monitor FLOW-MONITOR-1
Switch(config-flow-monitor)# Used for ipv4 traffic analysis
Switch(config-flow-monitor)# record FLOW-RECORD-1
Switch(config-flow-monitor)# cache timeout active 300
Switch(config-flow-monitor)# cache type normal
Switch(config-flow-monitor)# exporter EXPORTER-1
Switch(config-flow-monitor)# exit
What to Do Next
Apply a flow monitor to an interface
Applying a Flow Monitor to an Interface
The following are used to configure a NetFlow monitor to an interface.
Identifies an interface and enters interface configuration mode. Flexible Net Flow is supported only on the service module 1-Gigabit or 10-Gigabit Ethernet interfaces.
Note
You cannot attach a NetFlow monitor to a port channel interface. If both service module interfaces are part of an EtherChannel, you should attach the monitor to both physical interfaces.