Multiple VPC Networks

Multiple VPC Networks

28 December 2020

VPC Networks

A Virtual Private Cloud (VPC) network is a physical network in the virtual environment implemented in the Google Cloud. A VPC provides connectivity for compute engine instances, kubernetes engine clusters and App engine instances.

The VPC network offers internal TCP/UDP load balancing for Internal HTTP(S) load balancing. VPC network is used for connecting to on-premises networks through Cloud VPN and Interconnect.

The traffic is distributed to backends using external load balancers. A VPC network belongs to the project and any projects can contain multiple VPC networks.

There are three types of networks, default, auto, and custom networks. Any new project created takes the default network and it has one subnet in the region.

How is a multiple VPC Network connection?

Create the VPC networks with the firewall rules to allow required traffic and block the remaining traffic. Create the Compute Engine Instances assigning to each VPC network.

Command to create a VPC network:

gcloud compute networks create <name of network> --subnet-mode=<custom/auto>

Command to create the firewall rules:

gcloud compute firewall-rules create <name> --action=ALLOW --rules=icmp,tcp:22,tcp:3389

Command to create a VM instance using the VPC network:

gcloud compute instances create <name> --zone=<zone name> --machine-type= --subnet=

Creating a VM instance with multiple network interfaces:

Create a VM instance and in the Networking add the multiple networks created earlier with the subnets.

An instance connects to several VPC networks based on the multiple network interfaces and it enables you to create configurations. The no. of interfaces is based on the VM instance machine type and the no. of vCPUs.

If the vm instances are under the same network, but in different regions still they can connect using the internal ip address. If the instances are created in the same region but in a different network then they can be connected only through the external ip address.

search
Blog Categories
Request a quote