Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to ssh into a server and get the following error ssh: connect to host server.mylan.lan port 22: No route to host

The strange thing is it was working and then suddenly no more, is this common, the server is running Centos 5.2

share|improve this question
If it was working before and not anymore then have you installed anything recently that may affect connectivity - a firewall for instance. – DilbertDave Sep 23 '09 at 9:12
up vote 2 down vote accepted

on the server check:

service sshd status
iptables -L

if port 22 is open and the service is running, you have a network issue

share|improve this answer

I concur with sybreon and lg. This is a network issue not an ssh issue. 'No route to host' indicates that the client machine cannot make an intial network connection to the server.

Either 'server.mylan.lan' no longer resolves to your server's IP address or a critical part of infrastructure is down making your subnet unavailable, or the server is switched off maybe??

share|improve this answer

DNS problem? Can you ping server.mylan.lan? Try to ssh into server by ip address.

share|improve this answer

This is not an SSH problem but a networking one. You may want to check your networking settings particularly your gateway. Try pinging server.mylan.lan to see if you can even ping the machine.

Chances are you won't be able to. Then check your route

# route -n
# traceroute server.mylan.lan

And see what happens. Something probably changed in the networking between you and the server. Maybe a new router was installed or maybe the firewall rules changed in between.

share|improve this answer

No route to host?

at prompt do:

me@myMachine:~$ ping yourMachine

share|improve this answer

If you are on the same subnet of the server you're trying to ssh to, then it's probably a DNS or IPtables related issue.

"No route to host" means you cannot get the server address at all, not just the ssh service.

Try checking iptables rules on the server (if you can plug a monitor and a keyboard into it of course).

Check the output of

# dig server.mylan.lan

Try pinging its hostname and/or its ip address.

If your server is on a different network, check all the above AND the routing tables.

# traceroute server.mylan.lan

could be useful as well.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.