Share:
Notifications
Clear all

To configure Netflow in cisco nexus

1 Posts
1 Users
0 Reactions
123 Views
(@paul0000)
Posts: 68
Trusted Member
Topic starter
 

To configure NetFlow on a Cisco Nexus switch, you'll need to configure both the NetFlow exporter (which exports flow data) and the NetFlow monitor (which defines the flow characteristics). Cisco Nexus devices use NetFlow v9 and IPFIX as the primary flow export protocols.

Here’s a step-by-step guide to enabling NetFlow on a Cisco Nexus switch:

Step 1: Enable NetFlow Globally

Before you can configure NetFlow on interfaces, you need to enable it globally on the Nexus switch.

Nexus# configure terminal 
Nexus(config)# feature netflow

This command enables the NetFlow feature on the device.

Step 2: Define a NetFlow Exporter

The exporter defines where the NetFlow data is sent. This typically points to a NetFlow collector or analysis tool (such as SolarWinds, PRTG, etc.).

Nexus(config)# flow exporter EXPORTER_NAME 
Nexus(config-flow-exporter)# destination <collector-ip> 
Nexus(config-flow-exporter)# transport udp <port> 
Nexus(config-flow-exporter)# source-interface <interface> 
Nexus(config-flow-exporter)# export-protocol netflow-v9
  • EXPORTER_NAME: Name of the exporter (you can choose any name, like NetFlowExporter).
  • destination: IP address of the NetFlow collector.
  • transport udp <port>: Specifies the UDP port (default is 2055).
  • source-interface: The interface used to send the flow data to the collector (optional but recommended for best performance).
  • export-protocol: Choose netflow-v9 or ipfix depending on your collector’s capabilities.

Step 3: Define a NetFlow Monitor

The NetFlow monitor defines which flow information to collect and how to classify traffic flows.

Nexus(config)# flow monitor MONITOR_NAME 
Nexus(config-flow-monitor)# record netflow-original 
Nexus(config-flow-monitor)# exporter EXPORTER_NAME
  • MONITOR_NAME: Name of the flow monitor (e.g., NetFlowMonitor).
  • record netflow-original: Defines the flow record. In most cases, netflow-original is used, which captures a standard set of flow information.
  • exporter: Points to the previously configured exporter.

Step 4: Apply the NetFlow Monitor to Interfaces

Now that the exporter and monitor are configured, apply the NetFlow monitor to specific interfaces or globally.

Nexus(config)# interface Ethernet1/1 
Nexus(config-if)# flow monitor MONITOR_NAME input 
Nexus(config-if)# flow monitor MONITOR_NAME output
  • input: Captures incoming traffic.
  • output: Captures outgoing traffic.

You can apply the flow monitor to multiple interfaces as needed.

Step 5: Verify NetFlow Configuration

After you’ve configured NetFlow, you can verify the settings with the following commands:

Nexus# show flow exporter 
Nexus# show flow monitor 
Nexus# show flow statistics

These commands will provide you with information on the flow exporter status, configured monitors, and traffic statistics.

Example Configuration:

Here’s an example of the full configuration:

Nexus# configure terminal
Nexus(config)# feature netflow

! Define the flow exporter
Nexus(config)# flow exporter NetFlowExporter
Nexus(config-flow-exporter)# destination 192.168.1.100
Nexus(config-flow-exporter)# transport udp 2055
Nexus(config-flow-exporter)# source-interface Ethernet1/1
Nexus(config-flow-exporter)# export-protocol netflow-v9

! Define the flow monitor
Nexus(config)# flow monitor NetFlowMonitor
Nexus(config-flow-monitor)# record netflow-original
Nexus(config-flow-monitor)# exporter NetFlowExporter

! Apply the flow monitor to interfaces
Nexus(config)# interface Ethernet1/1
Nexus(config-if)# flow monitor NetFlowMonitor input
Nexus(config-if)# flow monitor NetFlowMonitor output

! Verify configuration
Nexus# show flow exporter
Nexus# show flow monitor
Nexus# show flow statistics

Step 6: Optional - Configure Sampling (if required)

If you want to reduce the volume of flow data, you can configure flow sampling on specific interfaces. For example, to sample 1 out of every 100 packets:

Nexus(config)# interface Ethernet1/1
Nexus(config-if)# flow sampler SAMPLER_NAME input rate 100

This configures a flow sampler that captures 1 out of every 100 packets on the input side.

Step 7: Configure Flow Timeout (Optional)

You can also adjust the timeout for flows, which defines how long flows remain active before they are exported to the collector.

Nexus(config)# flow timeout active 60
Nexus(config)# flow timeout inactive 15
  • active: Time in seconds to wait before a flow is considered "active" and exported.
  • inactive: Time in seconds before an inactive flow is exported.

 

 
Posted : 17/12/2024 6:52 pm
Share: