Question

Difficulty: HardDeploying Virtual Private Cloud (VPC) Networks, Subnets, and Firewall Rules

An enterprise network team is provisioning infrastructure within a custom-mode Virtual Private Cloud (VPC) named `corp-vpc` that connects to an on-premises network operating on 10.100.0.0/1610.100.0.0/16. The requirement is to deploy a new subnet `us-east-subnet` in region `us-east1` and configure firewall rules allowing inbound SSH traffic from the on-premises range exclusively to instances tagged with `secure-bastion`. This inbound SSH rule must override a broad network-wide SSH block rule currently set with a priority of 1000.

Which TWO configuration choices or CLI operations are correct to implement this requirement? (Select TWO)

  1. Execute `gcloud compute networks subnets create us-east-subnet --network=corp-vpc --region=us-east1 --range=10.1.0.0/24` to provision the regional custom subnet.Answer
  2. Assign a numerical priority value less than 1000 (such as 500) to the targeted SSH allow firewall rule.Answer
  3. C
    Assign a numerical priority value greater than 1000 (such as 2000) to the targeted SSH allow firewall rule so it evaluates after the default block rule.
  4. D
    Execute `gcloud compute networks subnets create us-east-subnet --network=corp-vpc --region=us-east1 --range=10.100.0.0/24` to match the on-premises IP prefix.

Answer

To successfully deploy the hybrid subnet and ensure the custom ingress rule takes effect, create the subnet with a non-overlapping CIDR range (10.1.0.0/2410.1.0.0/24) and configure the targeted SSH allow firewall rule with a priority value lower than 1000 (e.g., 500).
Google Cloud VPC firewall rule evaluation follows strict numerical ordering from 0 (highest precedence) to 65535 (lowest precedence). Therefore, setting a priority number less than 1000 ensures the targeted SSH allow rule is applied before the network-wide deny rule. Additionally, subnets created in custom VPC networks must use CIDR ranges that do not overlap with existing connected infrastructure such as on-premises networks.

Step-by-Step Solution

1
Select a non-overlapping IP address range for the new custom subnet.
Using range 10.1.0.0/2410.1.0.0/24 avoids CIDR collision with the on-premises 10.100.0.0/1610.100.0.0/16 space, enabling proper routing across hybrid connections.
VPC subnet ranges cannot overlap with peered or hybrid network ranges.
2
Provision the custom subnet using gcloud CLI.
The command specifying `--network=corp-vpc`, `--region=us-east1`, and `--range=10.1.0.0/24` successfully creates `us-east-subnet`.
Custom-mode VPC networks require explicit subnet creation with defined regional CIDR parameters.
3
Determine the correct priority value for the firewall rule override.
Selecting a priority value of 500 ensures evaluation ahead of the rule with priority 1000.
GCP evaluates firewall rules sequentially starting from priority 0 up to 65535; lower numbers have higher precedence.

Key Concept

VPC Firewall Priority Precedence and Hybrid Subnet CIDR Planning
Rate this question