LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 06-30-2007, 01:27 PM   #1
dralexpe
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
172.16.0.0 * 255.255.255.0 U 0 0 0 eth0
default 172.16.0.1 0.0.0.0 UG 0 0 0 eth0

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

[root@new-screamer ~]# ssh root@172.16.0.2
ssh: connect to host 172.16.0.2 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 172.16.0.2 dev eth0
[root@new-screamer ~]# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
172.16.0.2 * 255.255.255.255 UH 0 0 0 eth0
172.16.0.0 * 255.255.255.0 U 0 0 0 eth0
default 172.16.0.1 0.0.0.0 UG 0 0 0 eth0

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

I pinged it:

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

--- 172.16.0.2 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@172.16.0.2
ssh: connect to host 172.16.0.2 port 22: No route to host


What am I doing wrong?

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

Rep: Reputation: 678Reputation: 678Reputation: 678Reputation: 678Reputation: 678Reputation: 678
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 172.16.0.2 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
dralexpe
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.
 
  


Reply


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

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 06:53 PM.

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