Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

6 Answers 6

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

(Don't have enough reputation to vote up other answers)

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

 
discard

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.