Use iPerf to test NIC speed between two ESXi hosts

Sometimes you want/need use iPerf to test the nic speed between two ESXi hosts. I did because I was seeing a NIC with low throughput in my lab.

How can we test raw speeds between the two hosts? iPerf comes to the rescue. I was looking on how to do this on an ESXi host. I doesn’t come as a surprise that I found the solution here at William Lams’ virtuallyghetto.com. Apparently iperf has been added to ESXi since 6.5 U2. You used to have to copy iperf to iperf.copy. In ESXi 7.0 that has been done for you, although you will need to look for /usr/lib/vmware/vsan/bin/iperf3.copy

ESXi host 1 (iperf server)

Disable the firewall:

esxcli network firewall set --enabled false

Change to the directory containing the iperf binary

cd /usr/lib/vmware/vsan/bin/

Execute iPerf as server

./iperf3.copy -s -B 10.11.6.171

Overview of the used parameters:

<td style="padding-top:0;border-width:0;border-top-color:#000;border-right-color:#000;border-bottom-color:#000;border-left-color:#000;border-style:none;vertical-align:bottom">
  will start iperf as server
</td>
<td style="vertical-align:middle;border-style:none">
  defines the IP the iperf server will listen to
</td>
-s
-B

Disable the firewall

esxcli network firewall set --enabled false

ESXi host 2 (iperf client)

Change to the directory containing the iperf binary

cd /usr/lib/vmware/vsan/bin/

Execute iPerf as client

./iperf3.copy -i 1 -t 10 -c 10.11.6.171 -fm

Overview of the used parameters:

<td style="padding-top:0;border-width:0;border-top-color:#000;border-right-color:#000;border-bottom-color:#000;border-left-color:#000;border-style:none;vertical-align:bottom">
  will determine the interval of reporting back
</td>
<td style="padding-top:0;border-width:0;border-top-color:#000;border-right-color:#000;border-bottom-color:#000;border-left-color:#000;border-style:none;vertical-align:bottom">
  time iperf will be running
</td>
<td style="vertical-align:middle;border-style:none">
  client ip, will force the usage of the correct vmkernel interface
</td>
<td style="vertical-align:middle;border-style:none">
  defaults to kbit/s, adding m will use mbit/s
</td>
-i
-t
-c
-fm
  <div class="uagb-ifb-content">
    <div class="uagb-ifb-title-wrap">
      <h4 class="uagb-ifb-title">
        Don&#8217;t forget to re-enable the firewall on both systems.
      </h4>
    </div>
    
    <div class="uagb-ifb-separator-parent">
      <div class="uagb-ifb-separator">
      </div>
    </div>
    
    <div class="uagb-ifb-text-wrap">
      <p class="uagb-ifb-desc">
        <span class="crayon-inline lang:sh decode:true">esxcli network firewall set &#8211;enabled true</span>
      </p>
    </div>
  </div>
</div>