How do I fix a "No route to host" error?

Linode Staff

I am trying to connect with SSH but I am getting an error "ssh: connect to host (IP Address) port 22: No route to host"

2 Replies

There are a few reasons you could be seeing this error when trying to login with SSH.

The first thing we would want to check is whether your Linode is up and accepting Pings.

ping $IP_ADDRESS

If it is up and accepting pings then you can run nmap to see what ports are open.

nmap -p22 $IP_ADDRESS

If your server is up and running, but you can't connect over SSH, it is possible that your firewall rules have inadvertently locked you out of your Linode. In this case you will need to use the LISH console to login to your Linode.

If you can log into your server, the following commands will show you what processes are listening for connections and what firewall rules are in place:

netstat -tulpn

iptables -S

Another thing that could cause this issue is a problem within the SSHD service. You'll want to restart this service to see if that remedies your issue.

systemctl restart sshd.service

You also want to make sure you are allowing root and password login. This guide also serves as a good tool for securing your server.

I hope this helps! Let us know if you have any other questions.

-Blake

First, make sure there is Link (LAN Cable) that must be connected.

You can check by using the below command.

$ ethtool em2 (Interface Name)

If a link is not connected you will get output like below.

Link detected: no

If yes then,

$ ethtool enp3s0
Settings for enp3s0:
.
.
.
.
Link detected: yes

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct