Google Professional Cloud Network Engineer Question 266
Single answerGoogle Cloud PlatformYou are designing a network architecture for a retail company that requires traffic from specific virtual machines in a Google Cloud project to take a different route to an on-premises data center instead of using the default internet route. The company wants to implement this routing policy without modifying the application code or the default routes in the subnet. Which approach should you use to achieve this requirement?
- A
Use a VPC firewall rule to redirect traffic from the specific virtual machines to the preferred route.
- B
Configure a route with a higher priority in the subnet to direct traffic to the on-premises data center.
- C
Implement policy-based routing by using a Virtual Machine (VM) tag and a route with a next hop to a VPN tunnel.
- D
Modify the default route in the VPC to point to the on-premises data center.
Show answer and explanation
Correct answer: C
Explanation
To implement policy-based routing in Google Cloud, you can use VM tags to create custom routes that apply only to specific virtual machines. This allows you to selectively route traffic to a different next hop, such as a VPN tunnel, without modifying the default routes or application code. This approach meets the company's requirement for directing traffic from specific VMs to the on-premises data center.
- A. Incorrect.
VPC firewall rules are used to allow or deny traffic based on IP addresses, port ranges, and protocols, but they cannot redirect traffic to a specific route. This is not a valid solution for policy-based routing.
- B. Incorrect.
Configuring a route with higher priority in the subnet can direct traffic to a specific destination, but it cannot selectively route traffic from specific virtual machines. This approach does not meet the requirement for policy-based routing.
- C. Correct.
Policy-based routing in Google Cloud can be implemented by using VM tags to apply custom routes. By tagging the specific virtual machines and creating a custom route with a next hop (e.g., VPN tunnel), you can achieve the desired selective routing.
- D. Incorrect.
Modifying the default route in the VPC will affect all traffic in the subnet, not just the traffic from specific virtual machines. This does not meet the requirement for selective routing.