Prepare and test your skills

Prepare and test your skills

Apply Network Tags for Granular Traffic Control is the use of labels on virtual machine (VM) instances to control which custom static routes apply to which VMs. A static route (opens in a new tab) in a Virtual Private Cloud (VPC) network defines a destination range, a next hop, and a priority, and each route belongs to exactly one VPC network. By default a route without tags applies broadly to all VMs in its network, while a route with network tags applies only to VMs that carry matching tags. This lets one VPC network carry different forwarding paths for different workloads.
How Network Tags Select Which VMs Use a Route is the link between the tags field on a route and tags on VM instances. To limit a route, you add the tags field when you create the route with the console, gcloud compute routes create, or the routes.insert API. Traffic leaving a VM is checked against that tag list, so only VMs with a listed tag send matching packets to that route's destination and next hop. You can use tags with any custom static route, including internet, instance, VPN tunnel, and load balancer next hops.
Exam tip: A static route without network tags applies to all VMs in the VPC network, while a static route with network tags applies only to VMs with a matching tag.
Isolated Traffic Patterns With Tagged Routes are separate forwarding paths for different VM groups that share the same VPC network and often the same subnet. Tagged routes create isolation because each tagged group can have its own destination range and next hop. For example, VMs tagged egress-inet can receive a default destination 0.0.0.0/0 with a next hop to the internet, while other VMs in the same network follow a different route to a private destination. The route name must still be unique in the project, and priority still decides between overlapping destinations, but tags decide which VMs see each option.
| Route type | Applies to | Resulting behavior |
|---|---|---|
| Route without network tags | All VMs in the VPC network | All VMs use the same destination and next hop for that destination |
| Route with network tags | Only VMs carrying one of the listed tags | Only tagged VMs use that destination and next hop; other VMs are unaffected |
Directing Tagged Traffic Through Specialized Appliances is a pattern that sends traffic from only tagged VMs through a security or inspection VM before it continues to its destination. The tagged static route points to the appliance as its next hop, so packets flow from the tagged VM to the appliance and then onward toward the destination, while untagged VMs bypass the appliance entirely. This pattern keeps inspection, firewalling, or address translation centralized without forcing all VMs through the same device.
Tagged appliance routes can use these next hops:
nextHopInstance delivers packets to a VM instance's network interface, specified by instance name and zonenextHopIp delivers packets to the IP address of an existing instance in the same VPC networknextHopIlb delivers packets to an internal passthrough Network Load Balancer forwarding rule, which then distributes packets to backend appliance VMsChoose an instance or IP next hop when one appliance VM should receive the flow, and choose the load balancer next hop when several appliance VMs share the load behind one forwarding rule.
Analyze Routing Logic and Conflict Resolution is the evaluation of how the Virtual Private Cloud (VPC) routing table chooses the next hop for traffic leaving a VM. The Virtual Private Cloud (VPC) (opens in a new tab) routing table is defined at the VPC network level, and each VM instance has a controller that stays informed of all applicable routes. When a packet leaves a VM, the controller delivers the packet to the next hop of the applicable route chosen by the routing order.
How the VPC Routing Table Selects a Route is a two-level decision that compares destination specificity first and numerical priority second. Destination specificity means how closely a route destination matches the destination IP address of the packet, with the longest and most exact match winning. Only when two or more applicable routes have the same destination does numerical priority decide, with the higher-priority route winning.
A decision tree showing how the VPC routing table picks a next hop: packet destination is first matched against subnet routes, then the most specific static or dynamic destination is chosen, and only among identical destinations does numerical priority decide the winning next hop.
Subnet Routes and Destination Specificity are the rules that protect paths to resources inside the VPC network, such as VMs and internal load balancers. Each subnet has at least one subnet route whose destination matches the primary IP range of that subnet. Subnet routes always have the most specific destinations in the table, so they cannot be overridden by other routes even if another route is configured with a higher priority.
Exam tip: Destination specificity beats priority — a more specific route always wins over a higher-priority but less-specific route.
Priority, Overlap, and Multiple Paths describe how administrator-created custom static routes resolve conflicts and share traffic. Custom static routes direct some packets to specific destinations, such as a network appliance VM, VPN tunnel, or internet gateway. When custom static routes overlap with the same destination prefix, priority controls conflict resolution and traffic distribution. Routes configured with the same priority distribute traffic across the next hops using 5-tuple hash-based Equal-Cost Multi-Path (ECMP), while routes configured with different priorities create a preferred path and a redundant backup path. By default a static route applies globally to all VMs in the VPC network regardless of region, but administrators can narrow which VMs use the route by applying instance tags when the route is created.
Identify Essential Route Components and Next-Hop Specifications is the definition of the identity, placement, matching, ordering, and forwarding fields that make up a static route. A static route (opens in a new tab) in a Virtual Private Cloud (VPC) is a manual rule that directs packets to a specific next destination. The route is bound to exactly one VPC network, matches traffic by destination address, and forwards that traffic to a next hop resource that must exist and be reachable from that network.
Route Network, Destination, and Identity are the fields that attach a static route to one network and define which packets it matches. The VPC network setting means traffic flows from sources inside that one network to the configured next hop, and the same route does not apply to other networks. The destination and name fields identify and scope the rule within the project.
0.0.0.0/0 as the broadest IPv4 destination and ::/0 as the broadest IPv6 destination.In auto mode VPC networks, do not create custom static routes with destinations inside 10.128.0.0/9. That range holds automatically created subnets, and a static route inside it can be disabled unexpectedly when a new region adds a new automatic subnet route.
Priority and Network Tags control which static route wins and which virtual machine (VM) instances use it. Priority orders competing routes to the same destination, while network tags limit a route to only select VMs. Together they let one VPC network use different paths for different workloads. Priority uses numbers from 0 to 65,535, where a lower number means a higher priority. A route with priority 0 is the highest possible priority and is chosen before a route with priority 1000, and a route with priority 65,535 is the lowest possible priority. Network tags apply the route only to VMs that carry one or more matching tags, so untagged VMs ignore the route and tagged VMs send matching packets to its next hop.
Exam tip: Lower priority numbers win in VPC static routes — 0 is highest priority and 65,535 is lowest priority.
Next-Hop Specifications are the forwarding targets that identify the network resource to which packets are sent. All next-hop types support IPv4 destinations, and some next-hop types support IPv6 destinations. Traffic flows from the sending VM to the selected next hop, and the next hop then forwards traffic toward the destination range.
| Next-hop type | Sends packets to | Key requirement |
|---|---|---|
| Internet gateway | Internet and Google APIs and services | Use the default internet gateway for the project |
| VM instance | Network interface of a specific VM instance | Specify instance name and zone; for an IPv6 destination, the instance must be dual-stack or IPv6-only |
| Instance IP address | IP address of an existing instance in the VPC network | Address must belong to an existing instance; for IPv6 routes, the instance must be dual-stack or IPv6-only |
| Classic VPN tunnel | Existing Classic VPN tunnel using static routing | Tunnel must already exist; the route remains even if the tunnel is not running |
| Internal passthrough Network Load Balancer | Forwarding rule of an internal passthrough Network Load Balancer | Specify forwarding rule name and region; the IP version of the forwarding rule must match the IP version of the route |
A Classic VPN tunnel next hop in another region adds outbound data transfer cost and latency because regional distance is not considered, so same-region placement is preferred when possible. An internal passthrough Network Load Balancer next hop requires IP version alignment, so an IPv4 route must point to an IPv4 forwarding rule and an IPv6 route must point to an IPv6 forwarding rule.
A static route without network tags applies to all virtual machine (VM) instances in its Virtual Private Cloud (VPC) network, while a static route with network tags applies only to VMs carrying a matching tag. Traffic leaving a VM is checked against the tags field on the route, so only VMs with a listed tag send matching packets to that route destination and next hop.
The Virtual Private Cloud (VPC) routing table selects a route by destination specificity first and numerical priority second. The longest and most exact destination match wins, and only routes with the same destination are ordered by priority where 0 is the highest priority and 65535 is the lowest priority.
No, a custom static route cannot override a subnet route in the same Virtual Private Cloud (VPC) network. Each subnet has at least one subnet route whose destination matches the primary IP range of that subnet, and subnet routes always have the most specific destinations so they cannot be overridden even by another route with higher priority.
An internal passthrough Network Load Balancer next hop should be used when several appliance virtual machine (VM) instances share the load behind one forwarding rule, while a VM instance or instance IP address next hop should be used when one appliance VM should receive the flow. The load balancer next hop requires specifying the forwarding rule name and region, and the IP version of the forwarding rule must match the IP version of the route.
Your company has deployed a third-party network security appliance on a Compute Engine virtual machine (VM) in a Virtual Private Cloud (VPC) network. You need to ensure that outbound internet traffic from a specific group of backend database VMs is routed through this appliance for deep packet inspection, while all other VMs in the VPC continue to use the standard default internet gateway route.
What should you do?
Last updated