简体   繁体   中英

How do I access to GCP vm from external if I set up later?

Environment: Google Cloud Platform
Ubuntu 20.04 LTS

I've created below environment on GCP.

  1. I've created 3 network(nw1(for ssh from external), nw2(private), nw3(public))
  2. I've created vm1(nic with nw1, nw2, ExternalIP in nw1)
  3. I can access vm2 using ExternalIP from external my machine
  4. I've created vm2(nic with nw2, nw3 without ExternalIP)
  5. I can access vm2 via using ssh to vm1 and then ssh via nw2
  6. I've created new ExternalIP to nw3 and set vm2
  7. Now I cannot access(icmp, ssh, etc.) vm2 via nw3.(Firewall allows all traffics form 0.0.0.0/0)

What should I change?

I still don't fully understand your setup, however, in order to allow communication between subnetworks, firewall rules must permit two-way communication.
So for example:
Firewall in NW2 must allow packets from NW3
AND
Firewall in NW3 must allow packets from NW2

It can be helpful to enable Firewall logging and trace the packets to find where they are being dropped.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM