Explore hands-on VPC network peering within Google Cloud Platform (GCP). We'll create separate VPCs in different regions, set up VMs in each VPC, and deploy an Nginx server. And then, we will establish a connection between two VMs using VPC network peering.
- Google Cloud Platform(GCP) account or playground.
- Knowledge about VPC, VM instance, Subnet, Network interface.
Now we can see the vpc-1
and vpc-2
are in the list.
Now we can see the vm-1
and vm-2
list.
Now we can see the two active network peering.
Now if we try to connect from vm-1
to the vm-2
, it will be connected now.
Here we will install nginx at vm-1
and will try to access from vm-2
.
-
At
vm-1
terminal, use the following command.To update app:
sudo apt update -y
To install nginx:
sudo apt install nginx
To check nginx service status::
systemctl status nginx
We will get the output like:
-
Now we will try to access from
vm-2
terminal:curl http://34.75.68.89
We will get the output like:
And Finally we have got the nginx server response from vm-1
to vm-2
.