[lug] can ping the host, but can't ssh for a few seconds

Michael Hirsch mdhirsch at gmail.com
Mon Jul 9 13:02:59 MDT 2012


I've got a weird problem I'm having trouble understanding.  There is a
host, saratoga, that I'd like to ssh to in a script.  The script kept
failing with "No route to host" but it would succeed when I try it by hand.

At first I thought it was a script vs. command line issue, but that isn't
it.

It turns out that the first time I try to ssh to saratoga, I get the
error.  Then a few seconds later I can connect.  What could be causing this?

As you can see from the paste below, I can ping saratoga, my route seems
reasonable, but when I try to ssh to it I get "ssh: connect to host warsaw
port 22: No route to host".  A few seconds later, my ssh connects.  If I
don't ssh for a few minutes, the pattern repeats.

Any suggestions?

Thanks,

Michael

[software at saratoga ~]$ ping -c 1 saratoga; /sbin/route; ssh software at warsaw
PING saratoga.stirlingsystems.net (192.168.1.40) 56(84) bytes of data.
64 bytes from saratoga.stirlingsystems.net (192.168.1.40): icmp_seq=0
ttl=64 time=0.033 ms

--- saratoga.stirlingsystems.net ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.033/0.033/0.033/0.000 ms, pipe 2
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use
Iface
172.16.30.0     *               255.255.255.0   U     0      0        0
vmnet8
192.168.137.0   *               255.255.255.0   U     0      0        0
vmnet1
192.168.8.0     192.168.1.51    255.255.255.0   UG    0      0        0 eth0
192.168.0.0     *               255.255.252.0   U     0      0        0 eth0
169.254.0.0     *               255.255.0.0     U     0      0        0 eth0
default         192.168.1.1     0.0.0.0         UG    0      0        0 eth0
ssh: connect to host warsaw port 22: No route to host
[software at saratoga ~]$
[software at saratoga ~]$
[software at saratoga ~]$ ssh software at warsaw
software at warsaw's password:

[software at saratoga ~]$
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lug.boulder.co.us/pipermail/lug/attachments/20120709/478d36f2/attachment.html>


More information about the LUG mailing list