Thursday, May 15, 2025

How to run IPERF on ESXi host?

iperf is great tool to test network throughput.There is iperf3 in ESXi host, but there are restrictions and you cannot run it.

There is the trick.

First of all, you have to disable ESXi advanced option execInstalledOnly=0. This enables you to run executable binaries which were not preinstalled by VMware.

Second step is to make a copy of iperf binary, because installed version os estricted and cannot be run.

The third step is to disable ESXi firewall to allow cross ESXi communication between iperf client and iperf server.

After finishing performance testing, you should clean ESXi environment

  • delete your copy of iperf
  • re-enable ESXi firewall to allow only required tcp/udp ports for ESXi services
  • re-enable ESXi advanced option (execInstalledOnly=1) to keep ESXi hypervisor secure by default

ESXi Commands 

# Allow execute binaries which are not part of base installation
localcli system settings advanced set -o /User/execInstalledOnly -i 0
 
# Make a copy of iperf
cp /usr/lib/vmware/vsan/bin/iperf3 /usr/lib/vmware/vsan/bin/iperf3.copy
 
# Disable firewall
esxcli network firewall set --enabled false

# Run iperf server
./iperf3.copy -s -B 192.168.123.22

# Run iperf client (typically in another ESXi host than iperf server is running)
./iperf3.copy -c -B 192.168.123.22

After iperf benchmarking you should enable firewall and disallow execution of binaries which are not part of base installation
 
# Cleaning
rm /usr/lib/vmware/vsan/bin/iperf3.copy
esxcli network firewall set --enabled true
localcli system settings advanced set -o /User/execInstalledOnly -i 1
 

No comments: