4

I have installed same version of iperf (2.0.5) on 2 different ubuntu systems. But when i execute command iperf -s -p 45678 on one system and iperf -c 172.18.41.17 -p 458 -t 10 on another system. It gives me error "connect failed: No route to host".

Any help would be appreciated.

EDIT: One system is working as server but the same system is not working as client.

Nikita
  • 425
  • 1
  • 7
  • 19
  • what is the idle timeout of iperf client before it decides no route to host if the client didnt get any reply from server.? – Vinay Oct 16 '20 at 13:19

6 Answers6

8

sometimes, the firewall service will prevent the tcp connection initiation, try by disabling the firewall service in client and server "service firewalld stop

user2002885
  • 89
  • 1
  • 3
  • "no route to host" is not a TCP level issue – Ken - Enough about Monica Feb 05 '19 at 19:28
  • 3
    This was the correct solution for me. The error message is particularly confusing because it is not a routing issue. `route -n` showed expected entries, I could ping, etc. but `iptables` was filtering traffic on the server. When I cleared its rules and set all policies to ACCEPT this error message went away. (I doubt I'd have found this, but when I tried reversing the roles of the 2 machines it works, and the main difference was that one was running CentOS with `firewalld` enabled while the other was running Ubuntu without a firewall enabled.) – jacobq May 15 '19 at 19:48
2

by default iperf uses its ipv6 run on the server

iperf -s -p -4 45678

on the client run

iperf -c 172.18.41.17 -p 458 -t 10 -4 
0

Try using a different port. I'm having this issue but when I try other ports, it is working. I'd like to know the reason however.

Also server and client port should be the same

user3480788
  • 111
  • 1
  • 6
  • Changing the port number did not resolve this problem for me nor did adding `-4` to force IPv4. – jacobq May 15 '19 at 19:31
  • I had this 'no route to host' problem in my automation. The problem turned out that, I was starting the client too soon. I needed to wait a few more seconds after starting the server before starting the client. Also you should be able to ping the address too. if you can't ping it then then you are missing some route... – user3480788 May 19 '19 at 19:45
0

If the link delay in the network is greater than tcp connection timeout value. Then, this might happen. Because the SYN packet wont get ACK within the timeout value. Therefore iperf client will out Connection failed: No route to host

Vinay
  • 111
  • 1
  • 7
-1

netstat -rn on the client to might be helpful. The client is complaining that it doesn't have have a route and it's routing tables can help diagnose why.

rjmcmahon
  • 324
  • 1
  • 3
-1
iperf -s -p 45678

Here you started server on port no. 45678. and

iperf -c 172.18.41.17 -p 458 -t 10

For client also you should use the same port no. you are using here port no. 458. make it same as server and test. the error might because of the mismatched port no.

suraj
  • 403
  • 4
  • 15