Bird
Raised Fist0
GCPcloud~20 mins

Routes and routing in GCP - Practice Problems & Coding Challenges

Choose your learning style10 modes available

Start learning this pattern below

Jump into concepts and practice - no test required

or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Challenge - 5 Problems
🎖️
Routing Mastery in GCP
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding GCP Route Priorities

You have two routes in Google Cloud Platform (GCP) with the same destination range but different priorities. Route A has priority 1000 and Route B has priority 500. Which route will GCP use to send traffic to that destination?

ARoute B because it has a lower priority number.
BRoute A because it was created first.
CRoute A because it has a higher priority number.
DGCP will load balance traffic evenly between Route A and Route B.
Attempts:
2 left
💡 Hint

In GCP routing, lower priority numbers mean higher priority.

Configuration
intermediate
2:00remaining
Configuring a Custom Static Route in GCP

You want to create a static route in GCP that directs traffic destined for 10.0.0.0/16 to a specific VM instance acting as a gateway. Which next hop type should you specify in the route configuration?

ANext hop IP address
BNext hop VPN tunnel
CNext hop instance
DNext hop internet gateway
Attempts:
2 left
💡 Hint

The next hop should be the VM instance acting as the gateway.

Architecture
advanced
3:00remaining
Designing a Multi-Region Network with Custom Routes

You have two VPC networks in different regions connected via VPC peering. You want to ensure that traffic from region A to region B uses a specific firewall VM in region A as a gateway before reaching region B. Which routing approach achieves this?

ACreate a custom static route in region A VPC with next hop instance set to the firewall VM and destination range of region B's subnet.
BSet up a VPN tunnel between the two regions and route traffic through it.
CUse dynamic routing with Cloud Router to automatically route traffic through the firewall VM.
DUse default routes and rely on VPC peering to handle traffic automatically.
Attempts:
2 left
💡 Hint

Custom static routes can direct traffic through specific instances.

security
advanced
3:00remaining
Impact of Routes on Firewall Security in GCP

You have a firewall rule allowing traffic from subnet A to subnet B. However, traffic is still blocked. You discover a route that sends subnet B traffic through a different gateway that blocks the traffic. What is the best way to fix this routing issue to allow traffic flow?

ADisable the firewall rule and rely on routes to control traffic.
BIncrease the priority of the firewall rule to override the route.
CDelete the conflicting route that sends traffic through the blocking gateway.
DCreate a new route with a lower priority number that directs traffic through the correct gateway.
Attempts:
2 left
💡 Hint

Routes with lower priority numbers take precedence.

service_behavior
expert
3:00remaining
Behavior of GCP Routes with Overlapping Destination Ranges

You have two routes in GCP with overlapping destination IP ranges: Route X with destination 10.0.0.0/16 and priority 1000, and Route Y with destination 10.0.0.0/24 and priority 1100. A VM sends traffic to IP 10.0.0.50. Which route will GCP use and why?

ARoute X because it has a lower priority number.
BRoute Y because it has a more specific destination range.
CRoute X because it was created first.
DRoute Y because it has a higher priority number.
Attempts:
2 left
💡 Hint

GCP prefers the most specific route regardless of priority.

Practice

(1/5)
1. What is the main purpose of a route in Google Cloud Platform networking?
easy
A. To create virtual machines
B. To store data in the cloud
C. To direct network traffic from one place to another
D. To monitor network usage

Solution

  1. Step 1: Understand what routes do in networking

    Routes tell network traffic where to go, like a map for data packets.
  2. Step 2: Identify the correct purpose in GCP context

    In GCP, routes guide traffic between subnets, VMs, and external networks.
  3. Final Answer:

    To direct network traffic from one place to another -> Option C
  4. Quick Check:

    Routes guide traffic = C [OK]
Hint: Routes always guide traffic flow in networks [OK]
Common Mistakes:
  • Confusing routes with storage or compute services
  • Thinking routes monitor traffic instead of directing it
  • Mixing routes with firewall rules
2. Which of the following is the correct way to specify a next hop in a GCP route configuration?
easy
A. nextHopAddress: "192.168.1.1"
B. nextHop: "192.168.1.1"
C. nextHopGateway: "192.168.1.1"
D. nextHopIp: "192.168.1.1"

