Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 06-30-2007, 01:27 PM   #1
LQ Newbie
Registered: Jun 2007
Posts: 27

Rep: Reputation: 15
Unhappy Home network problem - Centos - no route to host

Hello everybody,

I am new to this forum and I would appreciate some help with setting up my home network.

I am using Centos 5 x86_64 on one computer and Centos 4.4 on another one; both are connected to a DSL modem via a hub. This is the output from route:

root@new-screamer ~]# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface * U 0 0 0 eth0
default UG 0 0 0 eth0

The DSL modem is at IP, the computer I am working from is at and the one I am trying to connect to is at When I try to ssh I get:

[root@new-screamer ~]# ssh root@
ssh: connect to host port 22: No route to host
[root@new-screamer ~]#

Alright then I add a route to the host as:

[root@new-screamer ~]# route add -host dev eth0
[root@new-screamer ~]# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface * UH 0 0 0 eth0 * U 0 0 0 eth0
default UG 0 0 0 eth0

although I am thinking that since the nework is visible that might not be necessary. In the route output above I see that the host has a different netmask than

I pinged it:

[root@new-screamer ~]# ping
PING ( 56(84) bytes of data.
64 bytes from icmp_seq=1 ttl=64 time=1.90 ms
64 bytes from icmp_seq=2 ttl=64 time=0.300 ms
64 bytes from icmp_seq=3 ttl=64 time=0.310 ms
64 bytes from icmp_seq=4 ttl=64 time=0.198 ms
64 bytes from icmp_seq=5 ttl=64 time=0.207 ms

--- ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4002ms
rtt min/avg/max/mdev = 0.198/0.584/1.907/0.663 ms

so the network is up.

I tried again:

[root@new-screamer ~]# ssh root@
ssh: connect to host port 22: No route to host

What am I doing wrong?

Thank you
Old 06-30-2007, 02:47 PM   #2
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 680Reputation: 680Reputation: 680Reputation: 680Reputation: 680Reputation: 680
At least you know that the cabling is OK between the hosts.

Remove the host route and try pinging it without the host route.

If pinging works, see if port 22 is open. Ex: telnet 22
My guess is that the packets were dropped by the firewall.

Also, please enclose the output of commands like /sbin/route in CODE blocks so that the original spacing is preserved. It is easier reading a table if the columns line up.

One thing to try is to use ssh as a regular user. Ssh should not be configured to allow ssh root logins.
Other things to check:
/etc/hosts.deny, /etc/hosts.allow, /etc/ssh/sshd_config, /etc/ssh/ssh_config, the firewall settings.

Oh, I almost forgot, I noticed that you don't have the lo device in the route. That might be the problem. Sometimes ssh will create a proxy and use the lo device. For example, if you were to use "ssh -X user@host", the ssh client will create a proxy X server at one end and a proxy client at the other. I wouldn't be surprised if a local socket is used somehow in the key exchange process. I'm guessing at this, but it is something that doesn't look right, and probably should be looked at in any case. If you use /sbin/ifconfig, does the lo device show up?

Last edited by jschiwal; 06-30-2007 at 02:53 PM.
Old 06-30-2007, 05:43 PM   #3
LQ Newbie
Registered: Jun 2007
Posts: 27

Original Poster
Rep: Reputation: 15
It was the firewall that was giving me the problems. The firewall on the remote machine was not allowing any services, like ssh, telnet, ftp e.a. I enabled SSH on the remote machine, using the GUI not the command line, and it worked.

Now, since I am new to this, how do you generate the code blocks?

Thank you very much.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Why is this route always present in CentOS? cygnus-x1 Linux - Networking 5 05-25-2011 11:04 PM
"No route to Host" on the same network? gplus Linux - Networking 4 06-21-2006 01:00 PM
Network Problem - No route to host Astral Projection Linux - Software 2 06-17-2006 04:55 PM
Network error: No route to host Putty Adil_uk Linux - Networking 3 10-19-2005 10:32 AM
Problem with exporting/firewall , RPC: No route to host pinguscot Linux - Networking 1 11-05-2004 05:29 AM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 12:00 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration