LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (http://www.linuxquestions.org/questions/linux-networking-3/)
-   -   ssh: connect to host port 22: Connection timed out (http://www.linuxquestions.org/questions/linux-networking-3/ssh-connect-to-host-port-22-connection-timed-out-887450/)

shogun1234 06-21-2011 12:54 AM

ssh: connect to host port 22: Connection timed out
 
I have 5 virtual machines, ranging from server01 to server05 based on virtualbox 4.0.2_OSEr35621, located at the same network section. The network config for 5 machines looks like

Code:

# Host is Debian server
# The config value has been changed.
iface eth0 inet static
address 192.168.1.111 # other machines would be 192.168.1.xxx
netmask 255.255.255.0
gateway 192.168.1.111

My problem is sometimes connecting from server01 to other 4 machines (server02~server05) would be broken.

SSH client would print
Code:

ssh: connect to host server02 port 22: Connection timed out
The debug output of ssh client (ssh -vvv user@server02)
Code:

OpenSSH_5.5p1 Debian-5+b1, OpenSSL 0.9.8o 01 Jun 2010
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to server02 [192.168.1.112] port 22.
debug1: connect to address 192.168.1.112 port 22: Connection timed out
ssh: connect to host server02 port 22: Connection timed out

The weird thing is the connection to server02 from host machine (which is also Debian) would not have e.g. borken pipes issue. So the ssh connection (host-> server02) works ok whilst connection from server01 to server02 returns timeout.

It seems to me the root cause might be underlying routing issue. But where can I check the log/ information to find out exactly what happened?

Thanks.

matsvw 06-21-2011 12:07 PM

Looks to me like your IP address and gateway are set the same on your server01. That could be causing all sorts of havoc. Especially if the other systems also have 192.168.1.111 set as their gateway.


All times are GMT -5. The time now is 06:06 AM.