LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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 05-28-2008, 11:21 PM   #1
Z038
Member
 
Registered: Jan 2006
Location: Dallas
Distribution: Slackware
Posts: 910

Rep: Reputation: 174Reputation: 174
SSH no route to host, also PING problem


I have three systems on my home LAN, i1, i2, and i7. sshd is running on i2 and i7. I can ssh from i2 to i7, and from i7 to i2. I can ssh from i1 to i2 but not from i1 to i7. I can ping i2 from i1, but I can't ping i7 from i1. I can ping all systems from i2 and i7.

When I try to ssh to i7 from i1 I get this:

Code:
root@i1:/home/i# ssh i@192.168.1.152
ssh: connect to host 192.168.1.152 port 22: No route to host
When I ping i7 from i1, I get this:

Code:
root@i1:/home/i# ping 192.168.1.152
PING 192.168.1.152 (192.168.1.152) 56(84) bytes of data.
From 192.168.1.15 icmp_seq=1 Destination Host Unreachable
From 192.168.1.15 icmp_seq=2 Destination Host Unreachable
From 192.168.1.15 icmp_seq=3 Destination Host Unreachable

--- 192.168.1.152 ping statistics ---
6 packets transmitted, 0 received, +3 errors, 100% packet loss, time 5017ms
, pipe 3
iptables -L shows identical Slackware default firewall on all three systems:

Code:
root@i1:/home/i# iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
netstat -ran on all of the machines shows same results except that i7 (a laptop) is using eth1 wireless instead of eth0. Desktops i1 and i2 are using eth0 wired connections.

Code:
root@i1:/home/i# netstat -ran inet
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
192.168.1.0     0.0.0.0         255.255.255.0   U         0 0          0 eth0
127.0.0.0       0.0.0.0         255.0.0.0       U         0 0          0 lo
0.0.0.0         192.168.1.1     0.0.0.0         UG        0 0          0 eth0
Services running are a little different, but sshd is listening on port 22 on i2 and i7.

This is the desktop i1:

Code:
root@i1:/home/i# netstat -tlnp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:37              0.0.0.0:*               LISTEN     9420/inetd
tcp        0      0 0.0.0.0:587             0.0.0.0:*               LISTEN     3724/sendmail: acce
tcp        0      0 0.0.0.0:6000            0.0.0.0:*               LISTEN     3821/X
tcp        0      0 0.0.0.0:113             0.0.0.0:*               LISTEN     9420/inetd
tcp        0      0 127.0.0.1:8118          0.0.0.0:*               LISTEN     3776/privoxy
tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN     3714/cupsd
tcp        0      0 0.0.0.0:25              0.0.0.0:*               LISTEN     3724/sendmail: acce
tcp6       0      0 :::6000                 :::*                    LISTEN     3821/X
This is the desktop i2:

Code:
root@i2:/home/i# netstat -tlnp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:37              0.0.0.0:*               LISTEN     3009/inetd
tcp        0      0 0.0.0.0:587             0.0.0.0:*               LISTEN     3078/sendmail: acce
tcp        0      0 0.0.0.0:113             0.0.0.0:*               LISTEN     3009/inetd
tcp        0      0 0.0.0.0:21              0.0.0.0:*               LISTEN     3009/inetd
tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN     3068/cupsd
tcp        0      0 0.0.0.0:25              0.0.0.0:*               LISTEN     3078/sendmail: acce
tcp6       0      0 :::80                   :::*                    LISTEN     3150/httpd
tcp6       0      0 :::60050                :::*                    LISTEN     3150/httpd
tcp6       0      0 :::50005                :::*                    LISTEN     3150/httpd
tcp6       0      0 :::22                   :::*                    LISTEN     3016/sshd
This is the laptop i7:

Code:
root@i7:/home/i# netstat -tlnp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:37              0.0.0.0:*               LISTEN      2646/inetd
tcp        0      0 0.0.0.0:6000            0.0.0.0:*               LISTEN      3245/X
tcp        0      0 0.0.0.0:113             0.0.0.0:*               LISTEN      2646/inetd
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      3165/sshd
tcp6       0      0 :::6000                 :::*                    LISTEN      3245/X
tcp6       0      0 :::22                   :::*                    LISTEN      3165/sshd
I don't understand why i1 can ping i2 and ssh to it, but can't ping or ssh to i7, while i2 can ping and ssh to i7. What could be wrong?
 
Old 05-29-2008, 02:24 AM   #2
grizly
Member
 
