Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
2  
This may be a stupid question, but: are you running "iperf -s" on 192.168.3.2? –  Handyman5 Jun 16 '11 at 8:52
1  
Another reason to get this error is running the IPerf server in UDP mode and client in TCP mode and vice versa. –  user1407196 Jan 24 '13 at 14:46

2 Answers 2

I'd 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 hosts indicates this with a corresponding ICMP message to the source.

In order to run iperf you must have a server running on the machine in which you iperf to. To do this run iperf -s on the server. After that you can then run iperf -s <server IP or hostname> -i 2

After running this you will get an ouput that looks something like this:

------------------------------------------------------------
Client connecting to <server IP>, TCP port 5000
TCP window size:   256 KByte (default)
------------------------------------------------------------
[  3] local 123.123.123.123 port 4000 connected with 123.123.123.123 port 5000
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-10.0 sec  1.1 GBytes  1.09 Gbits/sec
share|improve this answer

Try turning off any firewall on the machines. On many linux distros, you can do

service firewall off

to disable the firewall.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.