"Connection refused" vs "No route to host"

Show the output of netstat -lnp, so we can see which processes are actually listening to which ports on the server, and what IP addresses they are bound to.

Regarding the second computer, its network connectivity looks broken. netstat -rn will give some insight on the problem there.

In order to give better advice, more details regarding general network configuration and IP configuration on both computers are needed.

Edit:

You have to change your Apache configuration so that it is a HTTP server, not SSL server. Configuration files are located under /etc/apache2 most of the time.

The IP configuration and network configuration information is still needed to analyze the other problem. The traceroute information didn't reveal anything.


"Connection refused" means that the target machine actively rejected the connection. With port 80 as the context, one of the following things is likely the reason:

  • Nothing is listening on 127.0.0.1:80 and 132.70.6.157:80
  • Nothing is listening on *:80
  • The firewall is blocking the connection with REJECT

So check your Apache and iptables config.

"No route to host" refers to a network problem. It is not a reply from the target machine.


I found this post describing the issue I was facing when trying to setup a simple http page using nodejs on a Public Cloud compute node.

This command did the trick for me:

iptables -F

This command flushes i.e. clears the firewall rules that are setup inside the Linux system.

Word of caution: Since I use the distributed firewall that is part of the Public Cloud VCN, I didn't really use my OS's firewall. In case you do not have an external firewall, make sure to add a firewall rule in iptables.


Citing Ron Maupin's answer from https://networkengineering.stackexchange.com/questions/33397/debugging-no-route-to-host-over-ethernet:

The ICMP message, "no route to host," means that ARP cannot find the layer-2 address for the destination host. Usually, this means that that the host with that IP address is not online or responding.