Skip to content

Latest commit

 

History

History

GSP211_Multiple-VPC-Networks

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 

GSP211 —— Multiple VPC Networks

Table of Contents (🔎 Click to expand/collapse)

Overview

In this lab you create several VPC networks and VM instances and test connectivity across networks. Specifically, you create two custom mode networks (managementnet and privatenet) with firewall rules and VM instances as shown in this network diagram:

GSP313 —— Create and Manage Cloud Resources

The mynetwork network with its firewall rules and two VM instances (mynet-eu-vm and mynet-us-vm) have already been created for you in this Qwiklabs project.

Create VPC Networks

Graphical User Interface

  1. Click Navigation Menu > VPC network > VPC networks.
  2. Click CREATE VPC NETWORK.
  3. Fill up the fields and click CREATE

Command Line Interface

# create the network
$ gcloud compute networks create <NETWORK_NAME> --subnet-mode=custom

# create the subnets
$ gcloud compute networks subnets create <SUBNETS_NAME> \
    --region="<REGION>" \
    --network="<NETWORK_NAME>" \
    --range="<IP_RANGE>"

# list the available VPC networks
$ gcloud compute networks list

# list the available VPC subnets
$ gcloud compute networks subnets list --sort-by=NETWORK

Create the Firewall Rules

Graphical User Interface

  1. Click Navigation Menu > VPC network > Firewall.
  2. Click CREATE FIREWALL RULE.
  3. Fill up the fields and click CREATE

Command Line Interface

# create the firewall rule
$ gcloud compute firewall-rules create <FIREWALL_RULE_NAME> \
    --network="<NETWORK_NAME>" \
    --direction="<DIRECTION>" \
    --priority="<PRIORITY>" \
    --action="<ACTION>" \
    --rules="<RULES>" \
    --source-ranges="<RANGE>"

# list all the firewall rules
$ gcloud compute firewall-rules list --sort-by=NETWORK

Create VM Instances

Graphical User Interface

  1. Click Navigation Menu > Compute Engine > VM instances.
  2. Click CREATE INSTANCE.
  3. Fill up the fields and click CREATE

Command Line Interface

# create VM instances
$ gcloud compute instances create <INSTANCE_NAME> \
    --zone="<ZONE>" \
    --machine-type="<MACHINE_TYPE>" \
    --subnet="<SUBNETS_NAME>"

# list all the VM instances
$ gcloud compute instances list --sort-by=ZONE

References