I Commands

Table Of Contents

I Commands

ip flow monitor


I Commands


This chapter describes the Cisco NX-OS system management commands that begin with the letter I.

ip flow monitor

To enable a Flexible NetFlow flow monitor for traffic that the router is receiving or forwarding, use the ip flow monitor interface configuration mode command. To disable a Flexible NetFlow flow monitor, use the no form of this command.

ip flow monitor monitor-name {input | output} [sampler sampler-name]

Syntax Description

monitor-name

Name of a flow monitor that you previously configured.

input

Monitors traffic that the routers is receiving on the interface.

output

Monitors traffic that the routers is transmitting on the interface.

sampler

(Optional) Specifies the name of a flow sampler for the flow monitor.

sampler-name

Enables a flow sampler for this flow monitor using the name of a sampler that you previously configured.


Defaults

Disabled.

Command Modes

Interface configuration

Supported User Roles

network-admin
vdc-admin

Command History

Release
Modification

4.0(1)

This command was introduced.


Usage Guidelines

You must have already created a flow monitor by using the flow monitor command before you can apply the flow monitor to an interface with the ip flow monitor command to enable traffic monitoring with Flexible NetFlow.

You must have already created a sampler by using the sampler command before you can enable a flow sampler for this flow monitor with the ip flow monitor command.

This command does not require a license.

ip flow monitor sampler

When adding a sampler to a flow monitor, only packets which are selected by the named sampler will be entered into the cache to form flows. Each use of a sampler will result in separate statistics being stored for that usage.

You cannot add a sampler to a flow monitor after the flow monitor has been enabled on an interface. You must remove the flow monitor from the interface prior to enabling the same flow monitor with a sampler. See the "Examples" section for more information.


Note The statistics for each flow will need to be scaled to give the expected true usage. For example, if using a 1 in 10 sampler it is expected that the packet and byte counters will need to be multiplied by 10.


Examples

The following example enables a flow monitor for monitoring input traffic:

switch(config)# interface ethernet0/0
switch(config-if)# ip flow monitor FLOW-MONITOR-1 input

The following example enables a flow monitor for monitoring output traffic:

switch(config)# interface ethernet0/0
switch(config-if)# ip flow monitor FLOW-MONITOR-1 output

The following example enables the same flow monitor on the same interface for monitoring input and output traffic:

switch(config)# interface ethernet0/0
switch(config-if)# ip flow monitor FLOW-MONITOR-1 input
switch(config-if)# ip flow monitor FLOW-MONITOR-1 output

The following example enables two different flow monitors on the same interface for monitoring input and output traffic:

switch(config)# interface ethernet0/0
switch(config-if)# ip flow monitor FLOW-MONITOR-1 input
switch(config-if)# ip flow monitor FLOW-MONITOR-2 output

The following example enables the same flow monitor on two different interfaces for monitoring input and output traffic:

switch(config)# interface ethernet0/0
switch(config-if)# ip flow monitor FLOW-MONITOR-1 input
switch(config)# interface ethernet1/0
switch(config-if)# ip flow monitor FLOW-MONITOR-1 output

The following example enables two different flow monitors on two different interfaces for monitoring input and output traffic:

switch(config)# interface ethernet0/0
switch(config-if)# ip flow monitor FLOW-MONITOR-1 input
switch(config)# interface ethernet1/0
switch(config-if)# ip flow monitor FLOW-MONITOR-2 output

The following example enables a flow monitor for monitoring input traffic, with a sampler to limit the input packets that are sampled:

switch(config)# interface ethernet0/0
switch(config-if)# ip flow monitor FLOW-MONITOR-1 input sampler SAMPLER-1 

The following example enables a flow monitor for monitoring output traffic, with a sampler to limit the output packets that are sampled:

switch(config)# interface ethernet0/0
switch(config-if)# ip flow monitor FLOW-MONITOR-1 output sampler SAMPLER-1 

The following example enables two different flow monitors for monitoring input and output traffic, with a sampler on the flow monitor that is monitoring input traffic to limit the input packets that are sampled:

switch(config)# interface ethernet0/0
switch(config-if)# ip flow monitor FLOW-MONITOR-1 input sampler SAMPLER-1
switch(config-if)# ip flow monitor FLOW-MONITOR-2 output

The following example enables two different flow monitors for monitoring input and output traffic, with a sampler on the flow monitor that is monitoring output traffic to limit the output packets that are sampled:

switch(config)# interface ethernet0/0
switch(config-if)# ip flow monitor FLOW-MONITOR-2 input
switch(config-if)# ip flow monitor FLOW-MONITOR-2 output sampler SAMPLER-1

This example shows what happens when you try to add a sampler to a flow monitor that has already been enabled on an interface without a sampler:

switch(config)# interface Ethernet0/0
switch(config-if)# ip flow monitor FLOW-MONITOR-1 input sampler SAMPLER-1
% Flow Monitor: Flow Monitor 'FLOW-MONITOR-1' is already on in full mode and cannot be 
enabled with a sampler.

This example shows how to remove the flow monitor from the interface so that it can be enabled with the sampler:

switch(config)# interface Ethernet0/0
switch(config-if)# no ip flow monitor FLOW-MONITOR-1 input
switch(config-if)# ip flow monitor FLOW-MONITOR-1 input sampler SAMPLER-1

This example shows what happens when you try to remove a sampler from a flow monitor on an interface by entering the flow monitor command again without the sampler sampler-name keyword and argument:

switch(config)# interface Ethernet0/0
switch(config-if)# ip flow monitor FLOW-MONITOR-1 input
% Flow Monitor: Flow Monitor 'FLOW-MONITOR-1' is already on in sampled mode and cannot be 
enabled in full mode.

This example shows how to remove the flow monitor that was enabled with a sampler from the interface so that it can be enabled without the sampler:

switch(config)# interface Ethernet0/0
switch(config-if)# no ip flow monitor FLOW-MONITOR-1 input sampler SAMPLER-1
switch(config-if)# ip flow monitor FLOW-MONITOR-1 input

Related Commands

Command
Description

flow exporter

Creates a flow exporter.

flow monitor

Creates a flow monitor.

flow record

Creates a flow record.

sampler

Creates a flow sampler.