Example: NetFlow Version 9

The following example shows how to configure NetFlow version 9 on a router. NetFlow version 9 sends the templates and options templates every 20 packets or every 30 minutes per default. This example shows how to modify these default values. Finally, the last two commands enable two specific options templates:

  • The export-stats template includes the number of packets sent and the number of flows exported.

  • The sampler template contains the random-sampler configuration, including the sampler ID, sampling mode, and sampling interval for each configured random sampler.

Router(config)# ip flow-export version 9
Router(config)# ip flow-export destination 10.48.71.219 1234
Router(config)# ip flow-export source Loopback0
Router(config)# ip flow-export template refresh-rate 40
Router(config)# ip flow-export template timeout-rate 60
Router(config)# ip flow-export template options refresh-rate 40
Router(config)# ip flow-export template options timeout-rate 60
Router(config)# ip flow-export template options export-stats
Router(config)# ip flow-export template options sampler

Along with the show ip flow export command, already described, the show ip flow export template command is specific to NetFlow version 9. It shows the number of (option) templates, the number of active (option) templates, the configured timeout for the (option) templates, and so on:

Router# show ip flow export template
   Template Options Flag = 3
   Total number of Templates added = 4
   Total active Templates = 4
   Flow Templates active = 2
   Flow Templates added = 2
   Option Templates active = 2
   Option Templates added = 2
   Template ager polls = 1629
   Option Template ager polls = 1420
Main cache version 9 export is enabled
 Template export information
   Template timeout = 60
   Template refresh rate = 40
 Option export information
   Option timeout = 60
   Option refresh rate = 40



Part II: Implementations on the Cisco Devices