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 |
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? |
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. |
All times are GMT -5. The time now is 03:44 PM. |