How to create a shared VPC in Google Cloud Platform (GCP)

A shared VPC is used to create a shared network between your projects and between regions and multi-regional zones in GCP. Essentially is allow you to create a flat network which all resources can access.

There are TWO major gotchas:

  1. Your account must have the IAM Role “Compute Shared VPC Admin” and “Organizational Admin”
  2. You must have the default VPC already created – to do this just view the VPC for your project and Compute Engine will automatically create the default subnet
, How to create a shared VPC in Google Cloud Platform (GCP)
Here you can see my gcpadmin account has Compute Shared VPC Admin and Organization Administrator IAM roles

If you dont have the roles you can find them by looking in Compute Engine>

, How to create a shared VPC in Google Cloud Platform (GCP)

Next goto the Google Compute Engine > Shared VPC

On the Set Up Shared VPC page click save and continue

, How to create a shared VPC in Google Cloud Platform (GCP)

On the Select subnets page choose your sharing mode and add you pre-created subnets

, How to create a shared VPC in Google Cloud Platform (GCP)

Next allocate the permissions to the projects

, How to create a shared VPC in Google Cloud Platform (GCP)

Next press the Attach Project button and add you other projects. Make sure you check the subnets are attached too.

, How to create a shared VPC in Google Cloud Platform (GCP)

It will take a few moments to process

, How to create a shared VPC in Google Cloud Platform (GCP)

Then your cross-project Shared VPC is created

, How to create a shared VPC in Google Cloud Platform (GCP)

Next test connectivity by creating a demo VM in your sub-project region. Make sure you attach it to the correct subnet at the point of creation called “Networks shared with me

, How to create a shared VPC in Google Cloud Platform (GCP)

Next test connectivity. Make sure you have enabled firewall rules for SSH and ICMP (ping)

You can see i have 2x VM. One in London(Master Project), One in Finland (Guest Project)

, How to create a shared VPC in Google Cloud Platform (GCP)
, How to create a shared VPC in Google Cloud Platform (GCP)

Note different regions and different IP subnet ranges.

, How to create a shared VPC in Google Cloud Platform (GCP)

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *