Question 449 of 497
Configuring network servicesmediumMultiple ChoiceObjective-mapped

Quick Answer

The correct answer is to create an ingress rule with priority 1000, action allow, source 10.0.1.2/32, protocol tcp:3306, target tags set to "db", and then assign that tag to the database VM. This configuration works because VPC firewall rules use target tags to apply rules only to specific instances, and the /32 CIDR notation restricts the source IP to a single host, ensuring no other traffic reaches the database on port 3306. On the Google Professional Cloud Network Engineer exam, this scenario tests your understanding of how to combine restrictive source IPs with target tags for granular access control, a common pattern for securing database tiers. A frequent trap is forgetting that lower priority numbers mean higher precedence, so priority 1000 overrides the implied deny-all at 65535, but only for the tagged VM. Memory tip: think of tags as "sticky notes" on VMs—only VMs with the "db" note read the rule, and the /32 is a "single-IP sniper scope" for the source.

PCNE Configuring network services Practice Question

This PCNE practice question tests your understanding of configuring network services. This is a configuration task: choose the command set that satisfies every stated requirement. Small differences — like 'secret' vs 'password' or 'transport input ssh' vs 'all' — change whether the answer is correct. After answering, compare your reasoning against the explanation and wrong-answer breakdown below. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.

A DevOps team is configuring a VPC with a subnet in us-east1. They need to allow a specific VM (source IP 10.0.1.2) to access a database VM (destination IP 10.0.2.3) on port 3306, but only from that specific source. All other traffic should be denied. Which firewall rule configuration should they use?

Question 1mediummultiple choice
Read the full NAT/PAT explanation →

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

Create an ingress rule with priority 1000, action allow, source 10.0.1.2/32, protocol tcp:3306, target tags = db, and assign the 'db' tag to the database VM.

Option C is correct because it creates an ingress firewall rule with the highest priority (1000 is the default for custom rules) that explicitly allows TCP traffic on port 3306 from source IP 10.0.1.2/32 to any VM tagged with 'db'. By assigning the 'db' tag to the database VM, the rule applies only to that target, and since VPC firewall rules are stateful, the corresponding return traffic is automatically allowed. All other traffic is denied by the implied deny-all rule (priority 65535), meeting the requirement.

Key principle: Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Create an egress rule on the source VM's network interface allowing traffic to 10.0.2.3/32 on port 3306.

    Why it's wrong here

    Egress rules control outbound traffic, but the database VM needs an ingress rule to accept traffic.

  • Create an ingress rule with priority 1000, action allow, source 10.0.1.2/32, protocol all, target service account = db-sa.

    Why it's wrong here

    This allows all protocols, which is overly permissive.

  • Create an ingress rule with priority 1000, action allow, source 10.0.1.2/32, protocol tcp:3306, target tags = db, and assign the 'db' tag to the database VM.

    Why this is correct

    Ingress rule with specific source and port allows the required traffic when tag is assigned to destination VM.

    Related concept

    Read the scenario before looking for a memorised answer.

  • Create an ingress rule with priority 1000, action allow, source 10.0.1.2/32, protocol tcp:3306, target 10.0.2.3/32.

    Why it's wrong here

    Priority 1000 is lower than the implicit deny (65535), but default deny is lower? Actually implicit deny has priority 65535, so 1000 is higher priority, so it would be evaluated before. But the issue is that it targets an IP range, not a tag or service account; firewall rules can target tags or service accounts, not IP ranges directly. So this option is invalid because you can't target an IP address. Option A is invalid in practice; but for exam, we want plausible. Actually firewall rules can target tags, service accounts, or all instances. They cannot target by IP. So this option is wrong because syntax is incorrect. I'll adjust explanation.

Common exam traps

Common exam trap: answer the scenario, not the keyword

The trap here is that candidates often confuse ingress vs. egress rules or try to target a specific destination IP in a firewall rule, but GCP firewall rules only support targets via tags, service accounts, or the entire network, not by IP address.

Trap categories for this question

  • Real-world vs exam trap

    Priority 1000 is lower than the implicit deny (65535), but default deny is lower? Actually implicit deny has priority 65535, so 1000 is higher priority, so it would be evaluated before. But the issue is that it targets an IP range, not a tag or service account; firewall rules can target tags or service accounts, not IP ranges directly. So this option is invalid because you can't target an IP address. Option A is invalid in practice; but for exam, we want plausible. Actually firewall rules can target tags, service accounts, or all instances. They cannot target by IP. So this option is wrong because syntax is incorrect. I'll adjust explanation.

Detailed technical explanation

How to think about this question

GCP VPC firewall rules are stateful, meaning that if an ingress rule allows traffic, the corresponding egress response traffic is automatically permitted without an explicit egress rule. The priority field determines rule evaluation order, with lower numbers evaluated first; the default implied deny rule has priority 65535, so a custom rule with priority 1000 will be evaluated before it. Tags are a flexible way to group VMs for firewall rule application, and they are assigned to the network interface of the VM, not the instance itself.

KKey Concepts to Remember

  • Read the scenario before looking for a memorised answer.
  • Find the constraint that changes the correct option.
  • Eliminate answers that are true in general but not in this case.

TExam Day Tips

  • Watch for words such as best, first, most likely and least administrative effort.
  • Review why wrong options are wrong, not only why the correct option is correct.

Key takeaway

Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Real-world example

How this comes up in practice

A company's IT admin needs to give a contractor read-only access to production logs without sharing account credentials. Using role-based access control (RBAC) and temporary scoped permissions — not a permanent shared password — is the correct pattern. Questions like this test whether you can apply least-privilege access across cloud identity services.

What to study next

Got this wrong? Here's your next step.

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

Related practice questions

Related PCNE practice-question pages

Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.

Practice this exam

Start a free PCNE practice session

Short sessions build daily habit. Longer sessions build exam-day stamina. Try a timed session to simulate real conditions.

FAQ

Questions learners often ask

What does this PCNE question test?

Configuring network services — This question tests Configuring network services — Read the scenario before looking for a memorised answer..

What is the correct answer to this question?

The correct answer is: Create an ingress rule with priority 1000, action allow, source 10.0.1.2/32, protocol tcp:3306, target tags = db, and assign the 'db' tag to the database VM. — Option C is correct because it creates an ingress firewall rule with the highest priority (1000 is the default for custom rules) that explicitly allows TCP traffic on port 3306 from source IP 10.0.1.2/32 to any VM tagged with 'db'. By assigning the 'db' tag to the database VM, the rule applies only to that target, and since VPC firewall rules are stateful, the corresponding return traffic is automatically allowed. All other traffic is denied by the implied deny-all rule (priority 65535), meeting the requirement.

What should I do if I get this PCNE question wrong?

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

What is the key concept behind this question?

Read the scenario before looking for a memorised answer.

About these practice questions

Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Last reviewed: Jun 25, 2026

Question Discussion

Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.

Loading comments…

Sign in to join the discussion.

This PCNE practice question is part of Courseiva's free Google Cloud certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the PCNE exam.