Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

How to ping between nested vm running on two different machine?

Hello,

I have two vm(say vm1 and vm2), that are running vm inside them using nested virtualization (say vvm1 inside vm1 and vvm2 inside vm2). How can i ping vvm1 from vvm2 and vise versa? Currently vvm1 can ping vm1 and vm2 but not vvm2 and similarly vvm2 can ping vm1 and vm2. 

1 2 298
2 REPLIES 2

Hi @ujjwalpawar,

Welcome to the Google Cloud Community!

Just to clarify: You're working with two VMs, named VM1 and VM2. Inside VM1, there's a nested VM referred to as VVM1, and inside VM2, there's another nested VM named VVM2.

Currently, the setup allows:

  • VVM1 can communicate with both VM1 and VM2
  • VVM2 can also communicate with both VM1 and VM2
  • Direct communication between VVM1 and VVM2 is not established.

You can try following a similar setup provided in the documentation - Creating an L2 VM with network access from outside the L1 VM.

Let me know if you have more questions. Thank you.

Cheers,

Lawrence

I had similar problem. I have L2 VM running inside of a L1 vm. L1 vm has an IP alias /32 assigned. I wanted to route traffic for IP alias to a L2 VM, that exposed TAP0 network interface.

  • L1 IP: 10.0.0.10
  • L1 IP alias: 10.0.0.11   (later used as an IP of L2 VM)
  1. removed IP alias from local route table 
    `ip route del local 10.0.0.11 dev eth0`
  2. I assigned ip addr add local L1-ip-address dev tap0 remote IP-alias-address
    `ip addr add local 10.0.0.10 dev tap0 remote 10.0.0.11`

Now I can ping L1 vim using 10.0.0.10 and l2 VM using 10.0.0.11  from other GCE vms.