Ask Your Question
0

can't ping from vm

asked 2016-03-17 22:11:16 -0500

chansonzhang gravatar image

updated 2016-03-17 22:13:02 -0500

hi, I followed this guide, when I launch an instance as follow:

+--------------------------------------+----------------+--------+------------+-------------+--------------------------------------+

| ID | Name | Status | Task State | Power State | Networks |

+--------------------------------------+----------------+--------+------------+-------------+--------------------------------------+ | 41aa69a4-b3ff-4a58-a067-d6297e7f708d | Test server | ACTIVE | - | Running | demo-net=192.168.2.3

and the demo-net is as follow:

+------------------+--------------------------------------------------+

| Field | Value |

+------------------+--------------------------------------------------+

| allocation_pools | {"start": "192.168.2.2", "end": "192.168.2.254"} |

| cidr | 192.168.2.0/24 |

| dns_nameservers | |

| enable_dhcp | True |

| gateway_ip | 192.168.2.1 |

| host_routes | |

| id | 552cf391-c30c-440c-ac27-5962fcd0d6a1 |

| ip_version | 4 |

| name | demo-subnet |

| network_id | 22bec80b-f9dd-40f0-9d29-9d8fd36c50e5 |

| tenant_id | e8e3b94c7d0c45578c9fbbf0d341e5a2 |

+------------------+--------------------------------------------------+

I can ping the vm from my network node:

ping 192.168.2.3

PING 192.168.2.3 (192.168.2.3) 56(84) bytes of data.

64 bytes from 192.168.2.3: icmp_seq=1 ttl=245 time=38.5 ms

64 bytes from 192.168.2.3: icmp_seq=2 ttl=245 time=29.0 ms

and can ping 192.168.2.2(I don't know what this ip is for)

ping 192.168.2.2

PING 192.168.2.2 (192.168.2.2) 56(84) bytes of data.

64 bytes from 192.168.2.2: icmp_seq=1 ttl=244 time=27.1 ms

64 bytes from 192.168.2.2: icmp_seq=2 ttl=244 time=27.3 ms

however, i can't ping the gateway of this demo-subnet:

ping 192.168.2.1

(just show nothing)

At last in the vm, i can ping nothing

try to solve this, i added rules in the default secgroup

+-------------+-----------+---------+-----------+--------------+

| IP Protocol | From Port | To Port | IP Range | Source Group |

+-------------+-----------+---------+-----------+--------------+

| icmp | -1 | -1 | 0.0.0.0/0 | |

| tcp | 22 | 22 | 0.0.0.0/0 | |

+-------------+-----------+---------+-----------+--------------+

does i need to restart some service to make this into effect and how?

thank for your reading!

edit retag flag offensive close merge delete

Comments

Check whether routes are set on the VM on not: Run the following command:

# route -n
pjb gravatar imagepjb ( 2016-03-18 06:36:58 -0500 )edit

I runroute -n in the vm, it just show an empty table

chansonzhang gravatar imagechansonzhang ( 2016-03-18 06:57:29 -0500 )edit

If route is not getting added then the VM won't be able to ping. It should be getting added automatically after launch. Anyway try setting the route manually (change the values according to your set-up)

# sudo route add -net 192.168.2.0 gw 192.168.1.1 netmask 255.255.255.0 dev eth1
pjb gravatar imagepjb ( 2016-03-18 07:03:37 -0500 )edit

I add this route manually, but it still don't work. However, i think you direct me to a right way, when I restart the eth0 use ifdown eth0and ifup eth0,the output is

udhcpc(v1.20.1) started sening discover... sending discover... sending discover... No lease,failing

chansonzhang gravatar imagechansonzhang ( 2016-03-18 20:59:33 -0500 )edit

It seems packets are getting dropped somewhere. Are you using openvswitch as the mechanism driver? What is the overlay mechanism(GRE/FLAT/VXLAN/VLAN) that your are using in DEMO-NET ?

pjb gravatar imagepjb ( 2016-03-21 01:17:11 -0500 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2016-10-18 17:59:40 -0500

aegiacometti gravatar image

try to use tcpdump at every interface just to follow the flow of the packet, this will allow you to identify where it gets and where it is supposed to get... back and forth

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2016-03-17 22:11:16 -0500

Seen: 68 times

Last updated: Mar 17 '16