Google Cloud Virtual Private Cloud – VPC

Reading Time: 3 minutes

Virtual Private Cloud – VPC provides networking functionality for the cloud-based resources and services that is global, scalable, and flexible.

What is the Virtual Private Cloud – VPC network in GCP?

A VPC network is a global resource that consists of a list of regional virtual subnetworks (subnets) in data centers, all connected by a global wide area network. VPC networks are logically isolated from each other in Google Cloud.

What are the types of Virtual Private Cloud – VPC networks in Google Cloud?

Google Cloud offers three types of VPC networks, determined by their subnet creation mode:

  • Default-mode VPC.
  • Auto-mode VPC.
  • Custom-mode VPC.

Why VPC is needed for GCP?

A Google Cloud VPS is global, shareable, and expandable. Using a VPC gives you managed, global networking functionality for all of your Google Cloud resources through subnetworks, known as subnets, hosted in Google Cloud data centers. Each subnet is assigned to a specific region.

How to Create VPC (Virtual Private Cloud) Network in GCP

VPC is a virtual private cloud in public cloud-like GCP (Google Cloud Platform) and AWS. In simple terms, VPC is a dedicated private network for your project in the google cloud platform. It provides networking for virtual machines, containers, and app engines.

In this guide, we will learn how to create a customized VPC network in GCP (Google Cloud Platform) step by step. Without any further delay, let’s jump into steps.

1) Log in to Google Cloud Console and Go to VPC networks

Click on ‘VPC network‘, and it will open the VPC networks page.

2) Create VPC Network

Click on ‘Create VPC network‘ and we will get the following page, specify the following details.

  • VPC Name:  vpc-a
  • Description (Optional): Virtual Private Cloud in LinuxTechi Project
  • Subnet Create Mode: custom (If you choose automatic, it will create a subnet in all regions automatically)
  • Subnet Name: linuxtechi-prv-subnet
  • Subnet Region: Europe-west2
  • IP address range: 10.30.0.0/26  (Specify the CIDR range as per requirement)
  • Private Google Access: Off (If you keep this option as ‘ON’ then it will allow this subnet to make API calls to GCP services privately)
  • Flow Logs:  off
  • Firewall Rules: Allow Ingress ICMP, RDP, and SSH protocols/ ports. ( You can define your own custom rules)
  • Dynamic Routing Mode: Regional
  • In the last step, choose the MTU and then click on ‘Create’ to create VPC along with its subnet.

3) Verify VPC Network and Subnet

4) Test VPC Network and its Subnet

To test the above created VPC network, let’s create one virtual machine inside the VPC. From the search bar, search ‘add VM instance’.

  • In the networking section, choose the VPC as ‘vpc-a’ and subnet as ‘linuxtechi-prv-subnet’
  • Now, click on the ‘Create’ option to launch the virtual machine.
  • Once the VM comes up, try to take its ssh console and verify the internal IP and whether it is coming from the subnet of VPC-A.

Perfect, the above confirms that VM has been created successfully and got the IP from the subnet of VPC-A.

Note: Kindly delete the virtual machine after the testing to avoid unnecessary billing.

Written by 

Strong in design and integration problem-solving skills. Experience in Java/J2EE with database analysis and design. Skilled in developing business plans, requirements specifications, user documentation, and architectural systems research. Having Good Work Experience with Core Java, Advanced Java, Typescript, and Related Technologies, AWS like S3, Lambda, EC2, Elemental Live, Media Live, Tesseracts, and Textract.

Discover more from Knoldus Blogs

Subscribe now to keep reading and get access to the full archive.

Continue reading