---
title: "Flow export from Cisco devices"
description: "Flexible NetFlow v9 on Catalyst 9000, 3850 and ASR/ISR, NetFlow-Lite on the 2960-X, NetFlow and sFlow on Nexus 9000 and sFlow on Cisco small-business switches, with the commands, checks and the caveats we have seen in production."
---

> Documentation Index
> Fetch the complete documentation index at: https://netsense-nms.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Flow export from Cisco devices

This page has the Cisco commands for sending flows to NetSense. Read
[Rules for every device](https://netsense-nms.com/docs/guides/flow-export/#rules-for-every-device) and
[Sampling and traffic volume](https://netsense-nms.com/docs/guides/flow-export/#sampling-and-traffic-volume) first: they
decide which ports to configure and what the numbers in NetSense mean.

In the commands, `<agent-ip>` is the IP address of your NetSense agent,
`<device-ip-in-netsense>` is the IP the device has in NetSense and `<edge port>` is a border
port: an upstream, IX, PNI, peering or CDN cache port.

## Which Cisco models, which protocol

| Model | Use | Volumes in NetSense | Status |
| --- | --- | --- | --- |
| Catalyst 9300, 9500, 9600, 3850 | Flexible NetFlow v9, unsampled | Real totals | In production |
| Catalyst 9500X | Flexible NetFlow v9 with a sampler | About 1/N of real | Not yet verified |
| Catalyst 2960-X, 2960-XR | NetFlow-Lite v9 (sampled only) | About 1/N of real | Not yet verified |
| ASR 1000, ISR 1000/4000 (IOS-XE) | Flexible NetFlow v9, unsampled | Real totals | Not yet verified |
| Nexus 9000 Cloud Scale (-EX, -FX, -GX), for example 93180YC-EX | NetFlow v9, unsampled, inbound | Real totals | Not yet verified |
| Nexus 9000 first generation, for example 9372PX-E | sFlow | Estimated totals | Not yet verified |
| SG300, SG350, CBS350 (small business) | sFlow | Estimated totals | Not yet verified |

Catalyst 9000 switches have no sFlow. Nexus 9000 Cloud Scale models offer both NetFlow and
sFlow: NetFlow gives exact volumes.

## Catalyst 9300, 9500, 9600 and 3850 (IOS-XE 3.6, 16.x, 17.x)

**In production** on WS-C3850-48T with IOS-XE 03.06.05E, WS-C3850-48XS with IOS-XE 16.9.5
and C9500-48Y4C with IOS-XE 16.12.04. The block below is the standard Flexible NetFlow
configuration for these releases.

Use Flexible NetFlow v9 without a sampler. The switch counts every packet, so NetSense shows
real volumes.

```txt
flow record NETSENSE-V4
 match ipv4 protocol
 match ipv4 source address
 match ipv4 destination address
 match transport source-port
 match transport destination-port
 match interface input
 collect interface output
 collect transport tcp flags
 collect counter bytes long
 collect counter packets long
 collect timestamp absolute first
 collect timestamp absolute last
!
flow record NETSENSE-V6
 match ipv6 protocol
 match ipv6 source address
 match ipv6 destination address
 match transport source-port
 match transport destination-port
 match interface input
 collect interface output
 collect transport tcp flags
 collect counter bytes long
 collect counter packets long
 collect timestamp absolute first
 collect timestamp absolute last
!
flow exporter NETSENSE
 destination <agent-ip>
 source Loopback0
 transport udp 2055
 export-protocol netflow-v9
 template data timeout 60
!
flow monitor NETSENSE-V4-MON
 exporter NETSENSE
 record NETSENSE-V4
 cache timeout active 60
 cache timeout inactive 15
!
flow monitor NETSENSE-V6-MON
 exporter NETSENSE
 record NETSENSE-V6
 cache timeout active 60
 cache timeout inactive 15
```

```txt
interface <edge port>
 ip flow monitor NETSENSE-V4-MON input
 ip flow monitor NETSENSE-V4-MON output
 ipv6 flow monitor NETSENSE-V6-MON input
 ipv6 flow monitor NETSENSE-V6-MON output
```

- **Source address.** Replace `Loopback0` with the interface that holds
  `<device-ip-in-netsense>`. Set the export source under `flow exporter` with
  `source <interface>`. The older `ip flow-export source` command belongs to traditional
  NetFlow and does not apply here.
- **The management port cannot export.** Flexible NetFlow does not export from the `Gi0/0`
  management port. If NetSense polls the switch on its `Gi0/0` address, change the device's
  IP in NetSense to a loopback or SVI address and export from that interface.
- If the agent is reachable only through a VRF, add it to the destination:
  `destination <agent-ip> vrf <name>`.
- **Counters.** Keep `collect counter bytes long` and `collect counter packets long`. Both
  counters are needed: a record without the packet counter shows every flow with 0 packets.
- **Timeouts.** The defaults are 1800 s active and 15 s inactive. Set 60 s active, as above,
  so long sessions show up every minute.
- **Directions.** Input and output on border ports only, never on links between your own
  routers and switches. Each port monitor counts the packets that cross that port, so a
  packet exported on two ports is counted twice.
- If your release rejects `collect timestamp absolute`, use `collect timestamp sys-uptime first`
  and `collect timestamp sys-uptime last`.
- On input monitors some releases report the output interface as 0. The input interface is
  always set.
- **Port-channels.** An L2 port-channel does not take a monitor: configure its member ports.
  On an L3 port-channel, configure either the port-channel or its members, never both.
- SVIs and VLAN interfaces take monitors. Tunnels and MPLS-enabled interfaces do not. One
  monitor per traffic type (IPv4, IPv6) and direction per interface.
- Drop the IPv6 record, monitor and interface lines if you have no IPv6 traffic.
- **Packet size.** There is no export packet size setting. Keep the MTU of the path to the
  agent at 1500 bytes.
- **Licensing.** Catalyst 9000 runs Flexible NetFlow with Network Essentials. On the 3850 it
  needs IP Base or IP Services; LAN Base does not have it.
- The switch sends its template with the export packets, so flows appear within a few
  minutes of the configuration.
- **Check:** `show flow exporter NETSENSE statistics`,
  `show flow monitor NETSENSE-V4-MON statistics`,
  `show flow monitor NETSENSE-V4-MON cache format table` and `show flow interface <edge port>`.
- **Remove:** on each port `no ip flow monitor NETSENSE-V4-MON input`,
  `no ip flow monitor NETSENSE-V4-MON output` and the same for `ipv6 flow monitor
  NETSENSE-V6-MON`, then `no flow monitor NETSENSE-V4-MON`, `no flow monitor NETSENSE-V6-MON`,
  `no flow exporter NETSENSE`, `no flow record NETSENSE-V4` and `no flow record NETSENSE-V6`.

:::caution[Clock and timestamps]
Session times come from the switch. Set `clock timezone` and NTP: we have seen a Catalyst
9500 send local time labeled as UTC, which shifted every session by the time zone offset.

**Catalyst 9600 on IOS-XE 17.12.05**: after about 49.7 days of uptime its flow timestamps
jump 49.7 days into the past. Upgrade IOS-XE, or export from another device.
:::

:::caution[The agent must be reachable]
The switch sends flows to the agent; the agent never connects to the switch. If the agent
sits behind NAT from the switch's point of view, the exports never arrive, even when the
switch shows them as sent. Forward UDP 2055 to the agent or export to an address the switch
can reach directly, and open UDP 2055 on any firewall in between.
:::

## Catalyst 9500X (IOS-XE 17.x)

**Not yet verified.** The vendor's documented configuration. Check it against your release
with `?` help and tell Extreme Labs how it went.

The C9500X (for example C9500X-28C8D) exports Flexible NetFlow v9 only with a sampler, and
only inbound. Use the records, exporter and monitors from the
[Catalyst block](#catalyst-9300-9500-9600-and-3850-ios-xe-36-16x-17x), remove
`collect interface output` from both records, and add a sampler:

```txt
sampler NETSENSE-SAMP
 mode random 1 out-of <N>
!
interface <edge port>
 ip flow monitor NETSENSE-V4-MON sampler NETSENSE-SAMP input
 ipv6 flow monitor NETSENSE-V6-MON sampler NETSENSE-SAMP input
```

- **Volumes are about 1/N of the real traffic.** NetSense shows the counts as the switch sends
  them and does not multiply by N. The traffic mix (peers, protocols, hosts, shares) is right;
  use the SNMP port graphs for totals. Choose the lowest N the switch accepts
  (`mode random 1 out-of ?`).
- One sampler rate applies to the whole switch.
- **Inbound only.** Apply the monitor inbound on the border ports and inbound on the ports
  toward your customers or BNGs, never on links between your own routers and switches.
- `collect interface output` is not supported on this model.
- On a port-channel, configure the port-channel, not its members.
- **Check** and **Remove**: as for the [Catalyst 9300 and 9500](#catalyst-9300-9500-9600-and-3850-ios-xe-36-16x-17x),
  plus `no sampler NETSENSE-SAMP`.

## Catalyst 2960-X and 2960-XR (IOS 15.x)

**Not yet verified.** The vendor's documented configuration. Check it against your release
with `?` help and tell Extreme Labs how it went.

The 2960-X has no sFlow. It exports NetFlow-Lite, a sampled NetFlow v9, inbound only, on
physical ports and SVIs. NetFlow-Lite comes with the **LAN Base** and **IP Lite** images, not
LAN Lite.

```txt
flow record NETSENSE-V4
 match ipv4 protocol
 match ipv4 source address
 match ipv4 destination address
 match transport source-port
 match transport destination-port
 collect interface input
 collect counter bytes long
 collect counter packets long
 collect timestamp sys-uptime first
 collect timestamp sys-uptime last
!
flow exporter NETSENSE
 destination <agent-ip>
 source Vlan1
 transport udp 2055
 export-protocol netflow-v9
!
flow monitor NETSENSE-MON
 exporter NETSENSE
 record NETSENSE-V4
 cache timeout active 60
 cache timeout inactive 15
!
sampler NETSENSE-SAMP
 mode deterministic 1 out-of 32
```

```txt
interface <edge port>
 ip flow monitor NETSENSE-MON sampler NETSENSE-SAMP input
```

- Replace `Vlan1` with the SVI that holds `<device-ip-in-netsense>`.
- **Sampled only.** The sampler cannot be left out, so NetSense shows about 1/32 of the real
  volume with this setting. Use it for the traffic mix and the SNMP port graphs for totals.
- **Inbound only.** Apply the monitor on the border ports and on the ports toward your
  customers, never on links between your own switches.
- **Check:** `show flow monitor NETSENSE-MON cache` and `show flow exporter statistics`.
- **Remove:** `no ip flow monitor NETSENSE-MON sampler NETSENSE-SAMP input` on each port, then
  `no flow monitor NETSENSE-MON`, `no sampler NETSENSE-SAMP`, `no flow exporter NETSENSE` and
  `no flow record NETSENSE-V4`.

## ASR 1000 and ISR 1000/4000 (IOS-XE)

**Not yet verified.** The vendor's documented configuration. Check it against your release
with `?` help and tell Extreme Labs how it went.

Routers use the same Flexible NetFlow v9 model as the
[Catalyst switches](#catalyst-9300-9500-9600-and-3850-ios-xe-36-16x-17x), without a sampler.
Take that block with one change: routers collect uptime timestamps instead of absolute ones.

```txt
flow record NETSENSE-V4
 match ipv4 protocol
 match ipv4 source address
 match ipv4 destination address
 match transport source-port
 match transport destination-port
 match interface input
 collect interface output
 collect transport tcp flags
 collect counter bytes long
 collect counter packets long
 collect timestamp sys-uptime first
 collect timestamp sys-uptime last
```

Write `NETSENSE-V6` the same way with the `ipv6` match lines. The exporter and monitors are
unchanged. Apply the monitors input and output on the border interfaces, as on the Catalyst.

- A record that a monitor uses cannot be edited. To change an existing record, remove it
  from the monitors first.
- Export from a loopback that holds `<device-ip-in-netsense>`: `source Loopback0`.
- Sub-interfaces (dot1q) take monitors. Configure the sub-interface that carries the border
  traffic.
- On a PPPoE or IPoE BNG, put the monitors on the border interfaces, never on the per-session
  Virtual-Access interfaces: their interface index changes with every session.
- **Check** and **Remove**: as for the Catalyst switches.

## Nexus 9000 NetFlow (NX-OS, Cloud Scale models)

**Not yet verified.** The vendor's documented configuration. Check it against your release
with `?` help and tell Extreme Labs how it went.

NetFlow v9 runs on the Cloud Scale models: 9300-EX, -FX, -FX2, -FX3, -GX and -GX2 (for example
93180YC-EX, 9336C-FX2, 93360YC-FX2) and 9500 with EX, FX or GX line cards. It counts every
packet, so volumes are exact. First-generation models such as the 9372PX-E do not have it:
use [sFlow](#nexus-9000-sflow-9372px-e-and-other-models).

```txt
feature netflow
flow exporter NETSENSE
  destination <agent-ip> use-vrf default
  source loopback0
  transport udp 2055
  version 9
    template data timeout 60
flow record NETSENSE-V4
  match ipv4 source address
  match ipv4 destination address
  match ip protocol
  match transport source-port
  match transport destination-port
  collect counter bytes long
  collect counter packets long
  collect transport tcp flags
  collect timestamp sys-uptime first
  collect timestamp sys-uptime last
flow record NETSENSE-V6
  match ipv6 source address
  match ipv6 destination address
  match ip protocol
  match transport source-port
  match transport destination-port
  collect counter bytes long
  collect counter packets long
  collect transport tcp flags
  collect timestamp sys-uptime first
  collect timestamp sys-uptime last
flow monitor NETSENSE-V4-MON
  record NETSENSE-V4
  exporter NETSENSE
flow monitor NETSENSE-V6-MON
  record NETSENSE-V6
  exporter NETSENSE
flow timeout 60
```

```txt
interface <edge port>
  ip flow monitor NETSENSE-V4-MON input
  ipv6 flow monitor NETSENSE-V6-MON input
```

- **Port 2055.** The Nexus default export port is 9995. Keep `transport udp 2055`.
- **Source address.** `source` is mandatory: without it the switch drops the flows. Replace
  `loopback0` with the interface that holds `<device-ip-in-netsense>`. The source and the
  destination must be in the same VRF. If NetSense polls the switch on its `mgmt0` address,
  use `use-vrf management` and `source mgmt0`.
- **Timeouts.** NX-OS has one global timer, `flow timeout` (default 10 s). Set 60. There is no
  separate inactive timer.
- **Inbound only.** Apply the monitors inbound on the border ports and inbound on the ports
  toward your customers or BNGs, never on links between your own routers and switches. The
  9300-EX has no outbound NetFlow.
- The switch adds the input interface and SNMP interface index by default, so NetSense shows
  port names.
- **Interfaces.** IP monitors go on L3 ports, sub-interfaces, SVIs and VLANs. A monitor cannot
  be shared between VLAN and L3 interfaces. Not on tunnels, loopbacks or `mgmt0`.
- **Hardware.** The -EX models have a fixed NetFlow TCAM region. On -FX models you can resize it
  with `hardware access-list tcam region ing-netflow <size>` and a reload.
- **Check:** `show flow exporter NETSENSE`, `show flow interface`, `show flow cache ipv4` and
  `show running-config netflow`.
- **Remove:** `no ip flow monitor NETSENSE-V4-MON input` and
  `no ipv6 flow monitor NETSENSE-V6-MON input` on each port, then the monitors, records and
  exporter (`no flow monitor ...`, `no flow record ...`, `no flow exporter NETSENSE`) and
  `no feature netflow`.

## Nexus 9000 sFlow (9372PX-E and other models)

**Not yet verified.** The vendor's documented configuration. Check it against your release
with `?` help and tell Extreme Labs how it went.

sFlow is the only flow export on first-generation models such as the 9372PX-E. Cloud Scale
models have it too. NetSense scales sFlow samples by the sampling rate, so the totals are
estimates of the real traffic.

```txt
feature sflow
sflow sampling-rate 4096
sflow max-datagram-size 1400
sflow agent-ip <device-ip-in-netsense>
sflow collector-ip <agent-ip> vrf default
sflow collector-port 6343
sflow data-source interface ethernet 1/49
```

- **TCAM first on the 9372PX-E.** On the 9372PX, 9372PX-E, 9372TX, 9332PQ and 93120TX, carve
  the sFlow TCAM region before uplink ports can be data sources:
  `hardware access-list tcam region sflow 256`, then save and reload. If the switch refuses
  the size, shrink another region (for example `span`) first.
- `sflow agent-ip` must be the IP the switch has in NetSense: that is how NetSense matches the
  samples to it. The agent and collector addresses must be the same address family. Use
  `vrf management` if the agent is reached through the management VRF.
- **Data sources = border ports only.** Each data source samples both inbound and outbound
  traffic. Add only the border ports (for example `ethernet 1/49` above), never ports on links
  between your own switches and not the customer-facing ports as well, or the same packet is
  sampled twice.
- Port-channels can be data sources. SVIs and sub-interfaces cannot.
- **Sampling.** The lowest rate is 4096. On Cloud Scale models only 4096, 8192, 16384, 32768
  and 65536 are accepted; other values round up.
- Keep `sflow max-datagram-size 1400` (the default): export packets must stay at 1500 bytes or
  less.
- Do not configure `sflow extended bgp`: NetSense does not use those records.
- The switch takes one collector. While sFlow data sources exist, SPAN sessions cannot come up
  and storm control does not work on those ports.
- sFlow exporters appear in the **Flows** views but not in **Flow Logs** today.
- **Check:** `show sflow`, `show sflow statistics` and `show running-config sflow all`.
- **Remove:** `no sflow data-source interface ethernet 1/49` for each port, then
  `no feature sflow`.

## SG300, SG350, CBS350 (Cisco small business)

**Not yet verified.** The vendor's documented configuration. Check it against your release
with `?` help and tell Extreme Labs how it went.

These switches have sFlow only, no NetFlow. Flow sampling is off until you enable it per port.

```txt
sflow receiver 1 <agent-ip> port 6343 max-datagram-size 1400
interface <edge port>
 sflow flow-sampling 1024 1
```

- The last number in `sflow flow-sampling 1024 1` is the receiver index, 1 here.
- The agent address in the sFlow data must be the IP the switch has in NetSense. On a switch
  with more than one IP interface, check it in `show sflow configuration` and, where your
  firmware offers it, set the source with `sflow receiver source-interface`.
- On the SG300, sFlow is only in later firmware. If `sflow ?` is rejected, the switch has no
  flow export.
- Enable sampling on border ports only, never on links between your own switches.
- sFlow exporters appear in the **Flows** views but not in **Flow Logs** today.
- **Check:** `show sflow configuration` and `show sflow statistics`.
- **Remove:** `no sflow flow-sampling` on each port, then `no sflow receiver 1`.

## Other Cisco models

Older Catalyst models (2950, 2960S, 2960G, 3750, 4948), Nexus 3000 and Meraki are not covered
on this page. Ask Extreme Labs and we will check what your model can export.

When the device is configured, follow
[Check that flows arrive](https://netsense-nms.com/docs/guides/flow-export/#check-that-flows-arrive). If nothing shows,
see [Troubleshooting](https://netsense-nms.com/docs/guides/flow-export/#troubleshooting).

Source: https://netsense-nms.com/docs/guides/flow-export/cisco/index.mdx
