Vyatta Network OS Documentation

Learn how to install, configure and operate the Vyatta NOS, which helps drive our virtual networking & physical platforms portfolio.

Configuring sFlow

Configuring sFlow shows how to configure sFlow for the sample Vyatta router configuration. sFlow overview shows this configuration.

Table 1. Configuring sFlow
Step Command

Specify the address of the agent. By default, this collector listens for sFlow data on the 6343 UDP port.

Note: A Vyatta router supports up to four collectors.
vyatta@sflow1# set service sflow agent-address 1.1.1.1

Set the polling interval to three seconds. Every three seconds, the sFlow agent that is running on the Vyatta router collects port counter data.

vyatta@sflow1# set service sflow polling-interval 3

Configure the sFlow agent to send the UDP datagrams that contain the collected sFlow information to the default port (6343) of the sFlow collector server at 198.51.100.2.

vyatta@sflow1# set service sflow server-address 198.51.100.2 server-port 6343

Specify 512 as the number of packets from which a sample is taken by the sFlow agent. In other words, for every 512 packets that flow through the interface, the sFlow agent selects one packet for analysis.

vyatta@sflow1# set service sflow sampling-rate 512

Commit the configuration.

vyatta@R1# commit

Save the configuration.

vyatta@sflow1# save

Display the sFlow configuration.

The output shows that sFlow was configured, but no statistics were collected. This is because sFlow has not yet been enabled on an interface.

vyatta@sflow1# run show sflow
{
    "sFlow information": {
        "sFlow version": 5,
        "sFlow services": "enabled",
        "sFlow agent IP address": "1.1.1.1",
        "Collector destinations configured": 1,
        "Collectors": [{
                "IP address": "198.51.100.2",
                "UDP port number": 6343
            }
        ],
        "Polling interval": 3,
        "Configured default sampling rate": 512,
        "Actual default sampling rate": 512,
        "sFlow max-header size": 128,
        "UDP packets sent": 0,
        "Flow samples collected": 0,
        "sFlow interfaces": [],
        "Total sFlow interfaces": 0
    }
}

Enable sFlow on the dp0p192p1 interface (sFlow configuration example indicates it as DP1).

vyatta@sflow1# set interfaces dataplane dp0p192p1 sflow

Commit the configuration.

vyatta@R1# commit

Save the configuration.

The sFlow agent can now start collecting packet samples and port-counter statistics.

vyatta@sflow1# save

Display the sFlow configuration.

The output shows that sFlow is enabled for the dp0p192p1 interface and shows that one sample packet was collected.

vyatta@sflow1# run show sflow
{
    "sFlow information": {
        "sFlow version": 5,
        "sFlow services": "enabled",
        "sFlow agent IP address": "1.1.1.1",
        "Collector destinations configured": 1,
        "Collectors": [{
                "IP address": "198.51.100.2",
                "UDP port number": 6343
            }
        ],
        "Polling interval": 3,
        "Configured default sampling rate": 512,
        "Actual default sampling rate": 512,
        "sFlow max-header size": 128,
        "UDP packets sent": 0,
        "Flow samples collected": 0,
        "sFlow interfaces": [{
                "name": "dp0p192p1"
            }
        ],
        "Total sFlow interfaces": 1
    }
}