4.6 Troubleshoot NetFlow v9, Flexible NetFlow and IPFIX
ENARSI 300-410 v1.1 · 4.0 Infrastructure Services
NetFlow records who talked to whom: a flow is packets with the same key fields (source, destination, ports, protocol, ToS, input interface). The router caches flows and exports them to a collector. Traditional NetFlow v5/v9 uses fixed keys; Flexible NetFlow lets you choose them in a record; IPFIX (v10) is the IETF standard based on v9 templates.
What you must know
- Explain flows, the cache, active and inactive timeouts, and export.
- Configure Flexible NetFlow: record, exporter, monitor, interface.
- Compare v5, v9 and IPFIX.
- Troubleshoot an empty collector: direction, exporter source, UDP port, templates.
Flexible NetFlow
flow record APP
match ipv4 source address
match ipv4 destination address
match transport destination-port
match ipv4 protocol
match interface input
collect counter bytes long
collect counter packets long
collect timestamp absolute first
!
flow exporter NMS
destination 10.0.99.40
source GigabitEthernet0/2
transport udp 2055
export-protocol ipfix
!
flow monitor MON
record APP
exporter NMS
cache timeout active 60
!
interface GigabitEthernet0/1
ip flow monitor MON inputPC1's traffic creates a cache entry (1); the entry is exported when it times out (2): inactive timeout (15 s without packets) or active timeout (long flows are exported every 60 s here, 30 min by default).
Versions
| Version | Format | Notes |
|---|---|---|
| v5 | Fixed fields, IPv4 only | Traditional NetFlow; ip flow ingress + ip flow-export version 5 |
| v9 | Template-based | IPv6, MPLS, any field; the collector needs the template first |
| IPFIX (v10) | Template-based, IETF standard | Variable-length fields, enterprise elements; UDP, TCP or SCTP |
! Traditional NetFlow, for comparison
interface GigabitEthernet0/1
ip flow ingress
ip flow-export destination 10.0.99.40 2055
ip flow-export version 9
ip flow-export source GigabitEthernet0/2
R1# show flow monitor MON cache
Cache type: Normal (Platform cache)
Current entries: 3
IPV4 SRC ADDR IPV4 DST ADDR TRNS DST PORT IP PROT intf input bytes long pkts long
10.10.10.20 10.0.50.80 443 6 Gi0/1 48211 61Troubleshooting order
- Is the monitor on the right interface and direction?
show flow interface Gi0/1. - Is the cache filling?
show flow monitor MON cache. Empty means no traffic matches or the wrong direction. - Is the exporter sending?
show flow exporter NMS statistics(packets sent, errors). - Can the exporter's source reach the collector? Does the collector expect that address and UDP port?
- v9/IPFIX: has the collector received the template? It is resent periodically (
template data timeout).
Commands
show flow monitor <name> cache | Current flows with key and data fields. |
show flow exporter [name] statistics | Export packets sent and errors. |
show flow interface [if] | Which monitors are on each interface and direction. |
show flow record [name] | Key and non-key fields of a record. |
show ip cache flow | Traditional NetFlow cache. |
Exam traps
- A record's
matchfields make the key; changing them changes what one flow is. - An input monitor does not see traffic leaving the interface.
- A collector that missed the template cannot decode v9 or IPFIX data.
- A monitor cannot be changed while it is applied to an interface; remove it first.
- Long flows are exported at the active timeout, so a download may appear in several records.
Check yourself
- Which fields does a v5 flow key on?
- Source and destination IP, source and destination port, protocol, ToS and input interface.
- Difference between
matchandcollectin a flow record? matchfields define the flow key;collectfields are data gathered for each flow.- The collector receives packets but shows nothing. With v9, why?
- It has not received the template yet (or it was lost), so it cannot decode the records.
- When is a long-lived flow exported?
- At each active timeout, and finally at the inactive timeout or when it ends.
Labs
Try it live: NetFlow v9 to a collector, then Flexible NetFlow over IPFIX