Google Cloud Platform  VPC Peering

Google Cloud Platform VPC Peering

1. Create a new Project in GCP

  1. To Create New project and select the project

  1. After creating the project associate the project with a billing account. For this go to the Billing section and select manage billing accounts

Next, select the project under manage billing and enable the billing. (by default it will be enabled)

2. Creating new VM instance

  1. Before creating the vm instance in GCP you have to enable the API for Compute Engine for that go to below menu and select the Library

And then select the compute category → go to compute engine api to enable it

  1. Now you can create the VM instance

Menu → Compute Engine → VM Instance- → create

Configure VM as shown below or you can modify according to your need

Now you select boot disk option and select which OS you need. (here i using centos 7) And create the VM.

3. To create a firewall for VM instances

  1. Now we want to install webserver in our VM and to Access this webserver we have to open port 80 for VM instance

  2. To configure firewall go back to menu → select VPC Network →firewall →create firewall rule.

Here you give name and change Target and other setting as shown below

4. Creating new VPC

  1. To create new vpc go to

Menu → Networking → Vpc Network →create new VPC network

5. VPC Peering

A VPC peering connection is a networking connection between two VPCs that enables you to route traffic between them using private IP addresses.

  1. Create 2 vpc in different regions with the help of above instruction

  2. Create 1 vm instance in each custom vpc

  1. Now configure firewall rule in both instances

  1. Vpc peering - configure this setup in both project vpc’s

Click on create