First of all, make sure you have iperf installed on both hosts.
If you haven’t, then use the following command to install it. I will be using Ubuntu flavour linux for demonstration.
Pick one host as Server, one host as Client.
On the server issue the following command
One the Client, issue the following command
See the following example for more info