Google Professional Cloud Network Engineer Question 252
Single answerGoogle Cloud PlatformYou are configuring custom routes in a Google Cloud Virtual Private Cloud (VPC). You need to ensure that traffic destined to a specific subnet is routed through a custom next hop only if instances in the subnet are tagged with 'web-servers'. Additionally, this route should be prioritized over other existing routes for the same destination. How would you configure the routing rule?
- A
Assign the network tag 'web-servers' to the instances and create a route with the tag, specifying a lower priority value (e.g., 800) than other routes.
- B
Create a route with the network tag 'web-servers' and set a higher priority value (e.g., 1200) than other routes.
- C
Do not use network tags. Instead, create a route with a lower priority value (e.g., 800) and specify the next hop.
- D
Create two routes: one with the 'web-servers' tag and higher priority, and another without a tag but with a lower priority.
Show answer and explanation
Correct answer: A
Explanation
To ensure a route only applies to specific instances, you must assign network tags to those instances and create a route with the same tag. Additionally, to prioritize this route over other routes, you must set a lower priority value (higher precedence). This configuration allows precise control over which traffic uses the custom route.
- A. Correct.
Correct: Assigning the network tag to the instances and creating a route with a lower priority (higher precedence) ensures the route applies only to tagged resources and takes precedence over other routes.
- B. Incorrect.
Incorrect: Setting a higher priority value (lower precedence) would not make this route take precedence over other routes, even if the tag is applied.
- C. Incorrect.
Incorrect: Without using network tags, the route would apply to all instances in the subnet, which does not fulfill the requirement to apply the route only to tagged 'web-servers'.
- D. Incorrect.
Incorrect: Creating two routes as described is unnecessary and could lead to confusion. A single route with a tag and appropriate priority is sufficient.