Enable netflow statistics on a Cisco router: Difference between revisions

From wiki.comcert.com
Jump to navigation Jump to search
No edit summary
No edit summary
 
(4 intermediate revisions by the same user not shown)
Line 2: Line 2:
== Introduction ==
== Introduction ==


<span style="font-size:small;"><span style="font-family:verdana,geneva,sans-serif;">OptiView XG is NOT a NetFlow collector, but it is possible to have OptiView poll&nbsp;a Cisco&nbsp;router&nbsp;for IP flow based network statistics.&nbsp;The results (top-n) are&nbsp;available on the OptiView under Device Details or in Application Infrastrcture Tests.&nbsp;In order to do this,&nbsp;routers in your network&nbsp;must be configured correctly.</span></span>
{{#invoke:Message box|ambox |type=notice|text=This TruView feature is only supported on Cisco routers.}}
 
OptiView XG is NOT a NetFlow collector, but it is possible to have OptiView poll a Cisco router for IP flow based network statistics. The results (top-n) are available on the OptiView under Device Details or in Application Infrastrcture Tests. In order to do this, routers in your network must be configured correctly.
 
&nbsp;


&nbsp;
&nbsp;
Line 8: Line 12:
== Solution ==
== Solution ==


<span style="font-size:small;"><span style="font-family:verdana,geneva,sans-serif;">This example has been tested with a CISCO router model 1911 running IOS version 15.0.&nbsp;For more information about the commands used in this script, read the router's IOS specific manual. Before we start&nbsp;we consider SNMP read-only access to the router is&nbsp;already&nbsp;configured&nbsp;and the community has sufficient viewing rights.</span></span>
This configuration example has been tested with a CISCO router model 1911 running IOS version 15. For more information about the commands used in this script, read the router's IOS specific manual. We consider SNMP read-only access to the router already being properly configured and the community has sufficient view rights on the relevant MIBs.
 
&nbsp;
 


=== <span style="font-size:medium;"><span style="font-family: verdana, geneva, sans-serif;">Global Configuration Mode</span></span> ===
=== Global Configuration Mode ===


<span style="font-size:small;"><span style="font-family:verdana,geneva,sans-serif;">Add the following commands to the global configuration section of the router.</span></span>
You must enable flow exports in order to get the top counter tables populated.


<span style="font-size:small;"><span style="font-family:verdana,geneva,sans-serif;">''Note: you MUST&nbsp;''</span></span><span style="font-size:small;"><span style="font-family:verdana,geneva,sans-serif;">''enable flow exports in order to have the top lists populated''</span></span><span style="font-size:small;"><span style="font-family:verdana,geneva,sans-serif;">''. Substitute <SourceInterface> and <DestinationAddress> with the appropriate values. For example, if there is no NetFlow collector present, use &nbsp;'127.0.0.1'&nbsp;as the destination address and 'loopback' as the source interface.''</span></span>
Enter Global Configuration Mode on the router and add the following commands to the configuration. Substitute <SourceInterface> and <DestinationAddress> with the appropriate values.


*<span style="font-size:small;"><span style="font-family:courier new,courier,monospace;">conf t</span></span>
conf t
*<span style="font-size:small;"><span style="font-family:courier new,courier,monospace;">ip flow-cache timeout active 1</span></span>
ip flow-cache timeout active 1
*<span style="font-size:small;"><span style="font-family:courier new,courier,monospace;">ip flow-cache timeout inactive 14</span></span>
ip flow-cache timeout inactive 14
*<span style="font-size:small;"><span style="font-family:courier new,courier,monospace;">ip flow-export source <SourceInterface></span></span>  
ip flow-export source <SourceInterface>
*<span style="font-size:small;"><span style="font-family:courier new,courier,monospace;">ip flow-export version 9</span></span>
ip flow-export version 9
*<span style="font-size:small;"><span style="font-family:courier new,courier,monospace;">ip flow-export destination <DestinationAddress>&nbsp;2055</span></span>
ip flow-export destination <DestinationAddress> 2055
*<span style="font-size:small;"><span style="font-family:courier new,courier,monospace;">ip flow-top-talkers</span></span>
ip flow-top-talkers  
*<span style="font-size:small;"><span style="font-family:courier new,courier,monospace;">ip&nbsp;flow-top-applications</span></span>
top 100
*<span style="font-size:small;"><span style="font-family:courier new,courier,monospace;">top 100</span></span>
sort-by bytes
*<span style="font-size:small;"><span style="font-family:courier new,courier,monospace;">sort-by bytes</span></span>
cache-timeout 300000
*<span style="font-size:small;"><span style="font-family:courier new,courier,monospace;">cache-timeout 300000</span></span>
exit
*<span style="font-size:small;"><span style="font-family:courier new,courier,monospace;">exit</span></span>
exit
*<span style="font-size:small;"><span style="font-family:courier new,courier,monospace;">wr mem</span></span>
ip flow-top-applications
top 100  
sort-by bytes  
cache-timeout 300000  
exit  
wr mem


=== <span style="font-size:medium;"><span style="font-family:verdana,geneva,sans-serif;">Interface Configuration Mode</span></span> ===
=== Interface Configuration Mode ===


''<span style="font-family:verdana,geneva,sans-serif;">Note:&nbsp;This is a common yet&nbsp;not unique&nbsp;way to&nbsp;enable&nbsp;NetFlow exports On interfaces. &nbsp;Please read your router's IOS specific manual&nbsp;for more information on how to configure NetFlow on a per interface basis.</span>''
This is a common yet not unique way to enable NetFlow exports for interfaces. Please read your router's IOS specific manual for more information on how to configure NetFlow on a per interface basis.


<span style="font-family:verdana,geneva,sans-serif;">Add the following command to the interface configuration section of all interfaces carrying traffic. &nbsp;There are at least two interfaces&nbsp;that carry traffic, one facing the network, one facing the site. &nbsp;They&nbsp;may be physical interfaces or&nbsp;virtual interfaces like sub-interfaces, dialers and&nbsp;tunnels. &nbsp;</span>
Add the following command to the interface configuration section of all interfaces carrying traffic. There are at least two interfaces that carry traffic, one facing the network and one facing the site. These can be physical or virtual interfaces like sub -, dialer - and tunnel interfaces.


*<span style="font-family:courier new,courier,monospace;">conf t</span>
conf t
*<span style="font-family:courier new,courier,monospace;">interface <InterfaceName></span>  
interface <InterfaceName>
*<span style="font-family:courier new,courier,monospace;">ip flow egress</span>
ip flow egress
*<span style="font-family:courier new,courier,monospace;">exit</span>
exit  
*<span style="font-family:courier new,courier,monospace;">wr mem</span>
wr mem


=== <span style="font-family:verdana,geneva,sans-serif;"><span style="font-size:medium;">Debug</span></span> ===
=== Debug ===


*<span style="font-size: small; font-family: verdana, geneva, sans-serif;">Use the IOS command sh ip flow export&nbsp;and check if any flows are exported</span>
Still in priviledges mode, use the following commands to verify flow exports and population of the top counters
*<span style="font-family:verdana,geneva,sans-serif;"><span style="font-size:small;">Use the IOS command sh ip flow top-talkers and check if the top-100&nbsp;talkers is populated</span></span>
*<span style="font-family:verdana,geneva,sans-serif;"><span style="font-size:small;">Use the IOS command sh ip flow top-applications and check if the top-100&nbsp;applications is populated&nbsp;</span></span>


<br/> &nbsp;
sh ip flow export
sh ip flow top-talkers
sh ip flow top-applications

Latest revision as of 10:22, 22 October 2016

Introduction

OptiView XG is NOT a NetFlow collector, but it is possible to have OptiView poll a Cisco router for IP flow based network statistics. The results (top-n) are available on the OptiView under Device Details or in Application Infrastrcture Tests. In order to do this, routers in your network must be configured correctly.

 

 

Solution

This configuration example has been tested with a CISCO router model 1911 running IOS version 15. For more information about the commands used in this script, read the router's IOS specific manual. We consider SNMP read-only access to the router already being properly configured and the community has sufficient view rights on the relevant MIBs.

Global Configuration Mode

You must enable flow exports in order to get the top counter tables populated.

Enter Global Configuration Mode on the router and add the following commands to the configuration. Substitute <SourceInterface> and <DestinationAddress> with the appropriate values.

conf t
ip flow-cache timeout active 1
ip flow-cache timeout inactive 14
ip flow-export source <SourceInterface>
ip flow-export version 9
ip flow-export destination <DestinationAddress> 2055
ip flow-top-talkers 
top 100
sort-by bytes
cache-timeout 300000
exit
exit
ip flow-top-applications
top 100 
sort-by bytes 
cache-timeout 300000 
exit 
wr mem

Interface Configuration Mode

This is a common yet not unique way to enable NetFlow exports for interfaces. Please read your router's IOS specific manual for more information on how to configure NetFlow on a per interface basis.

Add the following command to the interface configuration section of all interfaces carrying traffic. There are at least two interfaces that carry traffic, one facing the network and one facing the site. These can be physical or virtual interfaces like sub -, dialer - and tunnel interfaces.

conf t
interface <InterfaceName>
ip flow egress
exit 
wr mem

Debug

Still in priviledges mode, use the following commands to verify flow exports and population of the top counters

sh ip flow export
sh ip flow top-talkers
sh ip flow top-applications