Cisco Flexible NetFlow Reference
cisco netflow cheatsheet command
Overview
Flexible NetFlow (FNF) is Cisco’s evolution of traditional NetFlow. It allows custom flow record definitions instead of fixed v5/v9 formats.
Flexible vs Traditional NetFlow
| Feature | Traditional NetFlow | Flexible NetFlow |
|---|---|---|
| Record format | Fixed (v5, v9) | Customizable |
| Fields collected | Predetermined | User-defined |
| Multiple exports | No | Yes |
| Per-interface config | Limited | Full control |
Components
Flow Record → Flow Monitor → Interface
↓
Flow Exporter → Collector
| Component | Purpose |
|---|---|
| Flow Record | Defines what fields to collect (match/collect) |
| Flow Exporter | Defines where to send data (collector IP, port) |
| Flow Monitor | Links record + exporter, applies to interface |
Configuration Example
1. Create Flow Record
flow record CUSTOM-RECORD
match ipv4 source address
match ipv4 destination address
match transport source-port
match transport destination-port
match ipv4 protocol
collect counter bytes
collect counter packets
collect timestamp sys-uptime first
collect timestamp sys-uptime last
2. Create Flow Exporter
flow exporter EXPORT-TO-COLLECTOR
destination 10.1.1.100
source Loopback0
transport udp 2055
export-protocol netflow-v9
template data timeout 60
3. Create Flow Monitor
flow monitor MONITOR-TRAFFIC
record CUSTOM-RECORD
exporter EXPORT-TO-COLLECTOR
cache timeout active 60
cache timeout inactive 15
4. Apply to Interface
interface GigabitEthernet0/0
ip flow monitor MONITOR-TRAFFIC input
ip flow monitor MONITOR-TRAFFIC output
Common Match Fields
| Field | Description |
|---|---|
ipv4 source address | Source IP |
ipv4 destination address | Destination IP |
transport source-port | Source port |
transport destination-port | Destination port |
ipv4 protocol | Protocol number (TCP=6, UDP=17) |
interface input | Ingress interface |
ipv4 tos | Type of service / DSCP |
Common Collect Fields
| Field | Description |
|---|---|
counter bytes | Byte count |
counter packets | Packet count |
timestamp sys-uptime first | Flow start time |
timestamp sys-uptime last | Flow end time |
transport tcp flags | TCP flags seen |
Verification Commands
show flow monitor
show flow monitor MONITOR-TRAFFIC cache
show flow monitor MONITOR-TRAFFIC statistics
show flow record
show flow exporter
show flow exporter EXPORT-TO-COLLECTOR statistics
show flow interface
Interpret Cache Output
show flow monitor MONITOR-TRAFFIC cache format table
Shows active flows with configured fields.
Check Export Statistics
show flow exporter EXPORT-TO-COLLECTOR statistics
Look for:
- Packets sent vs failed
- Template packets sent
- Client/server errors
Use Cases
| Use Case | Configuration Focus |
|---|---|
| Traffic analysis | Collect bytes/packets per conversation |
| Security monitoring | Match on ports, look for anomalies |
| Capacity planning | Long-term byte counters by subnet |
| Billing/accounting | Match interface + collect counters |
| Application visibility | Include NBAR fields if supported |
Troubleshooting
No Flows Exported
- Verify interface has
ip flow monitorapplied - Check exporter destination is reachable
- Confirm UDP port isn’t blocked
- Check
show flow exporter statisticsfor errors
Cache Full
Increase cache size or reduce timeouts:
flow monitor MONITOR-TRAFFIC
cache entries 32768
cache timeout active 30