Google Cloud Firewall Rule Practice

Unlimited Google Cloud firewall practice. Each problem gives one packet to or from a VM and six firewall rules, as plain VPC firewall rules or as a stack of policy layers: decide if the packet is allowed, then pick what decides it. A wrong answer names the slip, such as reading a higher priority number as a higher priority.

Firewall rules

Answer to see the working.

Names and addresses are invented. Every rule is enabled, and each packet starts a new connection. An ingress rule shows its source range, an egress rule its destination range. Policy rules apply to all VMs. No regional policy applies to the VM.

Google exam prep

The Professional Cloud Network Engineer exam guide lists "Configuring and managing NGFW policies and VPC Firewall rules", and the Associate Cloud Engineer exam guide lists "Managing VPC firewall rules and Cloud NGFW policies". Start with the free real exam questions, then get the full pack.

Cloud Network Engineer316 real exam questions · US$39
Free: 79 questionsGet the full pack
Associate Cloud Engineer375 real exam questions · US$39
Free: 94 questionsGet the full pack
Cloud Security Engineer376 real exam questions · US$39
Free: 94 questionsGet the full pack
Cloud Architect370 real exam questions · US$39
Free: 90 questionsGet the full pack

Firewall rules FAQ

Is a higher priority number a higher priority in Google Cloud?

No. The priority of a VPC firewall rule is an integer from 0 to 65535, and the lowest number is the highest priority. Only the highest priority rule whose other components match the traffic is applied, and conflicting rules with lower priorities are ignored.

Does a deny rule always win over an allow rule?

No. A rule with a deny action overrides another with an allow action only if the two rules have the same priority. With different priorities, an allow rule with a lower number overrides a deny rule with a higher number.

What happens when two VPC firewall rules have the same priority?

If one allows and one denies, the deny rule is enforced and the allow rule is ignored. If both have the same action the result is the same, but which rule is used is indeterminate, so this drill never shows that case.

What is the default priority of a VPC firewall rule?

1000. The range is 0 to 65535, inclusive.

What does the direction of a firewall rule mean?

Direction is from the perspective of the target. Ingress describes packets entering a network interface of a target, and egress describes packets leaving it. A rule applies to one direction only, and rules for the other direction are disregarded.

How do target tags work?

A rule with target network tags only applies to instances that have a network tag matching at least one of them. A rule with no target specification applies to all instances in the VPC network. Target specificity does not matter for priority.

What are the implied firewall rules?

If evaluation runs through every step without an explicit allow or deny, an implied action applies. For a VM network interface the implied ingress action is deny, and for egress traffic the implied action is allow.

Which firewall rules does the default network come with?

Four ingress allow rules with priority 65534: default-allow-internal (from 10.128.0.0/9, tcp:0-65535, udp:0-65535 and icmp), default-allow-ssh (tcp:22), default-allow-rdp (tcp:3389) and default-allow-icmp, the last three from 0.0.0.0/0. You can delete or modify them.

In what order are firewall policies and VPC firewall rules evaluated?

With AFTER_CLASSIC_FIREWALL, the default: hierarchical firewall policies, regional system firewall policies, VPC firewall rules, the global network firewall policy, regional network firewall policies, then the implied action. With BEFORE_CLASSIC_FIREWALL the global and regional network firewall policies come before the VPC firewall rules.

Which hierarchical firewall policy is evaluated first?

The policy associated with the organization, then the policies associated with folder ancestors, from the top-level folder down to the folder that contains the project of the VM.

What does goto_next do?

It neither allows nor denies. It stops evaluating the other rules of that policy and continues with the next step in the evaluation order. If no rule in a policy matches the traffic, Cloud NGFW uses an implied goto_next.

Why is my VPC allow rule ignored?

Check the steps that come first. In a firewall policy, allow and deny both end all rule evaluation, so a deny in the organization or folder policy stops the packet before your VPC firewall rules are evaluated.

Do I need a rule for the reply traffic?

No. VPC firewall rules are stateful: when a connection is allowed through the firewall in either direction, return traffic matching this connection is also allowed.

Sources
  • Google Cloud, VPC firewall rules: rule components, direction from the perspective of the target, priority 0 to 65535 with default 1000, the lowest number as the highest priority, deny over allow only at the same priority, the same priority and action as indeterminate, targets and target network tags, source and destination ranges, protocols and ports, the pre-populated rules of the default network, stateful rules.
  • Google Cloud, Evaluation order for firewall policies and rules: the two network firewall policy enforcement orders, the organization policy before folder policies, rules for other targets or the other direction disregarded, allow and deny ending all rule evaluation, goto_next, the implied goto_next when nothing matches, the deny rule enforced when two VPC firewall rules tie, the implied actions.
  • Google Cloud, Firewall policy rule components: unique priorities in a policy, policy rules without names, the action table, the broadest instance targets, source and destination ranges, Layer 4 configurations.
  • Google Cloud certification exam guides: Professional Cloud Network Engineer (6.2 Configuring and managing NGFW policies and VPC Firewall rules), Associate Cloud Engineer (Managing VPC firewall rules and Cloud NGFW policies), Professional Cloud Security Engineer (Configuring network perimeter controls) and Professional Cloud Architect (hierarchical firewall policy).
  • Checked 21 November 2026. The tool's own approach: problems are invented and always show six rules. Policy layers has one organization policy, one folder policy, VPC firewall rules and one global network firewall policy; no regional system or regional network firewall policy applies. Left out: security profile groups, secure tags, service accounts, source tags, disabled rules, IPv6 and load balancer targets. An independent re-solver (Python ipaddress ranges, elimination instead of sorting) agreed with the drill on 20,000 generated problems.

Checked 21 November 2026 against the Cloud Next Generation Firewall documentation and the Google Cloud certification exam guides.

More free tools

All free tools