Solution

  1. Step 1: Recall GCP route next hop syntax

    GCP routes use specific fields like nextHopIp to define the next hop IP address.
  2. Step 2: Match the correct field name

    Among options, only nextHopIp is valid for specifying an IP address as next hop.
  3. Final Answer:

    nextHopIp: "192.168.1.1" -> Option D
  4. Quick Check:

    Correct field for IP next hop = nextHopIp [OK]
Hint: Use nextHopIp to specify IP address next hop [OK]
Common Mistakes:
  • Using incorrect field names like nextHop or nextHopAddress
  • Confusing next hop IP with gateway name
  • Omitting quotes around IP address
3. Given the following route configuration snippet in GCP, what destination IP range will this route apply to?
{"destRange": "10.0.0.0/16", "nextHopIp": "192.168.1.1"}
medium
A. All IP addresses in 10.0.0.0 to 10.0.255.255
B. Only the IP 10.0.0.0
C. All IP addresses in 192.168.1.0/24
D. All IP addresses in 0.0.0.0/0

Solution

  1. Step 1: Understand CIDR notation 10.0.0.0/16

    The /16 means the first 16 bits are fixed, covering IPs from 10.0.0.0 to 10.0.255.255.
  2. Step 2: Identify the destination range

    The destRange field defines the IP range this route applies to, which is 10.0.0.0/16 here.
  3. Final Answer:

    All IP addresses in 10.0.0.0 to 10.0.255.255 -> Option A
  4. Quick Check:

    10.0.0.0/16 covers 10.0.0.0-10.0.255.255 [OK]
Hint: CIDR /16 covers 65,536 IPs starting at base address [OK]
Common Mistakes:
  • Thinking /16 means only one IP
  • Confusing nextHopIp with destination range
  • Assuming 0.0.0.0/0 means local subnet
4. You created a route with destination range 0.0.0.0/0 but forgot to specify a next hop. What will happen when you try to deploy this route?
medium
A. The route will fail to create due to missing next hop
B. The route will be created and direct traffic to the internet automatically
C. The route will create but traffic will be dropped silently
D. The route will create and send traffic to the default gateway

Solution

  1. Step 1: Recall route requirements in GCP

    Every route must have a destination and a next hop to know where to send traffic.
  2. Step 2: Understand deployment validation

    Without a next hop, GCP rejects the route creation because it cannot route traffic properly.
  3. Final Answer:

    The route will fail to create due to missing next hop -> Option A
  4. Quick Check:

    Missing next hop causes creation failure [OK]
Hint: Routes need next hop or gateway to deploy [OK]
Common Mistakes:
  • Assuming route auto-assigns next hop
  • Thinking route silently drops traffic
  • Confusing route creation with firewall rules
5. You want to route all traffic destined for 10.1.0.0/24 subnet through a VM instance with IP 192.168.5.10. Which route configuration is correct?
hard
A. {"destRange": "192.168.5.10/24", "nextHopIp": "10.1.0.0"}
B. {"destRange": "10.1.0.0/24", "nextHopIp": "192.168.5.10"}
C. {"destRange": "10.1.0.0/24", "nextHopGateway": "192.168.5.10"}
D. {"destRange": "0.0.0.0/0", "nextHopIp": "10.1.0.0"}

Solution

  1. Step 1: Identify destination subnet to route

    The destination subnet is 10.1.0.0/24, so destRange must be this value.
  2. Step 2: Specify next hop as VM IP

    The next hop should be the VM's IP 192.168.5.10, using nextHopIp field.
  3. Step 3: Validate correct JSON structure

    {"destRange": "10.1.0.0/24", "nextHopIp": "192.168.5.10"} correctly sets destRange and nextHopIp with proper values and syntax.
  4. Final Answer:

    {"destRange": "10.1.0.0/24", "nextHopIp": "192.168.5.10"} -> Option B
  5. Quick Check:

    Destination subnet + VM IP next hop = {"destRange": "10.1.0.0/24", "nextHopIp": "192.168.5.10"} [OK]
Hint: Destination subnet in destRange, VM IP in nextHopIp [OK]
Common Mistakes:
  • Swapping destination and next hop IPs
  • Using nextHopGateway instead of nextHopIp for VM IP
  • Setting wrong destination range