Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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:
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.
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.