Find the answer to your Linux question:
Results 1 to 4 of 4
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Exclamation No route to host

    Hello all,

    I have a question:

    I have two virtual machine, and I'm trying to test the connection between them and also their speed. Vm1 is listening on port 12345 by following command:
    [root vm1 ~]# nc -l 12345 > /dev/null

    and vm2 is trying to connect with the following command and result is shown:
    [root vm2 ~]# dd if=/dev/zero bs=16000 count=50000 | nc -v 12345
    nc: connect to port 12345 (tcp) failed: No route to host

    Any help is appreciated.

  2. #2
    Trusted Penguin Irithori's Avatar
    Join Date
    May 2009
    Hi and welcome

    1) What type of network did you choose for the virtualized NICs? bridged, internal, host only, NAT?
    2) Inside the VMs, did you use IPs of the same network?
    3) Just to be sure: is an IP of vm1?

    Also there are a few tools, that benchmark network (iperf, netperf, nttcp). No need to build it yourself via netcat.
    You must always face the curtain with a bow.

  3. #3
    OK, after searching a lot, finally I solved the problem. . I will explain it here, for others who have the same problem.
    The problem was firewall, with #chkconfig iptables off still firwall was working.
    So fo turning off the firewall, I execute:

    # service ip6tables save
    # service ip6tables stop
    # chkconfig ip6tables off
    And then in vm1:
    [root vm1 ~]# nc -l 12345 > /dev/null

    and in vm2:
    [root vm2 ~]# dd if=/dev/zero bs=16000 count=50000 | nc -v 12345
                           Connection to 12345 port [tcp/italk] succeeded!
                           50000+0 records in
                           50000+0 records out
                           800000000 bytes (800 MB) copied, 8.27853 s, 96.6 MB/s

  4. $spacer_open
  5. #4
    Just for what it helps, newer releases like Fedora 20 have now firewalld in place (or on top) of iptables, so the new way to deal with it would be:
    systemctl stop firewalld.service
    Or for a more permanent solution while keeping it up, the firewalld would need to be configured to open the test port.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts