issue in ssh login " connect to host 192.168.22.34 port 22: No route to host"

Asked by Thiruselvan on 2012-08-21

+
root@nickolas:~# nova show superfrobnicator
+-------------------------------------+----------------------------------------------------------+
| Property | Value |
+-------------------------------------+----------------------------------------------------------+
| OS-DCF:diskConfig | MANUAL |
| OS-EXT-SRV-ATTR:host | nickolas |
| OS-EXT-SRV-ATTR:hypervisor_hostname | None |
| OS-EXT-SRV-ATTR:instance_name | instance-00000001 |
| OS-EXT-STS:power_state | 1 |
| OS-EXT-STS:task_state | None |
| OS-EXT-STS:vm_state | active |
| accessIPv4 | |
| accessIPv6 | |
| config_drive | |
| created | 2012-08-21T12:27:24Z |
| flavor | m1.tiny |
| hostId | 43c8310864846a6c1bf73cb19e35382e315c484d84773df07d5d40ce |
| id | 42ef631e-b9bf-461b-a189-f98b652f95c7 |
| image | Ubuntu 12.04 cloudimg amd64 |
| key_name | key1 |
| metadata | {} |
| name | superfrobnicator |
| private network | 192.168.22.34 |
| progress | 0 |
| status | ACTIVE |
| tenant_id | 4f1475ad35034e05814f7f01ab3fa12c |
| updated | 2012-08-21T12:27:48Z |
| user_id | 4d1f6c0058894c359ae7a8ac7807d993 |
+-------------------------------------+----------------------------------------------------------+
root@nickolas:~# ssh 192.168.22.34
ssh: connect to host 192.168.22.34 port 22: No route to host
root@nickolas:~# ssh nova@192.168.22.34
ssh: connect to host 192.168.22.34 port 22: No route to host

Regards,
Thiruselvan S

Question information

Language:
English Edit question
Status:
Answered
For:
OpenStack Compute (nova) Edit question
Assignee:
No assignee Edit question
Last query:
2012-08-22
Last reply:
2012-11-16
Thiruselvan (thirulic) said : #1

root@nickolas:~# ssh -i id_rsa superfrobnicator@192.168.22.34
ssh: connect to host 192.168.22.34 port 22: No route to host

Jian Wen (wenjianhn) said : #2

Check your iptables configuration in the vm.
# sudo iptables-save -t filter

Thiruselvan (thirulic) said : #3

root@nickolas:~# sudo iptables-save -t filter
# Generated by iptables-save v1.4.12 on Wed Aug 22 14:09:50 2012
*filter
:INPUT ACCEPT [46152:26434508]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [33352:15244122]
:nova-api-FORWARD - [0:0]
:nova-api-INPUT - [0:0]
:nova-api-OUTPUT - [0:0]
:nova-api-local - [0:0]
:nova-filter-top - [0:0]
:nova-network-FORWARD - [0:0]
:nova-network-INPUT - [0:0]
:nova-network-OUTPUT - [0:0]
:nova-network-local - [0:0]
-A INPUT -j nova-network-INPUT
-A INPUT -j nova-api-INPUT
-A INPUT -i virbr0 -p udp -m udp --dport 53 -j ACCEPT
-A INPUT -i virbr0 -p tcp -m tcp --dport 53 -j ACCEPT
-A INPUT -i virbr0 -p udp -m udp --dport 67 -j ACCEPT
-A INPUT -i virbr0 -p tcp -m tcp --dport 67 -j ACCEPT
-A FORWARD -j nova-filter-top
-A FORWARD -j nova-network-FORWARD
-A FORWARD -j nova-api-FORWARD
-A FORWARD -d 192.168.122.0/24 -o virbr0 -m state --state RELATED,ESTABLISHED -j ACCEPT
-A FORWARD -s 192.168.122.0/24 -i virbr0 -j ACCEPT
-A FORWARD -i virbr0 -o virbr0 -j ACCEPT
-A FORWARD -o virbr0 -j REJECT --reject-with icmp-port-unreachable
-A FORWARD -i virbr0 -j REJECT --reject-with icmp-port-unreachable
-A OUTPUT -j nova-filter-top
-A OUTPUT -j nova-network-OUTPUT
-A OUTPUT -j nova-api-OUTPUT
-A nova-api-INPUT -d 127.0.0.1/32 -p tcp -m tcp --dport 8775 -j ACCEPT
-A nova-filter-top -j nova-network-local
-A nova-filter-top -j nova-api-local
-A nova-network-FORWARD -i br100 -j ACCEPT
-A nova-network-FORWARD -o br100 -j ACCEPT
-A nova-network-INPUT -i br100 -p udp -m udp --dport 67 -j ACCEPT
-A nova-network-INPUT -i br100 -p tcp -m tcp --dport 67 -j ACCEPT
-A nova-network-INPUT -i br100 -p udp -m udp --dport 53 -j ACCEPT
-A nova-network-INPUT -i br100 -p tcp -m tcp --dport 53 -j ACCEPT
COMMIT
# Completed on Wed Aug 22 14:09:50 2012
root@nickolas:~# ^C

Jian Wen (wenjianhn) said : #4

Use VNC client to login to the instance, then excute the command.

Francois Liot (5-francois) said : #5

same thing to me !

root@ns222899:~# more /etc/network/interfaces
+-------------------------------------+----------------------------------------------------------+
| auto lo
| iface lo inet loopback
|
| auto eth0
| iface eth0 inet static
| address 46.105.111.52
| netmask 255.255.255.0
| network 46.105.111.0
| broadcast 46.105.111.255
| gateway 46.105.111.254
|
| auto eth1
| iface eth1 inet static
| address 192.168.22.1
| network 192.168.22.0
| netmask 255.255.255.0
| broadcast 192.168.22.255
|
+-------------------------------------+----------------------------------------------------------+

root@ns222899:~# more /etc/nova/nova.conf
+-------------------------------------+----------------------------------------------------------+
| [DEFAULT]
| dhcpbridge_flagfile=/etc/nova/nova.conf
| dhcpbridge=/usr/bin/nova-dhcpbridge
| logdir=/var/log/nova
| state_path=/var/lib/nova
| lock_path=/var/lock/nova
| allow_admin_api=true
| use_deprecated_auth=false
| auth_strategy=keystone
| scheduler_driver=nova.scheduler.simple.SimpleScheduler
| s3_host=46.105.111.52
| ec2_host=46.105.111.52
| rabbit_host=46.105.111.52
| cc_host=46.105.111.52
| nova_url=http://46.105.111.52:8774/v1.1/
| routing_source_ip=46.105.111.52
| glance_api_servers=46.105.111.52:9292
| image_service=nova.image.glance.GlanceImageService
| iscsi_ip_prefix=192.168.22
| sql_connection=mysql://novadbadmin:*******@46.105.111.52/nova
| ec2_url=http://46.105.111.52:8773/services/Cloud
| keystone_ec2_url=http://46.105.111.52:5000/v2.0/ec2tokens
| api_paste_config=/etc/nova/api-paste.ini
| libvirt_type=kvm
| libvirt_use_virtio_for_bridges=true
| start_guests_on_host_boot=true
| resume_guests_state_on_host_boot=true
| vnc_enabled=true
| vncproxy_url=http://46.105.111.52:6080
| vnc_console_proxy_url=http://46.105.111.52:6080
| # network specific settings
| network_manager=nova.network.manager.FlatDHCPManager
| public_interface=eth0
| flat_interface=eth1
| flat_network_bridge=br100
| fixed_range=192.168.22.32/27
| floating_range=46.105.111.32/27
| network_size=32
| flat_network_dhcp_start=192.168.22.33
| flat_injected=False
| force_dhcp_release=True
| iscsi_helper=tgtadm
| connection_type=libvirt
| verbose=true
| ec2_private_dns_show=true
| novnc_enabled=true
| novncproxy_base_url=http://46.105.111.52:6080/vnc_auto.html
| vncserver_proxyclient_address=46.105.111.52
| vncserver_listen=46.105.111.52
| rabbit_password=*******
| rootwrap_config=/etc/nova/rootwrap.conf
| root_helper=sudo nova-rootwrap /etc/nova/rootwrap.conf
|
+-------------------------------------+----------------------------------------------------------+

root@ns222899:~# nova network-show b8cdbb1d-a7b3-4f09-87bf-30c24241b1a0
+---------------------+--------------------------------------+
| Property | Value |
+---------------------+--------------------------------------+
| bridge | br100 |
| bridge_interface | eth1 |
| broadcast | 192.168.22.63 |
| cidr | 192.168.22.32/27 |
| cidr_v6 | None |
| created_at | 2012-11-15T19:55:21.000000 |
| deleted | False |
| deleted_at | None |
| dhcp_start | 192.168.22.34 |
| dns1 | 8.8.4.4 |
| dns2 | None |
| gateway | 192.168.22.33 |
| gateway_v6 | None |
| host | ns222899.ovh.net |
| id | b8cdbb1d-a7b3-4f09-87bf-30c24241b1a0 |
| injected | False |
| label | private |
| multi_host | False |
| netmask | 255.255.255.224 |
| netmask_v6 | None |
| priority | None |
| project_id | None |
| rxtx_base | None |
| updated_at | 2012-11-15T20:01:58.000000 |
| vlan | None |
| vpn_private_address | None |
| vpn_public_address | None |
| vpn_public_port | None |
+---------------------+--------------------------------------+

