Iperf3 error unable to connect to server connection refused

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?

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?

asked Jun 16, 2011 at 7:28

Hao's user avatar

4

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:

iperf3: error - unable to connect to server: Connection refused

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

iperf -v

answered Apr 4, 2016 at 10:46

J.P. Tosoni's user avatar

J.P. TosoniJ.P. Tosoni

5154 silver badges6 bronze badges

2

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 iperf -s on the server. After that you can then run iperf -c <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

Community's user avatar

answered Jun 16, 2011 at 8:05

Dabu's user avatar

DabuDabu

3591 gold badge5 silver badges23 bronze badges

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

service firewall off

to disable the firewall.

answered Jun 16, 2011 at 7:30

Shannon Nelson's user avatar

anyone have any idea where to start in fixing this error: iperf3: error — unable to connect to server: connection refused

SSH into unifi, ran iperf -s BZ.v3.7.21# iperf -s

Server listening on TCP port 5001 TCP window size: 85.3 KByte (default)

from my own computer, D:iperf-3.1.3-win64iperf-3.1.3-win64>iperf3.exe -c 192.168.200.6 iperf3: error — unable to connect to server: Connection refused

if i use my computer as -s, my phone can make a connection to it

i am trying to diagnose and understand the limits of wifi speed

phone to computer:

Server listening on 5201

Accepted connection from 192.168.200.72, port 40563 [ 5] local 192.168.200.65 port 5201 connected to 192.168.200.72 port 40564 [ ID] Interval Transfer Bandwidth [ 5] 0.00-1.00 sec 8.64 MBytes 72.5 Mbits/sec
[ 5] 1.00-2.00 sec 9.98 MBytes 83.7 Mbits/sec
[ 5] 2.00-3.00 sec 8.92 MBytes 74.8 Mbits/sec
[ 5] 3.00-4.00 sec 9.66 MBytes 81.0 Mbits/sec
[ 5] 4.00-5.00 sec 4.68 MBytes 39.2 Mbits/sec
[ 5] 5.00-6.00 sec 4.08 MBytes 34.2 Mbits/sec
[ 5] 6.00-7.00 sec 5.59 MBytes 46.9 Mbits/sec
[ 5] 7.00-8.00 sec 10.3 MBytes 86.3 Mbits/sec
[ 5] 8.00-9.00 sec 10.1 MBytes 84.4 Mbits/sec
[ 5] 9.00-10.00 sec 10.3 MBytes 86.6 Mbits/sec
[ 5] 10.00-10.04 sec 222 KBytes 46.6 Mbits/sec


[ ID] Interval Transfer Bandwidth [ 5] 0.00-10.04 sec 0.00 Bytes 0.00 bits/sec sender

[ 5] 0.00-10.04 sec 82.4 MBytes 68.9 Mbits/sec receiver

Server listening on 5201

i dont even know if this is good or not. the above speed to me, doesnt look like what AC speeds should look like. my phone says link at 833mbps(Xperia Z5) and i think its a 2×2.

phone is using the command -c 192.168.200.65 -i 1

unifi is set to VHT80(i get the same speed in VHT40), the speed is the same on high/medium TX power, and i recall gets lower on low power.

if anyone has suggestions, would be thank ful

i have read over a few of the threads in the slow speed posts on the unifi forum, but i havent come across a solution that says the above speed is correct.

  • 0

Igor

    • Share

We are not clairvoyant or mind readers :P Please describe your setup as best as possible so we know what your operating environment is like.

1. Logs, when you can boot the board: armbianmonitor -u (paste URL to your forum post)

2. Did you attach antenna? Without it works very bad.

3. What is slow? Connecting? Transfer? Can you do iperf3 test to your server / other wired machine?

Link to comment
Share on other sites

  • 0

aminos

  • Author
    • Share

sorry for my late response,

I changed the developpement board from nanopi neo air to orange pi zero plus2 but I still have the same problem (it is the ssh transfer which is so slow)

there is the url given armbianmonitor -u 

http://sprunge.us/YJXS

thanks for your help.

Link to comment
Share on other sites

  • 0

Igor

    • Share

System wise and if you start from a clean image, there should be nothing wrong. First, check this post, to see what transfer rates are possible to get out from this chip in some real world scenario. When you are using ssh, a connection is encrypted and CPU power is used, which can only slower this transfer speed. AFAIK hardware assisted encryption is n/a in this kernel/chip. More info: http://linux-sunxi.org/Sunxi_devices_as_NAS#cite_note-3

Link to comment
Share on other sites

  • 0

aminos

  • Author
    • Share
Link to comment
Share on other sites

  • 0

Igor

    • Share

58 minutes ago, aminos said:

That’s all fine. I am only wondering if you understand hardware limits of those boards. Wireless — encryption speed? SSH transfer will be much slower than with some (wired) Intel based desktop. And another example — faster version of this Opi Zero2 with H5 might show better results by using the same wireless chip.

Can you provide iperf3 measurements between your Opi Zero2 and some wired server / router? To see if your wireless speed operates at a normal rate.

Link to comment
Share on other sites

  • 0

aminos

  • Author
    • Share

I can’t receive anything after a typing the following   command :

root@orangepizeroplus2:~# iperf3 -c 192.168.1.1
iperf3: error — unable to connect to server: Connection refused

Link to comment
Share on other sites

  • 0

Igor

    • Share

1 hour ago, aminos said:

iperf3: error — unable to connect to server: Connection refused

On that or some other wired server you need to run iperf3 server with the command:

iperf -s

Link to comment
Share on other sites

  • 0

aminos

  • Author
    • Share

I do this 

Croot@orangepizeroplus2:~# iperf -s
————————————————————
Server listening on TCP port 5001
TCP window size: 85.3 KByte (default)
————————————————————

and i have also this error

root@nanopiair:~# iperf3 -c 192.168.42.1
iperf3: error — unable to connect to server: Connection refused

Link to comment
Share on other sites

  • 0

Igor

    • Share

You need to use iperf3 in both cases. It seems that I also made a typo.

Link to comment
Share on other sites

  • 0

aminos

  • Author
    • Share

Hi, I have just done the test with the command iperf3 and I get this :

———————————————————————————————

root@nanopiair:~# iperf3 -c 192.168.42.1
Connecting to host 192.168.42.1, port 5201
[  4] local 192.168.42.113 port 44649 connected to 192.168.42.1 port 5201
[ ID] Interval           Transfer     Bandwidth       Retr  Cwnd
[  4]   0.00-1.00   sec  1.94 MBytes  16.3 Mbits/sec    0    112 KBytes
[  4]   1.00-2.00   sec  1.88 MBytes  15.8 Mbits/sec    0    194 KBytes
[  4]   2.00-3.00   sec  1.94 MBytes  16.3 Mbits/sec    0    276 KBytes
[  4]   3.00-4.00   sec  1.84 MBytes  15.4 Mbits/sec    0    359 KBytes
[  4]   4.00-5.00   sec  1.80 MBytes  15.1 Mbits/sec    0    448 KBytes
[  4]   5.00-6.00   sec  1.94 MBytes  16.3 Mbits/sec    0    532 KBytes
[  4]   6.00-7.00   sec  1.88 MBytes  15.8 Mbits/sec    0    626 KBytes
[  4]   7.00-8.00   sec  2.00 MBytes  16.8 Mbits/sec    0    706 KBytes
[  4]   8.00-9.00   sec  2.01 MBytes  16.9 Mbits/sec    0    796 KBytes
[  4]   9.00-10.00  sec  1.88 MBytes  15.8 Mbits/sec    0    880 KBytes
— — — — — — — — — — — — — — — — — — — — — — — — —
[ ID] Interval           Transfer     Bandwidth       Retr
[  4]   0.00-10.00  sec  19.1 MBytes  16.0 Mbits/sec    0             sender
[  4]   0.00-10.00  sec  18.8 MBytes  15.8 Mbits/sec                  receiver

iperf Done.
——————————————————————————————

thanks for your help

Link to comment
Share on other sites

  • 0

Igor

    • Share

15 Mbits/sec is a bit low … raw speed highly depends on circumstances: distance, antennas, router, interference with other stations, … I can achieve around 45Mbit/sec with exactly the same chip, but with a normal antenna on both sides, 15-20m distance, one concrete wall and zero radio smog (rural area).

It’s not a problem of the chip, board or software, but your setup. Small chances are also that there are some bad contacts on the connector, bad antenna cable, …

Link to comment
Share on other sites

  • 0

aminos

  • Author
    • Share

I used the antennas of my wifi router and I got that

—————————————————————————————————————-

root@nanopiair:~# iperf3 -c 192.168.42.1
Connecting to host 192.168.42.1, port 5201
[  4] local 192.168.42.113 port 56232 connected to 192.168.42.1 port 5201
[ ID] Interval           Transfer     Bandwidth       Retr  Cwnd
[  4]   0.00-1.00   sec  4.31 MBytes  36.2 Mbits/sec    0    215 KBytes
[  4]   1.00-2.00   sec  4.45 MBytes  37.3 Mbits/sec    0    420 KBytes
[  4]   2.00-3.00   sec  4.01 MBytes  33.6 Mbits/sec    0    591 KBytes
[  4]   3.00-4.00   sec  4.22 MBytes  35.4 Mbits/sec    0    790 KBytes
[  4]   4.00-5.00   sec  4.46 MBytes  37.4 Mbits/sec    0    991 KBytes
[  4]   5.00-6.00   sec  4.78 MBytes  40.1 Mbits/sec    0   1.16 MBytes
[  4]   6.00-7.00   sec  3.55 MBytes  29.8 Mbits/sec    0   1.36 MBytes
[  4]   7.00-8.00   sec  4.79 MBytes  40.2 Mbits/sec   16   1.35 MBytes
[  4]   8.00-9.00   sec  4.01 MBytes  33.6 Mbits/sec   35   1.13 MBytes
[  4]   9.00-10.00  sec  4.45 MBytes  37.3 Mbits/sec    0   1.24 MBytes
— — — — — — — — — — — — — — — — — — — — — — — — —
[ ID] Interval           Transfer     Bandwidth       Retr
[  4]   0.00-10.00  sec  43.0 MBytes  36.1 Mbits/sec   51             sender
[  4]   0.00-10.00  sec  42.2 MBytes  35.4 Mbits/sec                  receiver

