Bird
Raised Fist0
GCPcloud~10 mins

Why advanced networking matters in GCP - Test Your Understanding

Choose your learning style10 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to create a Virtual Private Cloud (VPC) network in GCP.

GCP
resource "google_compute_network" "vpc_network" {
  name = "my-vpc-network"
  auto_create_subnetworks = [1]
}
Drag options to blanks, or click blank then click option'
Afalse
Btrue
C"yes"
D"no"
Attempts:
3 left
💡 Hint
Common Mistakes
Using string values like "yes" or "no" instead of boolean true or false.
Setting auto_create_subnetworks to true when custom control is needed.
2fill in blank
medium

Complete the code to create a subnet in a specific region within the VPC.

GCP
resource "google_compute_subnetwork" "subnet" {
  name          = "my-subnet"
  ip_cidr_range = "10.0.0.0/24"
  region        = [1]
  network       = google_compute_network.vpc_network.id
}
Drag options to blanks, or click blank then click option'
A"europe-west1"
B"global"
C"us-central1"
D"asia-east1"
Attempts:
3 left
💡 Hint
Common Mistakes
Using "global" as a region, which is invalid for subnetworks.
Using incorrect region names or missing quotes.
3fill in blank
hard

Fix the error in the firewall rule to allow HTTP traffic on port 80.

GCP
resource "google_compute_firewall" "allow_http" {
  name    = "allow-http"
  network = google_compute_network.vpc_network.id

  allow {
    protocol = [1]
    ports    = ["80"]
  }

  direction = "INGRESS"
  source_ranges = ["0.0.0.0/0"]
}
Drag options to blanks, or click blank then click option'
A"icmp"
B"udp"
C"http"
D"tcp"
Attempts:
3 left
💡 Hint
Common Mistakes
Using "http" as protocol instead of "tcp".
Using "udp" or "icmp" which do not apply to HTTP traffic.
4fill in blank
hard

Fill both blanks to configure a firewall rule that allows SSH access only from a specific IP range.

GCP
resource "google_compute_firewall" "allow_ssh" {
  name    = "allow-ssh"
  network = google_compute_network.vpc_network.id

  allow {
    protocol = [1]
    ports    = [[2]]
  }

  direction     = "INGRESS"
  source_ranges = ["203.0.113.0/24"]
}
Drag options to blanks, or click blank then click option'
A"tcp"
B"22"
C"80"
D"icmp"
Attempts:
3 left
💡 Hint
Common Mistakes
Using port 80 or icmp protocol for SSH.
Not putting the port number as a string inside the list.
5fill in blank
hard

Fill all three blanks to create a forwarding rule for HTTP traffic to a target proxy.

GCP
resource "google_compute_global_forwarding_rule" "http_forwarding_rule" {
  name                  = "http-forwarding-rule"
  load_balancing_scheme = [1]
  port_range            = [2]
  target                = [3]
  ip_protocol           = "TCP"
}
Drag options to blanks, or click blank then click option'
A"EXTERNAL"
B"80"
Cgoogle_compute_target_http_proxy.http_proxy.id
D"INTERNAL"
Attempts:
3 left
💡 Hint
Common Mistakes
Using "INTERNAL" scheme for external HTTP traffic.
Using wrong port or missing the target resource reference.

Practice

(1/5)
1. Why is advanced networking important in Google Cloud Platform (GCP)?
easy
A. It helps connect cloud resources securely and efficiently.
B. It automatically fixes all software bugs.
C. It increases the size of virtual machines.
D. It reduces the cost of cloud storage.

Solution

  1. Step 1: Understand the role of networking in cloud

    Networking connects different cloud resources so they can communicate.
  2. Step 2: Recognize the benefits of advanced networking

    Advanced networking adds security and efficiency to these connections.
  3. Final Answer:

    It helps connect cloud resources securely and efficiently. -> Option A
  4. Quick Check:

    Advanced networking = secure, efficient connections [OK]
Hint: Think about how cloud parts talk safely and fast [OK]
Common Mistakes:
  • Confusing networking with software debugging
  • Mixing networking with storage or VM sizing
  • Assuming networking reduces costs directly