root@ns222899:~# nova show superfrobnicator
+-------------------------------------+--------------------------------------------------------------------+
| Property | Value |
+-------------------------------------+--------------------------------------------------------------------+
| OS-DCF:diskConfig | MANUAL |
| OS-EXT-SRV-ATTR:host | ns222899.ovh.net |
| OS-EXT-SRV-ATTR:hypervisor_hostname | ns222899.ovh.net |
| OS-EXT-SRV-ATTR:instance_name | instance-00000003 |
| OS-EXT-STS:power_state | 1 |
| OS-EXT-STS:task_state | None |
| OS-EXT-STS:vm_state | active |
| accessIPv4 | |
| accessIPv6 | |
| config_drive | |
| created | 2012-11-15T20:01:57Z |
| flavor | m1.tiny (1) |
| hostId | 3d68f0c9c3a642e20cea7725df56489d18d89273a9bdcb3762a8f867 |
| id | bae65510-c11c-4425-8d4d-650b0ffacfcc |
| image | Ubuntu 12.04 cloudimg amd64 (4c9d4f76-7a29-4e3b-931b-936f1c0e0fca) |
| key_name | key1 |
| metadata | {} |
| name | superfrobnicator |
| private network | 192.168.22.34 |
| progress | 0 |
| security_groups | [{u'name': u'default'}] |
| status | ACTIVE |
| tenant_id | bae1f7e73edb44e09801ac82c0dff5f9 |
| updated | 2012-11-15T20:02:05Z |
| user_id | 0e2e18c0548248af8e13d39114cf9ec8 |
+-------------------------------------+--------------------------------------------------------------------+

root@ns222899:~# iptables-save -t filter
+-------------------------------------+--------------------------------------------------------------------+
# Generated by iptables-save v1.4.12 on Thu Nov 15 21:05:45 2012
*filter
:INPUT ACCEPT [15456:5985919]
:FORWARD ACCEPT [141:57025]
:OUTPUT ACCEPT [15802:6107181]
:fail2ban-ssh - [0:0]
:nova-api-FORWARD - [0:0]
:nova-api-INPUT - [0:0]
:nova-api-OUTPUT - [0:0]
:nova-api-local - [0:0]
:nova-compute-FORWARD - [0:0]
:nova-compute-INPUT - [0:0]
:nova-compute-OUTPUT - [0:0]
:nova-compute-inst-3 - [0:0]
:nova-compute-local - [0:0]
:nova-compute-provider - [0:0]
:nova-compute-sg-fallback - [0:0]
:nova-filter-top - [0:0]
:nova-network-FORWARD - [0:0]
:nova-network-INPUT - [0:0]
:nova-network-OUTPUT - [0:0]
:nova-network-local - [0:0]
-A INPUT -j nova-compute-INPUT
-A INPUT -j nova-network-INPUT
-A INPUT -j nova-api-INPUT
-A INPUT -i virbr0 -p udp -m udp --dport 53 -j ACCEPT
-A INPUT -i virbr0 -p tcp -m tcp --dport 53 -j ACCEPT
-A INPUT -i virbr0 -p udp -m udp --dport 67 -j ACCEPT
-A INPUT -i virbr0 -p tcp -m tcp --dport 67 -j ACCEPT
-A INPUT -p tcp -m multiport --dports 22 -j fail2ban-ssh
-A FORWARD -j nova-filter-top
-A FORWARD -j nova-compute-FORWARD
-A FORWARD -j nova-network-FORWARD
-A FORWARD -j nova-api-FORWARD
-A FORWARD -d 192.168.122.0/24 -o virbr0 -m state --state RELATED,ESTABLISHED -j ACCEPT
-A FORWARD -s 192.168.122.0/24 -i virbr0 -j ACCEPT
-A FORWARD -i virbr0 -o virbr0 -j ACCEPT
-A FORWARD -o virbr0 -j REJECT --reject-with icmp-port-unreachable
-A FORWARD -i virbr0 -j REJECT --reject-with icmp-port-unreachable
-A OUTPUT -j nova-filter-top
-A OUTPUT -j nova-compute-OUTPUT
-A OUTPUT -j nova-network-OUTPUT
-A OUTPUT -j nova-api-OUTPUT
-A fail2ban-ssh -j RETURN
-A nova-api-INPUT -d 46.105.111.52/32 -p tcp -m tcp --dport 8775 -j ACCEPT
-A nova-compute-FORWARD -i br100 -j ACCEPT
-A nova-compute-FORWARD -o br100 -j ACCEPT
-A nova-compute-inst-3 -m state --state INVALID -j DROP
-A nova-compute-inst-3 -m state --state RELATED,ESTABLISHED -j ACCEPT
-A nova-compute-inst-3 -j nova-compute-provider
-A nova-compute-inst-3 -s 192.168.22.33/32 -p udp -m udp --sport 67 --dport 68 -j ACCEPT
-A nova-compute-inst-3 -s 192.168.22.32/27 -j ACCEPT
-A nova-compute-inst-3 -j nova-compute-sg-fallback
-A nova-compute-local -d 192.168.22.34/32 -j nova-compute-inst-3
-A nova-compute-sg-fallback -j DROP
-A nova-filter-top -j nova-compute-local
-A nova-filter-top -j nova-network-local
-A nova-filter-top -j nova-api-local
-A nova-network-FORWARD -i br100 -j ACCEPT
-A nova-network-FORWARD -o br100 -j ACCEPT
-A nova-network-INPUT -i br100 -p udp -m udp --dport 67 -j ACCEPT
-A nova-network-INPUT -i br100 -p tcp -m tcp --dport 67 -j ACCEPT
-A nova-network-INPUT -i br100 -p udp -m udp --dport 53 -j ACCEPT
-A nova-network-INPUT -i br100 -p tcp -m tcp --dport 53 -j ACCEPT
COMMIT
# Completed on Thu Nov 15 21:05:45 2012
+-------------------------------------+--------------------------------------------------------------------+

root@ns222899:~# route
+-------------------------------------+--------------------------------------------------------------------+
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default vss-gw-6k.fr.eu 0.0.0.0 UG 0 0 0 eth0
46.105.111.0 * 255.255.255.0 U 0 0 0 eth0
192.168.22.0 * 255.255.255.0 U 0 0 0 br100
192.168.22.32 * 255.255.255.224 U 0 0 0 br100
192.168.122.0 * 255.255.255.0 U 0 0 0 virbr0
+-------------------------------------+--------------------------------------------------------------------+

root@ns222899:~# ssh root@192.168.22.34
ssh: connect to host 192.168.22.34 port 22: Connection timed out

Jian Wen (wenjianhn) said : #6

Create a new security group rule for the instance to allow ssh traffic.
If the above step doesn't help, then
   Make sure the iptables inside the VM don't drop ssh packets.
If the above step doesn't help, then
   $ nova console-log INSTNCE_UUID

Francois Liot (5-francois) said : #7

The VM indeed doesn't get dhcp answer

....
cloud-init-nonet waiting 120 seconds for a network device.
cloud-init-nonet gave up waiting for a network device.
ci-info: lo : 1 127.0.0.1 255.0.0.0 .
ci-info: eth0 : 1 . . fa:16:3e:0d:cc:aa
route_info failed
....

Some idea on how to troubleshot that ?

Francois Liot (5-francois) said : #8

Continuing the troubleshooting,

1) I changed the eth1 netmask in /etc/network/interfaces,
to avoid such interface to pass in promiscuity mode when br100 goes up
+-------------------------------------+----------------------------------------------------------+
| auto eth1
| iface eth1 inet static
| address 192.168.22.1
| network 192.168.22.1
| netmask 255.255.255.224
| broadcast 192.168.22.31
+-------------------------------------+----------------------------------------------------------+

2) I corrected my /etc/nova/nova.conf, with :
+-------------------------------------+----------------------------------------------------------+
| flat_interface=br100
| flat_network_bridge=eth1
| fixed_range=192.168.22.32/27
| floating_range=46.105.111.32/27
| auto_assign_floating_ip=False
+-------------------------------------+----------------------------------------------------------+

I get significant improvments, now the dhcp serves some config to the VM, in local /var/log/syslog :
+-------------------------------------+----------------------------------------------------------+
| Nov 16 20:09:26 ns222899 dnsmasq-dhcp[8391]: DHCPOFFER(br100) 192.168.22.35 fa:16:3e:41:9c:28
+-------------------------------------+----------------------------------------------------------+

But the VM doesn't recieve it :-( , as per "nova console-log .."
+-------------------------------------+----------------------------------------------------------+
| Begin: Running /scripts/init-bottom ... done.
| cloud-init start-local running: Fri, 16 Nov 2012 19:04:32 +0000. up 3.59 seconds
| no instance data found in start-local
| cloud-init-nonet waiting 120 seconds for a network device.
| cloud-init-nonet gave up waiting for a network device.
| ci-info: lo : 1 127.0.0.1 255.0.0.0 .
| ci-info: eth0 : 1 . . fa:16:3e:41:9c:28
| route_info failed
| Waiting for network configuration...
| Waiting up to 60 more seconds for network configuration...
| Booting system without full network configuration...
+-------------------------------------+----------------------------------------------------------+

Any idea ?

Can you help with this problem?

Provide an answer of your own, or ask Thiruselvan for more information if necessary.

To post a message you must log in.