Flow collector: see the traffic of your switches, routers, and hypervisors
The firewall sees only the traffic that passes through it. Traffic between two computers on the same switch, between virtual machines on one host, or through another router never reaches it. Those devices can report their own traffic as flow records. The flow collector receives the records and shows:
- who talks the most (top talkers) and where traffic goes (top destinations);
- conversations: which pairs of addresses exchange the most;
- services (HTTPS, DNS, SMB, backups…) and protocols;
- a flow graph: source → destination → service, sized by traffic;
- traffic over time per device, live and for any period up to a year.
It understands the four common formats:
| Format | Sent by | Default port |
|---|---|---|
| NetFlow v5 | older Cisco routers, many small routers | UDP 2055 |
| NetFlow v9 | Cisco, MikroTik, pfSense (softflowd), OPNsense, Open vSwitch | UDP 2055 |
| IPFIX | Cisco IOS-XE, Juniper, VMware vSphere Distributed Switch, UniFi gateways | UDP 4739 |
| sFlow v5 | switches from Aruba, Juniper, Dell, Arista, and Open vSwitch | UDP 6343 |
Every listener recognises all four formats, so one port is enough. Exporters and records can be IPv4 or IPv6.
The example:
| Firewall | fw-main: LAN 192.168.10.1 and fd00:10::1 (zone lan), management 10.0.99.1 (zone mgmt) |
| Core switch | 10.0.99.2, sends sFlow |
| Router at the branch | 10.0.99.3, Cisco, sends NetFlow v9 |
| Hypervisor | 10.0.99.11 (VMware vSphere) and 2001:db8:99::11, sends IPFIX |
Flow collection is different from Flow export. Flow export sends the firewall's own connections to another collector. The flow collector receives other devices' flows. Both can run at the same time.
Before you start
- Decide where the devices send from. Most devices send flow records from their management address. Put the listener in the zone of that network (here mgmt). Don't open it on the internet zone: flow records are neither encrypted nor authenticated. Reach remote sites through a VPN.
- Know the devices' addresses. Only listed devices are accepted. A management network such as 10.0.99.0/24 can be listed as a whole.
- Check the sampling. Switches usually sample one packet in N (sFlow always does). The collector multiplies by N, using the rate the device announces. Note N for devices that sample without announcing it.
Set up the collector
Open Monitoring › Flows › Flow collector › Settings.
- Listeners: press Add listener.
- Choose NetFlow v5/v9, IPFIX, or sFlow v5. The port follows (2055, 4739, 6343); change it only when a device cannot.
- Tick the zones the devices are in, here mgmt.
- Add a second listener when devices use different ports, for example sFlow on 6343 and NetFlow on 2055.
- Exporters (allow-list): press Add exporter for each device or network.
- Name: shown in every list and graph, such as core-switch.
- Address: an IPv4 or IPv6 address, or a network such as
10.0.99.0/24. - Sampling rate: leave it empty to use the rate the device announces. Enter N when it samples 1 in N without saying so. Enter 1 when it does not sample.
- On: untick it to stop accepting a device without removing it.
- What to track: the defaults suit most networks: addresses, service port, protocol, exporter, and AS numbers.
- Tick Interfaces to see the switch's interface numbers.
- Tick ToS / DSCP to check QoS markings.
- Raw source and destination ports add many entries (client ports are random). Turn them on only to investigate.
- Retention, privacy, and limits:
- minute detail for 24 hours, hourly for 30 days, and daily for 13 months by default;
- Anonymize addresses stores networks (/24 and /48) instead of devices;
- Most flows per second (20,000) protects the firewall from a flood. Beyond it, flows are dropped and counted.
- Press Save to pending changes, review, and commit. The firewall opens the ports in the chosen zones only.
Point the devices at the firewall
Use the firewall's address in the listener's zone (here 10.0.99.1) and the listener's port. Use an active timeout of 60 seconds where it can be set, so long downloads show up minute by minute.
Cisco IOS-XE (Flexible NetFlow, NetFlow v9 or IPFIX)
flow exporter KORTHVEIL
destination 10.0.99.1
source Vlan99
transport udp 2055
export-protocol netflow-v9
! for IPFIX: export-protocol ipfix and transport udp 4739
option exporter-stats timeout 300
option sampler-table timeout 300
!
flow monitor KV-IPV4
exporter KORTHVEIL
cache timeout active 60
record netflow ipv4 original-input
!
flow monitor KV-IPV6
exporter KORTHVEIL
cache timeout active 60
record netflow ipv6 original-input
!
interface GigabitEthernet0/0/1
ip flow monitor KV-IPV4 input
ipv6 flow monitor KV-IPV6 input
Cisco IOS (classic NetFlow v5)
ip flow-export source Vlan99
ip flow-export version 5
ip flow-export destination 10.0.99.1 2055
ip flow-cache timeout active 1
!
interface GigabitEthernet0/1
ip flow ingress
NetFlow v5 carries IPv4 only. Use Flexible NetFlow for IPv6.
UniFi
- Gateways (UniFi Network 9 and later): open Settings and search for NetFlow. Turn it on, and enter the collector address 10.0.99.1 and port 4739 (UniFi sends IPFIX). The menu location differs between UniFi Network versions.
- UniFi switches do not send sFlow or NetFlow. Collect their traffic at the gateway or the firewall instead.
MikroTik RouterOS
/ip traffic-flow set enabled=yes interfaces=all active-flow-timeout=1m inactive-flow-timeout=15s
/ip traffic-flow target add dst-address=10.0.99.1 port=2055 version=9
# RouterOS 7 can also send IPFIX: version=ipfix port=4739
pfSense (softflowd)
- System › Package Manager › Available Packages: install softflowd.
- Services › softflowd:
- Interface: LAN (and the other inside interfaces);
- Host: 10.0.99.1, Port: 2055;
- Netflow version: 9 (or IPFIX with port 4739);
- Flow tracking level: Full;
- Sampling: off.
- Save.
OPNsense
- Reporting › NetFlow:
- Listening interfaces: LAN and the other inside interfaces;
- WAN interfaces: WAN, so traffic is not counted twice;
- Version: v9;
- Destinations:
10.0.99.1:2055.
- Apply.
Linux hosts (softflowd)
apt install softflowd
softflowd -i eth0 -n 10.0.99.1:2055 -v 9 -t maxlife=60
VMware vSphere Distributed Switch (IPFIX)
- In the vSphere Client, select the distributed switch. Open Configure › Settings › NetFlow, and press Edit:
- Collector IP address: 10.0.99.1, Collector port: 4739;
- Observation domain ID: any number, such as 1;
- Switch IP address: the address the flows come from (put it on the allow-list);
- Active flow export timeout: 60 seconds;
- Sampling rate: 0 (every packet), or N to sample 1 in N.
- For each distributed port group to watch, open Edit Settings › Monitoring, and set NetFlow to Enabled.
Proxmox VE or KVM with Open vSwitch
# NetFlow v9 from the bridge vmbr0
ovs-vsctl -- set Bridge vmbr0 netflow=@nf -- --id=@nf create NetFlow targets=\"10.0.99.1:2055\" active-timeout=60
# or sFlow, 1 in 512
ovs-vsctl -- --id=@s create sFlow agent=vmbr0 target=\"10.0.99.1:6343\" sampling=512 polling=20 -- set Bridge vmbr0 sflow=@s
sFlow switches (example: Aruba CX)
sflow
sflow collector 10.0.99.1 port 6343
sflow sampling 4096
sflow agent-ip 10.0.99.2
interface 1/1/1-1/1/48
sflow
The sampling rate is in every sFlow packet. The collector scales by it, so leave the exporter's sampling field empty.
Check that flows arrive
Open Monitoring › Flows › Flow collector › Exporters.
- Exporters lists each device with:
- the formats it sends, and its packets, flows, and traffic;
- its templates (NetFlow v9 and IPFIX);
- its sampling and when it was last seen;
- its errors, if any.
- Refused devices lists addresses that sent flows but are not on the allow-list. Press Allow to add one. Name it on the Settings tab, save, and commit. A device often sends from another address than expected; this is where you see which one.
- Listeners shows each port and whether it is open.
- Waiting for template counts NetFlow v9 or IPFIX data that arrived before the device sent its templates. It stops growing after a few minutes: devices resend templates periodically. On Cisco,
option … timeoutsets how often.
Explore the traffic
Open the Explore tab. It refreshes by itself every few seconds; Pause holds the view.
- Choose the period with the buttons at the top, from 15 minutes to a year:
- minute detail is used up to 6 hours;
- hourly detail up to 14 days;
- daily summaries beyond.
- Live traffic (the last 15 minutes) and traffic or flows per step of the period sit side by side.
- Charts show the share of traffic by source, destination, DNS name, service, protocol, country, network owner, exporter, and (when tracked) input and output interface. Each shows the 7 largest and Other, with the traffic and percent beside each. Hover for details.
- Drill down: click a slice or a legend row. A chip appears at the top (for example Service HTTPS), and every chart and table shows only that traffic. Click more to narrow further; remove a chip with its ×, or press Clear all. The search box takes an address, a network, or a DNS name.
- Share a view: the filters are in the page address. Copy it, or bookmark it.
- Connections lists the largest flow records: source and destination with their names, country and network owner, service, exporter, traffic, packets, and when they were first and last seen. Sort by any column, search, and page through. Click a name or a service in the table to filter by it, or click the row for everything known about it, with links to the live connections of the address (Traffic verification) and to the device.
- Names come from what the firewall already knows: the names your devices looked up through the DNS resolver add-in, its host records, DHCP names, and cached reverse DNS. Countries and network owners come from the firewall's own IP database. Nothing is looked up on the internet. For each flow the charts use the remote end: the internet side, or the destination when both ends are local. Turn names or countries off under Settings › Names and countries.
- Flow graph (the second view) shows the largest paths, from sources on the left, through destinations, to services on the right, up to 8 per column and the rest as Other. Each ribbon's width is its traffic. Click a node to filter by it. The conversations table is below it.
The graphs follow Settings › Appearance › Graphs & animations. Add the live graph to the dashboard with Layout › Add from other pages › Flows from other devices.
Good to know
- Totals are exact; filtered views are close. Each minute, hour, and day keeps its largest flows (40 times the top-list size) plus exact totals. Filters look at the kept flows, so very small flows are missing from filtered views; the page says so.
- Flows are counted when they arrive. A device reports a long connection every active timeout, so use 60 seconds for minute-accurate graphs.
- Sampled counts are estimates. With 1-in-4096 sampling, small conversations may not appear at all; large ones are accurate.
- Restarts: at most the current minute is lost. Templates are learned again from the devices within minutes.
- Privacy: addresses identify people's devices.
- Keep only what you need.
- Anonymize addresses if the purpose allows it.
- Use Exporters › Erase an address for a data subject's request.
- Security: the ports accept only listed devices, but source addresses can be forged. Keep the listeners in internal zones, and never on the internet zone without a VPN.
Troubleshooting
| Symptom | Check |
|---|---|
| Nothing under Exporters or Refused devices | The listener's zone matches the network the device sends from; the device uses the firewall's address in that zone and the right port; Listeners shows listening. |
| The device is under Refused devices | It sends from another address than listed (often a loopback or VLAN interface). Press Allow, or list its network. |
| Waiting for template keeps growing | The device sends data but no templates. Set its template timeout (Cisco: template data timeout 60), or restart its exporter. |
| Traffic looks too small | The device samples without announcing it. Enter the sampling rate on the exporter. |
| Traffic looks too large | The device announces sampling and the exporter also has an override. Clear the override. Or a router exports on both its inside and outside interfaces: export on inside interfaces only. |
| Dropped over the limit grows | Raise Most flows per second, or reduce what the devices send (sampling, fewer interfaces). |