How To Configure NetFlow On A Cisco Router

Recently I was wondering what was the best way to analyze and monitor the traffic that passes the routers between sites \ offices.


After researching the issue I found out the Cisco NetFlow protocol allows you to analyze the traffic that pass the router,  however In order to get this done we need to

Configure our routers to do a few things:


1.       Install Software that analyze NetFlow

2.       Enable NetFlow on the router

3.       Configure the router to send the logs to a netflow analyzer server (needs to be configure before)


Once you got the server or PC up and running with a netflow software (there are a lot of free application, I used Manage Engine NetFlow Analyzer 6 which allows you to monitor 2 router for free) , We need to tell the router to send the NetFlow logs to the server, To do that here is the commands we need to type:



Router(config)# ip flow-export destination {hostname|ip_address} 9996    

Router(config)#  ip flow-export source {interface} {interface_number}    

Router(config)#ip flow-export version 5                        

Router(config)#  ip flow-export version 5

Router(config)#  ip flow-cache timeout inactive 15

Router(config)#  snmp-server ifindex persist



To monitor and Check that we configured the Router to send the logs type:


Router# show ip flow export

Router#   show ip cache flow

Router#  show ip cache verbose flow



Configuration Sample:


router#configure terminal
router(config)#interface FastEthernet 0/1
router(config-if)#ip route-cache flow
router(config)#ip flow-export destination 9996
router(config)#ip flow-export source FastEthernet 0/1
router(config)#ip flow-export version 5
router(config)#ip flow-cache timeout active 1
router(config)#ip flow-cache timeout inactive 15
router(config)#snmp-server ifindex persist

router# copy run start
router#show ip flow export
router#show ip cache flow




To Cancel NetFlow:


no ip flow-export destination {hostname|ip_address} {port_number}

no ip route-cache flow