I have installed WSL 2 and Ubuntu. I want to run iperf from this Ubuntu to connect to a linux server on my LAN.

I get connection refused error from iperf-

$ iperf -c 192.168.2.45
connect failed: Connection refused

ssh [email protected] works fine. I suspect port 5001 is blocked somehow.
Iperf runs fine from windows to same linux server. How can I enable iperf to run from Ubuntu.

- - - Updated - - -

This was happening because ubuntu had iperf version 2 and server has iperf3.
I installed iperf3 on ubuntu and now it works fine.