Soru

Zorluk: OrtaDeploying Virtual Private Cloud (VPC) Networks, Subnets, and Firewall Rules

A cloud engineer is deploying a custom-mode Virtual Private Cloud (VPC) network named `corp-vpc` for an enterprise environment. The requirements state that custom subnets must be created manually, and an ingress firewall rule named `allow-internal-admin` must allow SSH access (TCP port 22) exclusively to virtual machine instances carrying the target network tag `admin-node` from the internal IP subnet range `10.10.1.0/24`.

Which TWO `gcloud` commands or command options must be executed to meet these requirements? (Select TWO)

  1. Execute `gcloud compute networks create corp-vpc --subnet-mode=custom` to initialize the VPC network without automatic subnet creation.Cevap
  2. Execute `gcloud compute firewall-rules create allow-internal-admin --network=corp-vpc --allow=tcp:22 --source-ranges=10.10.1.0/24 --target-tags=admin-node` to allow SSH ingress.Cevap
  3. C
    Execute `gcloud compute networks create corp-vpc --subnet-mode=auto` and convert the subnets to custom mode after creation.
  4. D
    Execute `gcloud compute firewall-rules create allow-internal-admin --network=corp-vpc --allow=tcp:22 --source-tags=10.10.1.0/24 --target-ranges=admin-node --priority=65535` to give the allow rule highest evaluation precedence.

Cevap

Creating the VPC network using the `--subnet-mode=custom` flag and defining the firewall rule using `--source-ranges=10.10.1.0/24` with `--target-tags=admin-node` fulfills both custom subnet and network filtering requirements.
To deploy a custom VPC network, `--subnet-mode=custom` must be passed during creation to prevent default subnets from being generated. For the ingress firewall rule, `--source-ranges` correctly specifies the allowed IP block `10.10.1.0/24`, and `--target-tags` restricts the destination to instances tagged with `admin-node`.

Adım Adım Çözüm

1
Identify the VPC creation requirement
The network must be instantiated with `--subnet-mode=custom` so that subnets are not automatically created in every region.
Auto-mode networks create default regional subnets automatically, whereas custom mode allows manual subnet definition.
2
Identify the firewall parameter mapping for gcloud CLI
Map the IP CIDR `10.10.1.0/24` to `--source-ranges` and the network tag `admin-node` to `--target-tags`.
`--source-ranges` expects IP CIDR notations, while `--target-tags` applies the firewall rule to instances with matching network tags.
3
Evaluate firewall priority and rule parameters
Priority 65535 is the lowest precedence, and swapping tags with ranges results in command syntax/logical errors.
GCP evaluates lower priority numbers first (priority 0 to 65354 for user rules), so priority 65535 is reserved for default lowest-precedence rules.

Anahtar Kavram

Deployment of Custom VPC Networks and Ingress Firewall Rule Parameters in Google Cloud
Bu soruyu puanla