Registered: Nov 2006
Location: Melbourne Australia
Distribution: Centos, RHEL, Debian, Ubuntu, Mint
Posts: 128

Rep: Reputation: 16
What sort of network setup do you have?

I realise they are all ethernet, but how are they physically connected?


Have you tried ping6 ? (or, if your not intending to use ipv6, perhaps you should disable it)
 
Old 05-29-2008, 06:38 AM   #3
Z038
Member
 
Registered: Jan 2006
Location: Dallas
Distribution: Slackware
Posts: 910

Original Poster
Rep: Reputation: 174Reputation: 174
ping6 gives me "unknown host", perhaps because I'm trying to use the regular IP address of 192.168.1.x. I'm not using ipv6 as far as I know.

My network setup: Verizon FIOS router is connected to the outside world. On the inside, i1 and i2 are desktop machines that are both hard wired to a gigabit switch. The switch is hard wired to the router for access to the outside world. i7 is a laptop that connects to the router wirelessly. My router gateway address is 192.168.1.1, netmask is 255.255.255.0. i1 and i2 have static IPs of 192.168.1.15 and 192.168.1.5, respectively. i7 gets a dynamic IP served from the DHCP server in the router. It normally is assigned 192.168.1.152, but that can vary depending on what else is active on my LAN.

I also upgraded the laptop, i7, from Slackware 12.0 to Slackware 12.1 yesterday. The two desktop machines, i1 and i2, are both running Slackware 12.0. I could reach i7 from i1 before I did this upgrade, but I had not done so in a while, so I don't know when it stopped working from i1. I don't think the upgrade is a factor since I can ssh to i7 from i2. The problem must be something unique to i1.

Last edited by Z038; 05-29-2008 at 06:40 AM.
 
Old 05-29-2008, 07:26 AM   #4
grizly
Member
 
Registered: Nov 2006
Location: Melbourne Australia
Distribution: Centos, RHEL, Debian, Ubuntu, Mint
Posts: 128

Rep: Reputation: 16
Can you ping it if you plug it in via ethernet? (ie, unplug i2 and plug in i7)

I still can't think where the problem is, let alone how to fix it mate. Lets take it one step at a time.

Have you tried getting around the problem temporarily until you fix it? (ie, ssh into i2 and tunnel to i7?)

Quote:
ssh me@192.168.1.5 'ssh me@192.168.1.152'
You'd have to type your password twice.. but that's the beauty of having two ssh servers.
 
Old 05-29-2008, 09:56 AM   #5
Z038
Member
 
Registered: Jan 2006
Location: Dallas
Distribution: Slackware
Posts: 910

Original Poster
Rep: Reputation: 174Reputation: 174
I can ssh to i@192.168.1.5 then ssh to i@192.168.1.152 as two separate actions, but when I combine them as you suggested, I get this:

Code:
root@i1:/home/i# ssh i@192.168.1.5 'ssh i@192.168.1.152'
i@192.168.1.5's password:
Pseudo-terminal will not be allocated because stdin is not a terminal.
After plugging i7 into a wired connection, I can ping it from i1, but I still get "no routes" when I ssh to it from i1.

For some reason, even though I plugged i7 into the router, it still used the wireless eth1 instead of eth0, so I'm not sure this is a valid test. I'm not sure how to make my laptop connect via eth0.
 
Old 06-22-2008, 05:59 PM   #6
Z038
Member
 
Registered: Jan 2006
Location: Dallas
Distribution: Slackware
Posts: 910

Original Poster
Rep: Reputation: 174Reputation: 174
Interesting. I did a clean install of Slackware 12.1 on my i1 system 192.168.1.15, then tried to ssh to 192.168.1.152, and got the same problem - no route to host. I then started sshd on i1 and tried again. Same problem. I didn't expect that to make a difference, but I wanted to confirm it. Then with sshd running for the first time on i1, I logged in via ssh from i7 on 192.168.1.152. Then I tried ssh from i1 to i7 one more time, and it worked!

I have no idea why making a connection first from i7 to i1 would fix the problem.
 
  


Reply



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
VMWare and host cannot SSH to each other, but can ping lefty.crupps Linux - Software 2 04-16-2007 10:05 AM
a/p connected, route correct, ping router: "Destination Host Unreachable". DebianEtch shinyblue Linux - Wireless Networking 1 08-29-2006 09:34 PM
Network Problem - No route to host Astral Projection Linux - Software 2 06-17-2006 04:55 PM
ssh: No route to host thanhvn Linux - Software 6 06-30-2005 07:18 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 04:39 AM.

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
Open Source Consulting | Domain Registration