Prepare and test your skills

Prepare and test your skills

Free sample question with answers and detailed explanation below. The Professional Cloud Network Engineer practice bank has an additional 2,437 practice questions.Try 10 free realistic questions: instant score, no credit card, and no account required.
You are configuring a regional internal Application Load Balancer in us-west1 for api.corp.internal. You must enforce the following behaviors on one internal IP address:
port 80) traffic to HTTPS (port 443) using a 308 Permanent Redirect./v2/ and header X-Canary: true to canary-backend./v2/ HTTPS requests to v2-backend, and unmatched traffic to default-backend.Creating the second forwarding rule on the same IP fails.
Which configuration should you implement?
us-west1 with --purpose=SHARED_LOADBALANCER_VIP. Create two regional INTERNAL_MANAGED forwarding rules on this IP: port 80 pointing to a regional target HTTP proxy with a regional defaultUrlRedirect (httpsRedirect: true, PERMANENT_REDIRECT), and port 443 pointing to a regional target HTTPS proxy with a regional URL map. In that URL map, define a hostRule for api.corp.internal referencing a pathMatcher with defaultService set to default-backend, a priority: 1 routeRule containing one matchRule with both prefixMatch: /v2/ and headerMatches (X-Canary: true) to canary-backend, and a priority: 2 routeRule matching prefixMatch: /v2/ to v2-backend.A regional internal Application Load Balancer (INTERNAL_MANAGED) distributes Layer 7 HTTP(S) traffic within a region using regional forwarding rules, regional target HTTP(S) proxies, regional URL maps (regionUrlMaps), and regional backend services. Supporting both HTTP-to-HTTPS redirection and attribute-based traffic steering on one virtual IP requires coordinating forwarding rule IP sharing with ordered routeRules evaluation.
--purpose=SHARED_LOADBALANCER_VIP allows multiple regional INTERNAL_MANAGED forwarding rules with unique ports (80 and 443) to share the same IP address.308 Permanent Redirect: The port 80 forwarding rule directs HTTP traffic to a regional target HTTP proxy and a regional URL map configured with defaultUrlRedirect (httpsRedirect: true and redirectResponseCode: PERMANENT_REDIRECT), returning an HTTP 308 response that preserves the request method.prefixMatch: /v2/ and headerMatches (X-Canary: true) inside a single matchRule creates a logical AND condition, ensuring only /v2/ requests carrying that exact header match the canary rule.priority: 1 to the canary rule and priority: 2 to the general /v2/ rule ensures the more specific rule is evaluated first, while unmatched paths fall through to the defaultService (default-backend).routeRules support path prefixes, HTTP headers, query parameters, traffic splitting, and rewrites without deploying intermediate proxy tiers.This design satisfies every regional scope constraint, forwarding rule sharing requirement, logical AND matching semantic, and numerical priority ordering rule required for accurate traffic redirection.
us-west1 without --purpose=SHARED_LOADBALANCER_VIP and attach two regional INTERNAL_MANAGED forwarding rules on ports 80 and 443 to separate HTTP redirect and HTTPS target proxies. In the HTTPS URL map's pathMatcher for api.corp.internal, configure a priority: 1 routeRule to canary-backend with two separate matchRules entries—one specifying prefixMatch: /v2/ and another specifying headerMatches (X-Canary: true)—followed by a priority: 2 routeRule for /v2/ to v2-backend.This option separates ports 80 and 443 onto two regional forwarding rules and places the canary routeRule at priority: 1 ahead of the general /v2/ rule at priority: 2, but omits --purpose=SHARED_LOADBALANCER_VIP and splits the match criteria across two matchRules blocks.
--purpose=SHARED_LOADBALANCER_VIP. Using a standard internal IP reservation causes creation of the second forwarding rule on the same IP to fail.matchRules: When a routeRule contains multiple matchRules entries, the rule triggers if a request matches any of those entries (logical OR). Separating prefixMatch: /v2/ and headerMatches into two distinct matchRules causes every /v2/ request (even without X-Canary: true) and every X-Canary: true request (on any path, such as /v1/) to route to canary-backend, starving v2-backend.matchRule: All criteria inside one matchRule object (path, headers, and query parameters) must be satisfied simultaneously for that matchRule to match.--purpose=SHARED_LOADBALANCER_VIP, which supports sharing across regional internal Application Load Balancers.priority: 1 is evaluated first, an overly broad OR match intercepts traffic before priority: 2 is reached.The regional internal IP address were reserved with --purpose=SHARED_LOADBALANCER_VIP, and both prefixMatch: /v2/ and headerMatches (X-Canary: true) were combined inside a single matchRule entry within the priority: 1 routeRule.
us-west1 with --purpose=SHARED_LOADBALANCER_VIP and create a single regional INTERNAL_MANAGED forwarding rule specifying --ports=80,443 pointing to a regional target HTTPS proxy. In the regional URL map's pathMatcher for api.corp.internal, configure pathRules routing /v2/* to v2-backend alongside a routeRule matching headerMatches (X-Canary: true) to canary-backend, with defaultUrlRedirect set to PERMANENT_REDIRECT and default-backend as the defaultService.This option attempts to consolidate HTTP and HTTPS handling into a single forwarding rule with --ports=80,443 and combine simple pathRules with advanced routeRules inside the same pathMatcher.
1 to 65535. Specifying --ports=80,443 on one INTERNAL_MANAGED forwarding rule is invalid, and a target HTTPS proxy cannot serve plaintext HTTP traffic on port 80 to issue redirects.pathMatcher cannot contain both pathRules and routeRules. Simple host/path routing (pathRules) and advanced traffic management (routeRules) are strictly mutually exclusive modes.pathMatcher cannot simultaneously define defaultUrlRedirect and defaultService to handle unmatched HTTPS traffic, as redirects and backend routing are mutually exclusive primary actions.80 to a target HTTP proxy and one for port 443 to a target HTTPS proxy) sharing a SHARED_LOADBALANCER_VIP address.routeRules: Simple pathRules only inspect URL paths and cannot evaluate HTTP headers such as X-Canary.308 redirect, while the HTTPS URL map performs backend routing.Separate single-port regional forwarding rules were created for port 80 (target HTTP proxy with a redirect URL map) and port 443 (target HTTPS proxy with a routing URL map), and the HTTPS pathMatcher used routeRules exclusively without pathRules or defaultUrlRedirect.
us-west1 with --purpose=SHARED_LOADBALANCER_VIP. Create a global internal forwarding rule on port 80 pointing to a global HTTP redirect URL map, and a regional INTERNAL_MANAGED forwarding rule on port 443 pointing to a regional routing URL map. In the regional pathMatcher, configure routeRules with priority: 1 for prefixMatch: /v2/ to v2-backend and priority: 2 for prefixMatch: /v2/ with headerMatches (X-Canary: true) to canary-backend, using default-backend as the defaultService.This option reserves a regional internal IP address with --purpose=SHARED_LOADBALANCER_VIP and attempts to separate HTTP redirection and HTTPS routing across two forwarding rules while ordering routeRules numerically inside a pathMatcher.
pathRules, which evaluate longest-path-matches-first, routeRules are evaluated strictly in ascending numerical priority order (where lower numbers have higher precedence), and evaluation stops at the first matching rule.canary-backend: Placing the broad prefixMatch: /v2/ rule at priority: 1 matches every /v2/ request—including those carrying X-Canary: true—and routes all of them to v2-backend before priority: 2 is ever evaluated.regionUrlMaps), and regional backend services.routeRule, the load balancer applies that rule's action and ignores all lower-precedence rules (higher priority numbers).routeRule within a pathMatcher must have a unique integer priority between 0 and 2147483647.Both forwarding rules were configured as regional INTERNAL_MANAGED forwarding rules referencing regional target proxies and regional URL maps, and the routeRules priorities were reversed so that the specific /v2/ + X-Canary: true rule had priority: 1 and the general /v2/ rule had priority: 2.
Answer them yourself and get your score the moment you finish. No account needed.
Full access includes
Keep the momentum going with these hand-picked practice scenarios
Last updated Validated