iperf -c 192.168.3.2 -i 2
connect failed: Connection refused
3.2 is another machine. I think the port might be blocked.
How can I make this work?
I doubt that this is a firewall issue. Usually, firewalls employ the DROP rule for packets that are not allowed. A "connection refused" means that there is no application listening on the port it tries to connect to. The destination host indicates this with a corresponding ICMP message to the source.
In order to run iperf you must have a server running on the machine which you iperf to. To do this run
After running this you will get an ouput that looks something like this:
Try turning off any firewall on the machines. On many linux distros, you can do
to disable the firewall.
You also get a "connection refused" error when you use an iperf v3 client to send to an iperf v2 server.
The message is slightly different though:
As the iperf3 doc states, they are not compatible (at least up to version 3.1.2). You can check the version on both server and client with