Configuring Cflowd Traffic Flow Monitoring
This article provides general procedures for configuring cflowd from the CLI.
Cflowd Configuration Components
Cflowd configuration is done using the basic components of centralized data policy. You configure cflowd template options, including the location of the cflowd collector (if you are sending the flow to a collector), and you must configure cflowd as an action in the data policy.
To create a centralized data policy that enables cflowd, you include the following components in the configuration on a vSmart controller:
Component | Description | Configuration Command |
---|---|---|
Lists | Groupings of related items that you reference in the match and action portions of the data policy configuration. For centralized data policy, you can group IP prefixes, sites, and VPNs. | policy lists |
Cflowd template | Template that defines the location of cflowd collectors, how often sets of sampled flows should be sent to the collectors, and how often the cflowd template should be sent to the collectors. You must configure template, but it need not contain any parameters a collector is optional. With no parameters, the data flow cache on vEdge routers is managed using default settings, and no flow export occurs. | policy cflowd-template |
Centralized data policy instance | Container for centralized data policy that filters packets based on IP prefix and IP packet header fields. | policy data-policy |
VPN list | List of VPNs to which the data policy applies. | policy data-policy vpn-list |
Numbered sequences of match–action pairs | Sequences that establish the order in which the policy components are applied | policy data-policy vpn-list sequence |
Match parameters | Conditions that packets must match to be considered for a data policy. | policy data-policy vpn-list sequence match |
Actions | Monitor traffic flow for matching packets. | policy data-policy vpn-list sequence action cflowd |
Default action | Action to take if a packet matches none of the policy conditions. | policy data-policy vpn-list default-action |
Application of centralized data policy | For a cflowd policy to take effect, you apply it to one or more sites in the overlay network, and you associated a cflowd template with the policy | apply-policy site-list data-policy |
General Configuration Procedure
Following are the high-level steps for configuring a cflowd centralized data policy to perform traffic monitoring and to export traffic flows to a collector:
- Create a list of overlay network sites to which the cflowd centralized data policy is to be applied (in the apply-policy command):
vSmart(config)# policy
vSmart(config-policy)# lists site-list list-name
vSmart(config-lists-list-name)#& site-id site-id
The list can contain as many site IDs as necessary. Include one site-id command for each site ID. For contiguous site IDs, you can specify a range of numbers separated with a dash (–). Create additional site lists, as needed. - Create a list of VPN for which the cflowd centralized data policy is to be configured (in the policy data-policy command):
vSmart(config)# policy lists
vSmart(config-lists)# vpn-list list-name
vSmart(config-lists-list-name)# vpn vpn-id - Create lists of IP prefixes, as needed:
vSmart(config)# policy lists
vSmart(config-lists)# prefix-list list-name
vSmart(config-lists-list-name)# ip-prefix prefix/length - Configure a cflowd template, and optionally, configure template parameters, including the location of the cflowd collector, the flow export timers, and the flow sampling interval:
vSmart(config)# policy cflowd-template template-name
vSmart(config-cflowd-template-template-name)# collector vpn vpn-id address ip-address port port-number transport-type (transport_tcp | strong>transport_udp) source-interface interface-name
vSmart(config-cflowd-template-template-name)# flow-active-timeout seconds
vSmart(config-cflowd-template-template-name)# flow-inactive-timeout seconds
vSmart(config-cflowd-template-template-name)# flow-sampling-interval number
vSmart(config-cflowd-template-template-name)# template-refresh seconds
You must configure a cflowd template, but it need not contain any parameters. With no parameters, the data flow cache on vEdge nodes is managed using default settings, and no flow export occurs.
You can configure one cflowd template per vEdge router, and it can export to a maximum of four collectors. By default, an actively flowing data set is exported to the collector every 600 seconds (10 minutes), a data set for a flow on which no traffic is flowing is sent every 60 seconds (1 minute), and the cflowd template record fields (the three timer values) are sent to the collector every 90 seconds. Also by default, a new flow is created immediately after an existing flow has ended.
If you modify the configuration of the template record fields, the changes take effect only on flows that are created after the configuration change has been propagated to the vEdge router. Because an existing flow continues indefinitely, to have configuration changes take effect, clear the flow with the clear app cflowd flows command. - If you configure a logging action, configure how often to log packets to the syslog files:
vEdge(config)# policy log-frequency number - Create a data policy instance and associate it with a list of VPNs:
vSmart(config)# policy data-policy policy-name
vSmart(config-data-policy-policy-name)# vpn-list list-name - Create a sequence to contain a single match–action pair:
vSmart(config-vpn-list-list-name)# sequence number
vSmart(config-sequence-number)#
The match–action pairs are evaluated in order, by sequence number, starting with the lowest numbered pair and ending when the route matches the conditions in one of the pairs. If no match occurs, the default action is taken. - Define match parameters for the data packets:
vSmart(config-sequence-number)# match parameters - In the action, enable cflowd:
vSmart(config-sequence-number)# action cflowd - In the action, count or log data packets:
vSmart(config-sequence-number)# action count counter-name
vSmart(config-sequence-number)# action log - Create additional numbered sequences of match–action pairs within the data policy, as needed.
- If a route does not match any of the conditions in one of the sequences, it is rejected by default. If you want nonmatching prefixes to be accepted, configure the default action for the policy:
vSmart(config-policy-name)# default-action accept - Apply the policy and the cflowd template to one or more sites in the overlay network:
vSmart(config)# apply-policy site-list list-name data-policy policy-name
vSmart(config)# apply-policy site-list list-name cflowd-template template-name
Structural Components of Policy Configuration for Cflowd
Here are the structural components required to configure cflowd on a vSmart controller. Each component is explained in more detail in the sections below.
policy lists prefix-list list-name ip-prefix prefix site-list list-name site-id site-id vpn-list list-name vpn-id vpn-id log-frequency number cflowd-template template-name collector vpn vpn-id address ip-address port port-number transport transport-type source-interface interface-name flow-active-timeout seconds flow-inactive-timeout seconds flow-sampling-interval number template-refresh seconds data-policy policy-name vpn-list list-name sequence number match match-parameters action cflowd count counter-name drop log default-action (accept | drop) apply-policy site-list list-name data-policy policy-name cflowd-template template-name
Lists
Centralized data policy uses the following types of lists to group related items. You configure lists under the policy lists command hierarchy on vSmart controllers.
List Type | Description | Command |
---|---|---|
Data prefix list | List of one or more IP prefixes. | data-prefix-list list-name |
Site list | List of one or more site identifiers in the overlay network. You can specify a single site identifier (such as site-id 1) or a range of site identifiers (such as site-id 1-10). | site-list list-name |
VPN list | List of one or more VPNs in the overlay network. You can specify a single VPN identifier (such as vpn-id 1) or a range of VPN identifiers (such as vpn-id 1-10). | vpn-list list-name |
Logging Frequency
If you configure a logging action, by default, the vEdge router logs all data packet headers to a syslog file. To log only a sample of the data packet headers:
vEdge(config)# policy log-frequency number
number specifies how often to to log packet headers. For example, if you configure log-frequency 20, every sixteenth packet is logged. While you can configure any integer value for the frequency, the software rounds the value down to the nearest power of 2.
Cflowd Templates
For each cflowd data policy, you must create a template that defines the location of the flow collector:
vSmart(config)# policy cflowd-template template-name
The template can specify cflowd parameters or it can be empty. With no parameters, the data flow cache on vEdge nodes is managed using default settings, and no flow export occurs.
In the cflowd template, you can define the location of the flow collection:
vSmart(config-cflowd-template-template-name)# collector vpn vpn-id address ip-address port port-number transport transport-type source-interface interface-name
You can configure one cflowd template per vEdge router, and it can export to a maximum of four collectors.
You can configure flow export timers:
vSmart(config)# policy cflowd-template template-name
vSmart(config-cflowd-template-template-name)# flow-active-timeout seconds
vSmart(config-cflowd-template-template-name)# flow-inactive-timeout seconds
vSmart(config-cflowd-template-template-name)# flow-sampling-interval number
vSmart(config-cflowd-template-template-name)# template-refresh seconds
By default, an actively flowing data set is exported to the collector every 600 seconds (10 minutes), a data set for a flow on which no traffic is flowing is sent every 60 seconds (1 minute), and the cflowd template record fields are sent to the collector every 90 seconds. For flow sampling, by default, a new flow is started immediately after an existing flow ends.
For a single vEdge router, you can configure a maximum of four collectors.
Data Policy Instance
For each centralized data policy, you create a named container for that policy with a policy data-policy policy-name command. For a single vEdge router, you can configure a maximum of four cflowd policies.
VPN Lists
Each centralized data policy instance applies to the VPNs contained in a VPN list. Within the policy, you specify the VPN list with the policy data-policy vpn-list list-name command. The list name must be one that you created with a policy lists vpn-list list-name command.
Sequences
Within each VPN list, a centralized data policy contains sequences of match–action pairs. The sequences are numbered to set the order in which data traffic is analyzed by the match–action pairs in the policy. You configure sequences with the policy data-policy vpn-list sequence command.
Each sequence in a centralized data policy can contain one match command and one action command.
Match Parameters
Centralized data policy can match IP prefixes and fields in the IP headers. You configure the match parameters under the policy data-policy vpn-list sequence match command.
For data policy, you can match these parameters:
Description | Command | Value or Range |
---|---|---|
Group of destination prefixes. | destination-data-prefix-list list-name | Name of a data-prefix-list list. |
Individual destination prefix. | destination-ip prefix/length | IP prefix and prefix length |
Destination port number. | destination-port number | 0 through 65535 |
DSCP value. | dscp number | 0 through 63 |
protocol number | 0 through 255 | |
Group of source prefixes. | source-data-prefix-list list-name | Name of a data-prefix-list list |
Individual source prefix. | source-ip prefix/length | IP prefix and prefix length |
Source port number. | source-port address | 0 through 255 |
Action Parameters
When data traffic matches the conditions in the match portion of a centralized data policy, the packet can be accepted or rejected, and you can configure a counter for the accepted or rejected packets. You configure the action parameters under the policy data-policy vpn-list sequence action command.
Description |
Command |
Value or Range |
---|---|---|
Count the accepted or dropped packets |
count counter-name |
Name of a counter. To display counter information, use the show policy access-lists counters command on the vEdge router. |
Enable cflowd. | cflowd | — |
Log the packet headers into the messages and vsyslog system logging (syslog) files. In addition to logging the packet headers, a syslog message is generated the first time a packet header is logged and then every 5 minutes thereafter, as long as the flow is active. |
log | To display logging information, use the show app log flow-all and show app log flows command on the vEdge router. |
For a packet that is accepted, configure the parameter cflowd to enable packet collection.
Default Action
If a data packet being evaluated does not match any of the match conditions in a control policy, a default action is applied to this route. By default, the route is rejected. To modify this behavior, include the policy data-policy vpn-list default-action accept command.
Applying Cflowd Policy
For a centralized data policy to take effect, you must apply it to a list of sites in the overlay network:
vSmart(config)# apply-policy site-list list-name data-policy policy-name
To activate the cflowd template, associate it with the data policy:
vSmart(config)# apply-policy cflowd-template template-name
For all data-policy policies that you apply with apply-policy commands, the site IDs across all the site lists must be unique. That is, the site lists must not contain overlapping site IDs. An example of overlapping site IDs are those in the two site lists site-list 1 site-id 1-100 and site-list 2 site-id 70-130. Here, sites 70 through 100 are in both lists. If you were to apply these two site lists to two different data-policy policies, the attempt to commit the configuration on the vSmart controller would fail.
The same type of restriction also applies to the following types of policies:
- Application-aware routing policy (app-route-policy)
- Centralized control policy (control-policy)
- Centralized data policy (data-policy)
You can, however, have overlapping site IDs for site lists that you apply for different types of policy. For example, the sites lists for control-policy and data-policy policies can have overlapping site IDs. So for the two example site lists above, site-list 1 site-id 1-100 and site-list 2 site-id 70-130, you could apply one to a control policy and the other to a data policy.
As soon as you successfully activate the configuration by issuing a commit command, the vSmart controller pushes the data policy to the vEdge routers located in the specified sites. To view the policy as configured on the vSmart controller, use the show running-config command on the vSmart controller. To view the policy that has been pushed to the vEdge router, use the show policy from-vsmart command on the vEdge router.
To display the centralized data policy as configured on the vSmart controller, use the show running-config
vSmart# show running-config policy
vSmart# show running-config apply-policy
To display the centralized data policy that has been pushed to the vEdge router, issue the show omp data-policy command on the vEdge router:
vEdge# show policy from-vsmart
Enable Cflowd Visibility on vEdge Routers
You can enable cflowd visibility directly on vEdge routers, without configuring data policy, so that you can perform traffic flow monitoring on traffic coming to the router from all VPNs in the LAN. To do this, configure cflowd visiblity on the router:
vEdge(config)# policy flow-visibility
To monitor the applications, use the show app cflowd flows and show app cflowd statistics commands on the vEdge router.
Additional Information
Cflowd Traffic Flow Monitoring Configuration Example
Traffic Flow Monitoring with Cflowd