2. Which of the following is the correct way to create a custom VPC network in GCP using gcloud CLI?
easy
A. gcloud compute networks new my-network --subnet-mode=auto
B. gcloud compute networks create my-network --subnet-mode=custom
C. gcloud network create my-network --subnet=custom
D. gcloud compute create network my-network --mode=auto

Solution

  1. Step 1: Recall gcloud command syntax for creating networks

    The correct command uses 'gcloud compute networks create' with '--subnet-mode=custom' to specify custom subnets.
  2. Step 2: Check each option for correct syntax

    gcloud compute networks create my-network --subnet-mode=custom matches the correct syntax; others have wrong commands or flags.
  3. Final Answer:

    gcloud compute networks create my-network --subnet-mode=custom -> Option B
  4. Quick Check:

    Correct gcloud network create syntax = gcloud compute networks create my-network --subnet-mode=custom [OK]
Hint: Remember 'gcloud compute networks create' plus subnet mode [OK]
Common Mistakes:
  • Using 'create network' instead of 'networks create'
  • Mixing 'subnet-mode' with wrong flags
  • Using 'new' instead of 'create'
3. Given this firewall rule configuration in GCP, what will happen if you try to connect to a VM on port 22 (SSH)?
gcloud compute firewall-rules create allow-ssh --network=my-network --allow=tcp:22 --source-ranges=10.0.0.0/24
medium
A. SSH connections from IPs outside 10.0.0.0/24 will be blocked.
B. SSH connections from any IP address will be allowed.
C. All traffic to port 22 will be blocked.
D. SSH connections from 0.0.0.0/0 will be allowed.

Solution

  1. Step 1: Analyze the firewall rule source range

    The rule allows TCP port 22 only from IPs in 10.0.0.0/24 subnet.
  2. Step 2: Understand effect on SSH connections

    SSH from IPs outside 10.0.0.0/24 will be blocked because no rule allows them.
  3. Final Answer:

    SSH connections from IPs outside 10.0.0.0/24 will be blocked. -> Option A
  4. Quick Check:

    Firewall source range limits access = SSH connections from IPs outside 10.0.0.0/24 will be blocked. [OK]
Hint: Check source-ranges to see who can connect [OK]
Common Mistakes:
  • Assuming all IPs can connect
  • Confusing source-ranges with destination
  • Ignoring firewall rule specificity
4. You created a custom subnet in GCP but your VM instances cannot reach the internet. What is the most likely cause?
medium
A. The VM instances have static internal IPs.
B. Firewall rules allow all outbound traffic.
C. The subnet is set to auto mode.
D. No Cloud NAT or external IP assigned to the VM instances.

Solution

  1. Step 1: Understand internet access requirements

    VMs in custom subnets need either external IPs or Cloud NAT to access the internet.
  2. Step 2: Identify missing component

    If VMs lack external IPs and no Cloud NAT is configured, they cannot reach the internet.
  3. Final Answer:

    No Cloud NAT or external IP assigned to the VM instances. -> Option D
  4. Quick Check:

    Internet access needs NAT or external IP [OK]
Hint: Check if VMs have external IP or Cloud NAT [OK]
Common Mistakes:
  • Assuming firewall rules block outbound by default
  • Confusing auto and custom subnet modes
  • Thinking static internal IPs block internet
5. You want to design a GCP network architecture that isolates sensitive workloads but allows secure communication between them and public-facing services. Which advanced networking features should you combine?
hard
A. Assign public IPs to all VMs and disable firewall rules.
B. Use a single auto mode VPC with no firewall rules.
C. Use separate custom VPCs with VPC peering and firewall rules to control traffic.
D. Use default network and rely on default firewall rules.

Solution

  1. Step 1: Identify isolation and secure communication needs

    Separate VPCs isolate workloads; VPC peering allows controlled communication.
  2. Step 2: Apply firewall rules for traffic control

    Firewall rules restrict and allow only needed traffic between workloads and public services.
  3. Final Answer:

    Use separate custom VPCs with VPC peering and firewall rules to control traffic. -> Option C
  4. Quick Check:

    Isolation + secure communication = VPC peering + firewall [OK]
Hint: Combine VPC peering and firewall rules for isolation and access [OK]
Common Mistakes:
  • Using auto mode VPCs without control
  • Assigning public IPs to sensitive workloads
  • Relying on default network without customization
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard