VPN connection between two networks
Similar to the previous recipe, another way to establish a connection between two networks is via a VPN connection. Usually, a VPN connection is used to connect an on-premises network with GCP via an IPSEC tunnel. However, for all learning purposes, connecting two VPCs gives us a good understanding of how to go about a VPN setup.
Getting ready
The following are the initial setup verification steps and network creation to be carried out before the recipe can be executed:
- Create or select a GCP project.
- Enable billing and enable the default APIs (some APIs such as BigQuery, storage, monitoring, and a few others are enabled automatically).
- Similar to the previous recipe, we'll create a VPC network calledÂ
alpha-nw
. The following command assumes that you have set your default project:
gcloud compute networks create alpha-nw --subnet-mode=custom
- Next, let's create a single subnet calledÂ
alpha-subnet-1
 with an IP range ofÂ192.168.0.0/16
:
gcloud compute networks subnets...