Sorry, you actually can’t configure two Netflow targets in vSphere. ;-)

HOWEVER! There’s a way around this limitation. Currently, the VDS only supports one Netflow target IP address to send NetFlow to. This limitation can cause some issues when you want to employ multiple Netflow collectors, for instance an existing Network Management System (NMS) and do a vRealize Network Insight Assessment.

What is Netflow?

I’m not going to explain Netflow in depth, but just to set the stage here’s a small summary. Netflow is a protocol that allows you to collect information about what traffic flows are going through your network. Usually it’s enabled on your physical switches so that you can collect all network traffic going through your network. Since the conception of virtualization, the best source of Netflow has since moved from the physical switch to the virtual switch and the vSphere Distributed Switch has had support for Netflow quite some time. It’s as easy as configuring a Netflow target IP address and the VDS makes sure all ESXi hosts will report to that IP address about the network flows they are seeing coming from the virtual machines.

For more information; check Wikipedia.

Fig. 1

vRealize Network Insight Assessment

The vRealize Network Insight (vRNI) Assessment is a functionality within vRNI which allows you to chart network data traffic inside your network. VMware and her partners have packaged this functionality into a (usually free) service to get a sense of what’s going through your network and see where it can be optimized. The output gives all kinds of awesome and informational data/charts, which you can use for a whole bunch of different use-cases.

Fig. 2
For more information, check out this previous post.

So, what’s the problem?

Alright, so now that the stage is set, let’s move on to the problem. In the vSphere Distributed Switch, you can only configure one netflow target IP address (as you can see in Figure 1). So what if you want to do a vRNI Assessment while you already have a network monitoring system in place which uses Netflow to monitor your network? You’re not going to stop monitoring your network just to do an assessment, right?

We need a way to multiplex the Netflow data to multiple targets. Inherently, ESXi currently cannot do this. There needs to be something in between the ESXi hosts and the targets. You can go about this a few ways, some complicated; like putting a netflow collector in between and configuring that to forward flows to the other targets when it receives the flows. This method can easily reformat flow data so that vRNI does not understand the format anymore. The VDS sends a specific format, called IPFIX. While most collectors understand all formats, they usually send out the format of older versions. vRNI only understands IPFIX at this time.

On to the easy way: create a UDP multiplexer. Netflow flow data is sent in UDP. A multiplexer is a simple service that listens on a port to receive traffic and forwards that traffic untouched to other services.

Samplicator to the rescue

Samplicator is one of those multiplexers and I’m going to show you how to install and configure it to handle netflow data from the VDS. This is the most lightweight and quick installed service I’ve found so far. All you need is a small Linux server (I’m going to assume CentOS/Redhat in the following examples) in your environment which a couple of KBps of network bandwidth to spare. I haven’t found a working samplicator package, so we’re going to compile it from source.


We need to get a few packages in place to support the installation:

Download & unzip Samplicator

Compile & Install Samplicator

To compile and install samplicator, execute the steps below. It should be done in a under 3 minutes.

Note: Possible C99 mode error

If you get a compile error saying something like this “error: ‘for’ loop initial declarations are only allowed in C99 mode” – apply a quick patch to make some adjustments in the code which will make it compile:

Now that you have Samplicator installed, you can move on to the configuration and running it.

Configuring & Running Samplicator

Two steps left; create a small configuration file with the netflow sources and the netflow targets defined. Basically you need to put all your ESXi hosts in here and point them to the target IP addresses you want to forward the flows too. If you have a dedicated IP subnet for the management of your ESXi hosts you do can put the entire subnet as a single line in the configuration. I have my ESXi hosts in the same subnet as the Samplication server and the other netflow targets, so I have specified the individual ESXi hosts.

Create a file called /etc/samplicator.conf with this layout:

Mine looks like this:

The first column are the ESXi hosts (, .12 & .13) and the second and third column are vRealize Network Insight and another netflow collector.

After creating the configuration file, you can start Samplicator with a simple command:

Don’t forget to configure the new Collector IP Address under the Netflow settings on your VDS. Once you’ve done that and started Samplicator, you should see debugging information going by stating that Samplicator is receiving data and forwarding that data. Use CTRL+C to get out of the command.

Create a Service

You can let the samplicate command running in a screen, but it’s easier to create a service for it so you can be sure it’s always running. It’ll also come back if you restart the Linux server it’s running on.

Let’s use the example service definition that’s in the downloaded zip to set this up. We only need to adjust the executed command a little bit to conform to our installation:

This was the last step! You should be able to see the data flowing into your targets.


Until the vSphere Distributed Switch can handle multiple Netflow targets, you can definitely get data flows to multiple targets using an UDP multiplexer. Hope this helps!