Bitzu

Associate Cloud Engineer ยท Managing network resources

How does a VPC choose between several routes for one packet?

Routes, priority, next hop options, tags on routes, default route to the internet gateway, route precedence.

Key points

  • First keep routes whose destination contains the packet's address and that apply to the VM (a route with a network tag applies only to VMs with that tag).
  • Most specific destination wins: /24 beats /16 beats the 0.0.0.0/0 default route to the internet gateway.
  • Priority (lower number wins) only separates routes of equal specificity.
  • Static route next hop: a VM, internal passthrough load balancer or VPN tunnel.

Source: https://docs.cloud.google.com/vpc/docs/routes

Practice questions

Single choice

What is the next hop of the system-generated default route in a new VPC network?

  1. The default internet gateway
  2. The first VM created in the network
  3. A Cloud Router in the nearest region
  4. The Cloud NAT gateway of the project
Show answer

Answer: A. The default internet gateway

The default route 0.0.0.0/0 points at the default internet gateway. It can be deleted or replaced, and it is used only when no more specific route matches.

Select all that apply

Which can be used as the next hop of a custom static route?

  1. A Compute Engine VM instance
  2. An internal passthrough Network Load Balancer
  3. A Cloud VPN tunnel
  4. A VPC firewall rule
  5. A Cloud DNS managed zone
Show answer

Answer: A. A Compute Engine VM instance, B. An internal passthrough Network Load Balancer, C. A Cloud VPN tunnel

Static routes can point to a VM instance, an internal passthrough Network Load Balancer or a Cloud VPN tunnel. A firewall rule is a filter, not a forwarding target, and a DNS zone only resolves names.

True or false

True or false: a route with priority 1 always overrides a route with a more specific destination but priority 1000.

Show answer

Answer: False

False. Specificity is evaluated first; priority only breaks ties between routes with the same destination specificity.

Practice 8 questions on this topic in Bitzu

Short lessons, instant explanations and spaced review of what you get wrong. Free on iOS and Android.

Download on the App StoreGet it on Google Play

More Associate Cloud Engineer topics in this module