How to set up VPC Peering in Google Cloud Platform ?

Arvind Ramugade
4 min readAug 22, 2020


VPC Peering is a concept using which O.S. in different VPC can communicate with each other using pvt IP’s through GCP owned high speed optical fiber network. It reduces cost, latency & improves performance to a great extent.

First of all let us try to create 2 different VPC’s

  1. VPC in Singapore region
VPC in S’pore Region
VPC in S’pore Region

VPC in US region

VPC in US Region
VPC in US Region

We can confirm VPC creation as below

VPC Created in S’pore & US region

Now let us try to launch instances in each of the above VPCs

Launching instance in S’pore region

Instance in S’pore Region
CentOS 7 as boot disk
allowing HTTP traffic

In the networking we can attach to the “devvp”’ created initially.

attaching instance to devvpc

Finally we can create instance

instance created

When we try to connect above instance using open web browser provided bu GCP, we can see the screen as follows

Connecting to instance using web browser

This connection will fail as we need to modify firewall rules.

by default instance will have following rules

firewall rules
New firewall rule to allow traffic
adding tcp 80 port
allow ssh from port 22
modified rule

Now we can successfully connect to instance as under

connection to instance successful

we can also install web server as follows

Web Server installation on instance
Web Server Configuration on instance

We can verify the Web site as under

website launched successfully

In a similar fashion we can launch instance in other VPC which we have created.

creating instance in Us-east-1 region

Selecting the custom VPC for the instance

selecting VPC as above
Instance launched successfully

Modifying the firewall rules for “prod” instance launched above

modifying rule for prodvpc
allow http & ssh traffic
modified firewall rules for prodvpc

We can test connectivity to “prod” instance through web browser as under

connectivity to prodinstance

now let’s try to ping from “dev” instance to “prod” instance using ping command

We can see that ping doesn’t happen from “dev” instance to “prod” instance.

This can be resolved using VPC peering

ping from devinstance to prodinstance

For VPC peering we need to create peering connection as under

We should note the project id & vpc network name before creating VPC peering connection.

vpc peering connection

The status still shows inactive as we need to allow peering from other side as well i.e. from “prodvpc” to “devvpc” as well

VPC peering connection established

and we can see that the “dev” instance is able to ping “prod” instance now

VPC Peering successful

Thus, VPC peering helps to communicate instances in different VPC’s using private IP’s instead of public IP’s. Thus it’s more secure, high speed & reduces latency.



Arvind Ramugade

Cloud Professional experienced in BFSI ,Telecom, Insurance domain with fortune 500 clients spread across USA, Europe, Canada, Australia and India.