iperf Done.
 

—————————————————————————————————-

What you recommend me the best wifi antenna 

thanks .

Link to comment
Share on other sites

  • 0

aminos

  • Author
    • Share

Sorry I thought it works but just when I get  distance of 1 meter between the two board the speed of wifi Becomes as before

I do not know what to do.

Link to comment
Share on other sites

  • 0

aminos

  • Author
    • Share

I got that With a distance of 6 meters and large antenna

————————————————————————————————

root@nanopiair:~# iperf3 -c 192.168.42.1
Connecting to host 192.168.42.1, port 5201
[  4] local 192.168.42.113 port 32819 connected to 192.168.42.1 port 5201
[ ID] Interval           Transfer     Bandwidth       Retr  Cwnd
[  4]   0.00-1.00   sec   102 KBytes   834 Kbits/sec    1   22.6 KBytes
[  4]   1.00-2.00   sec  65.0 KBytes   533 Kbits/sec    0   28.3 KBytes
[  4]   2.00-3.00   sec   102 KBytes   834 Kbits/sec    3   25.5 KBytes
[  4]   3.00-4.00   sec   180 KBytes  1.47 Mbits/sec    0   28.3 KBytes
[  4]   4.00-5.00   sec  0.00 Bytes  0.00 bits/sec    1   28.3 KBytes
[  4]   5.00-6.00   sec  0.00 Bytes  0.00 bits/sec    1   28.3 KBytes
[  4]   6.00-7.00   sec  0.00 Bytes  0.00 bits/sec    0   28.3 KBytes
[  4]   7.00-8.00   sec  0.00 Bytes  0.00 bits/sec    1   28.3 KBytes
[  4]   8.00-9.00   sec  0.00 Bytes  0.00 bits/sec    0   28.3 KBytes
[  4]   9.00-10.00  sec  0.00 Bytes  0.00 bits/sec    0   28.3 KBytes
— — — — — — — — — — — — — — — — — — — — — — — — —
[ ID] Interval           Transfer     Bandwidth       Retr
[  4]   0.00-10.00  sec   448 KBytes   367 Kbits/sec    7             sender
[  4]   0.00-10.00  sec   393 KBytes   322 Kbits/sec                  receiver

iperf Done.

———————————————————————————————————

Link to comment
Share on other sites

  • 0

Igor

    • Share

If I assume your router is O.K. and all other devices perform normally than this indicates some failure, like a bad antenna, cold soldering … not a problem which we could fix or assist. Do close inspection, change power supply — make sure it gives you enough current, check voltage drops, … this kind of troubles can manifest in a strange manner.

Link to comment
Share on other sites

here’s what I’m trying to do: build GUI program using PyQt4 to make testing connection between 2 computers easier (to minimize human errors). So, part of this program is to use QProcess to begins the iperf3, acting as either client or server. QProcess was able to begin iperf3 successfully and output the results, however, for some reason, iperf3 client in PyQt cannot connect to server despite the fact that I was able to connect to the server from the terminal.

Here’s brief description of situation and combinations of which acts as server and client

  • iperf3 in terminal as client -> iperf3 in PyQt as server — success
  • iperf3 in terminal as client -> iperf3 in terminal as server — success
  • iperf3 in PyQt as client -> iperf3 in PyQt as server — unable to connect
  • iperf3 in PyQt as client -> iperf3 in terminal as server — unable to connect

I checked on firewall and I disabled it to see if it resolves the issue, it didn’t. Just in case if you’re wondering about what commands I used for iperf3 in terminal, here is it:

  • Client — iperf3 -c 127.0.0.1 -u -t 10
  • Server — iperf3 -s

As for the QProcess:

  • self.process.start(‘iperf3’,[‘-c 127.0.0.1 -u -t 10’])
  • self.process.start(‘iperf3’,[‘-s’])

If you need more information, please let me know. I appreciate any help / insight with this issue. Btw, I should mention I’m testing this program on laptop locally for now, thus the loopback address.

asked Sep 10, 2015 at 16:51

IceDragon6273's user avatar

Okay, I figured it out. The mistake was in the code for QProcess, which is

self.process.start(‘iperf3’,[‘-c 127.0.0.1 -u -t 10’])

It should have been

self.process.start(‘iperf3’,[‘-c’,’127.0.0.1′,’-u’,’-t’,’10’])

answered Sep 10, 2015 at 17:42

IceDragon6273's user avatar

Понравилась статья? Поделить с друзьями:
  • Iperf3 error control socket has closed unexpectedly
  • Ipdl protocol error handler returned error code
  • Ipconfig renew произошла ошибка при обновлении интерфейса
  • Ipconfig renew error
  • Ipc internal error