I have a virtual machine running RHEL 6, which I can only access after ping.

[user@localhost ~]$ ssh remotehost
Connection timed out.
[user@localhost ~]$ ping remotehost
PING remotehost.example.com (10.1.60.93) 56(84) bytes of data.
64 bytes from remotehost.example.com (10.1.60.93): icmp_seq=1 ttl=61 time=1.65 ms
^C
--- remotehost.example.com ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 622ms
rtt min/avg/max/mdev = 1.656/1.656/1.656/0.000 ms
[user@localhost ~]$ ssh remotehost
user@remotehost's password:

Everything else seems to be working fine with no problem, but still couldn't reach the root of this issue. What might be causing this behavior ?


Solution 1:

Could be a multiple IP issue (same IP for 2 machines) or a DNS problem. Port Knocking is less likely because using ICMP for portknocking would be pretty dumb (since ICMP has no port).

Try to change the IP address for testing purposes and edit the DNS entry.

Solution 2:

I also had this issue. I found out that the destination host had the wrong netmask set on the interface (it was using /24 instead of /16). Once I fixed this and rebooted, I could connect immediately.