Ngân hàng đề — Google Cloud Professional Cloud Network Engineer
Tìm thấy 247 câu.
- A Create a firewall rule in each VPC at priority 500 that targets all instances in the network and denies egress to the internet, 0.0.0.0/0. Create a firewall rule at priority 300 that targets all instances in the network, has a source filter that maps to the allowed subnets, and allows egress to the internet, 0.0.0.0/0. Deploy Cloud NAT, and configure all primary and secondary subnet source ranges.
- B Create a constraints/compute.restrictCloudNATUsage organizational policy constraint. Attach the constraint to a folder that contains the associated projects. Configure the allowedValues to only contain the subnets that should have internet access. Deploy Cloud NAT and select only the allowed subnets.
- C Create a firewall rule in each VPC at priority 500 that targets all instances in the network and denies egress to the internet, 0.0.0.0/0. Create a firewall rule at priority 300 that targets all instances in the network, has a source filter that maps to the allowed subnets, and allows egress to the internet, 0.0.0.0/0. Deploy Cloud NAT, and configure a custom source range that includes the allowed subnets.
- D Deploy Cloud NAT in each VPC, and configure a custom source range that includes the allowed subnets. Configure Cloud NAT rules to only permit the allowed subnets to egress through Cloud NAT.
Xem giải thích
🧩 Phân tích nội dung câu hỏi
Câu hỏi mô tả tình huống bạn có nhiều máy ảo (VMs) nằm trong nhiều VPC khác nhau trên môi trường Google Cloud (GCP), và các VMs này cần truy cập outbound ra internet nhưng không được phép có public IP do chính sách bảo mật. Giải pháp là sử dụng Cloud NAT để cung cấp NAT outbound. Mỗi VPC có nhiều subnet ở các region khác nhau, và bạn chỉ muốn cho phép một số subnet cụ thể truy cập internet qua Cloud NAT. Yêu cầu chính là tránh lỗi cấu hình vô ý từ các admin khác và tuân thủ best practices của Google.
📌 Mục tiêu cốt lõi: Kiểm soát chặt chẽ việc sử dụng Cloud NAT chỉ cho các subnet được phép, ở mức organization/folder/project để enforce policy, không dựa vào cấu hình thủ công dễ bị thay đổi.
✅ Đáp án đúng
Create a constraints/compute.restrictCloudNATUsage organizational policy constraint. Attach the constraint to a folder that contains the associated projects. Configure the allowedValues to only contain the subnets that should have internet access. Deploy Cloud NAT and select only the allowed subnets.
Lý do chọn đáp án này 🛠️:
- Đây là cách Google-recommended để restrict Cloud NAT chỉ cho các subnet cụ thể, sử dụng Organizational Policy (Org Policy) với constraint
compute.restrictCloudNATUsage. Policy này cho phép liệt kê chính xác các subnet (qua tên hoặc CIDR) trongallowedValues, ngăn chặn việc attach Cloud NAT vào subnet không mong muốn ở mức organization/folder/project. - Tránh "unintentional configuration issues" vì policy enforce tự động, không ai có thể deploy Cloud NAT cho subnet ngoài danh sách mà không violate policy.
- Khi deploy Cloud NAT, chỉ select các subnet allowed, hoàn hảo align với best practices (NAT gateway attach VPC và chọn subnet ranges cụ thể).
- Cập nhật mới nhất (GCP 2026): Constraint này hỗ trợ granular control subnets/regions, tích hợp IAM/Org Policy mới.
📘 Tài liệu tham khảo: Cloud NAT documentation, Org Policy constraints/compute.restrictCloudNATUsage.
❌ Giải thích tất cả các phương án
Dưới đây là phân tích chi tiết từng lựa chọn, giữ nguyên văn bản gốc bằng tiếng Anh. Tôi đánh dấu ✅ đúng hoặc ❌ sai, kèm lý do cụ thể bằng tiếng Việt:
-
[SAI] Create a firewall rule in each VPC at priority 500 that targets all instances in the network and denies egress to the internet, 0.0.0.0/0. Create a firewall rule at priority 300 that targets all instances in the network, has a source filter that maps to the allowed subnets, and allows egress to the internet, 0.0.0.0/0. Deploy Cloud NAT, and configure all primary and secondary subnet source ranges.
❌ Sai vì: Firewall rules chỉ control traffic flow (allow/deny packets), không kiểm soát việc routing qua Cloud NAT hoặc attach NAT vào subnet cụ thể. Priority 300/500 có thể block/allow egress nhưng không ngăn deploy NAT cho tất cả subnets (vẫn config "all primary and secondary ranges" → không restrict). Dễ bị admin khác override rules, không align best practices. Không giải quyết "unintentional issues" ở mức org. -
[ĐÚNG] Create a constraints/compute.restrictCloudNATUsage organizational policy constraint. Attach the constraint to a folder that contains the associated projects. Configure the allowedValues to only contain the subnets that should have internet access. Deploy Cloud NAT and select only the allowed subnets.
✅ Đúng vì: (Như phần đáp án đúng ở trên) 🏆 Hoàn hảo enforce ở mức organization, granular control subnets, tránh lỗi config và tuân thủ Google practices. -
[SAI] Create a firewall rule in each VPC at priority 500 that targets all instances in the network and denies egress to the internet, 0.0.0.0/0. Create a firewall rule at priority 300 that targets all instances in the network, has a source filter that maps to the allowed subnets, and allows egress to the internet, 0.0.0.0/0. Deploy Cloud NAT, and configure a custom source range that includes the allowed subnets.
❌ Sai vì: Tương tự phương án 1, firewall không control NAT attachment/routing. "Custom source range" chỉ định ranges cho NAT translation (không phải restrict subnets nào dùng NAT). Vẫn phải config thủ công mỗi VPC, dễ bị thay đổi bởi admin khác, không scalable cho multi-VPC/multi-region, và không dùng Org Policy để enforce. -
[SAI] Deploy Cloud NAT in each VPC, and configure a custom source range that includes the allowed subnets. Configure Cloud NAT rules to only permit the allowed subnets to egress through Cloud NAT.
❌ Sai vì: Cloud NAT không có "rules" để permit/deny subnets (khác với Firewall Rules). Chỉ config NAT bằng cách chọn subnets/ranges khi tạo gateway (primary/secondary IP ranges của subnet). "Custom source range" chỉ map IP pools cho NAT, không restrict VMs/subnets nào route qua NAT. Phải deploy riêng từng VPC (không scalable), dễ bị admin khác thêm subnets, không tránh "unintentional issues" và vi phạm best practices.
🏅 Kết luận & Best Practices
✅ Sử dụng Org Policy là giải pháp tối ưu cho multi-project/VPC, kết hợp Cloud NAT selective subnets. Tránh firewall hack vì tách biệt NAT routing và traffic policy. Nếu cần scale, dùng Terraform/IaC với policy enforcement! 🚀
- A Create a full mesh of VPC Network Peering connections between all five VPCs. Make sure not to import or export subnet routes with public IP addresses. Add Cloud network firewall policy rules to allow traffic.
- B Create a Network Connectivity Center hub with a mesh topology. Add a VPC spoke for each of the five VPCs and configure an export exclude filter for 240.0.0.0/4. Add Cloud network firewall policy rules to allow traffic.
- C Create a series of multiple network interface VMs with an interface in each VPPlace the VMs in an instance group. Create an internal passthrough Network Load Balancer in each VPC with the backend of the instance group. Configure custom static routes in each VPC with the next hop of the respective load balancer. Add Cloud network firewall policy rules to allow traffic.
- D Create a full mesh of VPC Network Peering connections between all five VPCs with an export exclude filter for 240.0.0.0/4 on every side. Add Cloud network firewall policy rules to allow traffic.
Xem giải thích
🧩 Phân tích chi tiết nội dung câu hỏi
Câu hỏi mô tả một tổ chức Google Cloud có 5 VPC khác nhau thuộc các project khác nhau trong cùng một organization. Các VPC này cần kết nối high-throughput (thông lượng cao) giữa nhau. Sau khi audit IP, phát hiện hai subnet overlapping giữa hai VPC: 240.0.0.0/16 và 240.128.0.0/24. Những subnet này thuộc Class E (240.0.0.0/4), và không cần kết nối inter-VPC cho bất kỳ Class E subnet nào, nhưng tất cả subnet khác trong các VPC đều cần kết nối.
Yêu cầu: Triển khai Google Cloud routing solution để đáp ứng connectivity, xử lý overlapping mà không ảnh hưởng đến các route cần thiết.
🔍 Thách thức chính:
- VPC Network Peering thông thường không hỗ trợ overlapping CIDRs (các dải IP chồng chéo), dẫn đến route conflict.
- Cần giải pháp scale cao, high-throughput, hỗ trợ multi-project, và filter route để exclude Class E (240.0.0.0/4).
- Phải thêm Cloud Network Firewall policy rules để kiểm soát traffic.
📘 Nguồn tham khảo:
- Google Cloud Network Connectivity Center Documentation (cập nhật 2024-2026: hỗ trợ mesh topology và export filters).
- VPC Peering limitations (không hỗ trợ overlapping CIDRs).
- Cloud Armor & Firewall Policies.
✅ Đáp án đúng và lý do lựa chọn
Đáp án đúng:
Create a Network Connectivity Center hub with a mesh topology. Add a VPC spoke for each of the five VPCs and configure an export exclude filter for 240.0.0.0/4. Add Cloud network firewall policy rules to allow traffic.
Lý do:
🛠️ Network Connectivity Center (NCC) là giải pháp chuẩn của Google Cloud (ra mắt đầy đủ từ 2023, cập nhật mesh topology đến 2026) cho hub-and-spoke hoặc mesh connectivity giữa nhiều VPC/multi-project. Nó hỗ trợ overlapping CIDRs bằng cách sử dụng export exclude filters để loại trừ route Class E (240.0.0.0/4), đảm bảo chỉ route các subnet cần thiết.
- Mesh topology: Tạo kết nối full-mesh logic mà không cần peering thủ công, high-throughput (lên đến 100 Gbps+ per hub).
- VPC spokes: Dễ attach 5 VPC, scale tốt.
- Firewall rules: Bổ sung để secure traffic.
Giải pháp này tối ưu, managed, không cần appliance VM, phù hợp yêu cầu "Google Cloud routing solution".
📋 Giải thích tất cả các phương án (đúng/sai)
-
❌ [SAI] Create a full mesh of VPC Network Peering connections between all five VPCs. Make sure not to import or export subnet routes with public IP addresses. Add Cloud network firewall policy rules to allow traffic.
Lý do sai: VPC Network Peering không hỗ trợ overlapping CIDRs (như 240.0.0.0/16 và 240.128.0.0/24), dẫn đến route conflict và peering thất bại. Chỉ "not import/export public IP routes" không giải quyết overlapping private CIDRs. Full-mesh với 5 VPC cần 10 peering (O(n²)), khó quản lý multi-project. -
✅ [ĐÚNG] Create a Network Connectivity Center hub with a mesh topology. Add a VPC spoke for each of the five VPCs and configure an export exclude filter for 240.0.0.0/4. Add Cloud network firewall policy rules to allow traffic.
Lý do đúng: Như phân tích ở trên. NCC hoàn hảo xử lý overlapping qua export exclude filter (loại trừ 240.0.0.0/4), mesh topology cho full connectivity, high-throughput, và tích hợp firewall. Scale tốt cho 5+ VPC/multi-project (cập nhật 2026: hỗ trợ global hubs). -
❌ [SAI] Create a series of multiple network interface VMs with an interface in each VPC. Place the VMs in an instance group. Create an internal passthrough Network Load Balancer in each VPC with the backend of the instance group. Configure custom static routes in each VPC with the next hop of the respective load balancer. Add Cloud network firewall policy rules to allow traffic.
Lý do sai: Đây là giải pháp third-party appliance (multi-NIC VMs + ILB + static routes), phức tạp, không phải "Google Cloud routing solution" managed, tốn kém (VMs luôn chạy), throughput thấp hơn NCC, khó scale cho 5 VPC. Không tận dụng native services như NCC. -
❌ [SAI] Create a full mesh of VPC Network Peering connections between all five VPCs with an export exclude filter for 240.0.0.0/4 on every side. Add Cloud network firewall policy rules to allow traffic.
Lý do sai: Dù có export exclude filter, VPC Peering vẫn không hỗ trợ overlapping CIDRs cơ bản (peering check primary CIDRs trước). Filter chỉ ảnh hưởng custom routes, không fix conflict subnet routes. Full-mesh vẫn phức tạp cho multi-project.
🔥 Kết luận: NCC là best practice cho scenarios này (theo Google Cloud Well-Architected Framework 2026). Nếu triển khai, test với gcloud network-connectivity hubs describe để verify filters! 🚀
log name: …/logs/cloud.googleapis.com%2Fipsec_events"
type: "vpn_gateway"
textPayload: "received NO_PROPOSAL_CHOSEN notify, no CHILD_SA built"
You need to troubleshoot the VPN failure and take corrective action based on the Cloud Logging entries. What should you do?
- A Update the Google Cloud BGP session configuration to match the BGP peer ASN on the on-premises side.
- B Compare and review the Phase 2 settings on the on-premises firewall. Make sure the settings match one of the supported cipher suites for HA VPN.
- C Create a new Cloud VPN gateway in a region closer to the peer VPN gateway.
- D Compare the Phase 1 settings and recreate the Cloud VPN tunnel by choosing a different IKE version and pre-shared key.
Xem giải thích
🧩 Phân tích chi tiết nội dung câu hỏi
Câu hỏi mô tả tình huống thiết lập HA VPN (High Availability VPN) giữa Google Cloud và mạng on-premises, nhưng kết nối VPN không thành công. Các triệu chứng chính bao gồm:
- Google Cloud Console hiển thị: "Negotiation failure" (thất bại trong quá trình đàm phán IKE/IPsec) và "BGP is down" (phiên BGP không hoạt động).
- Kiểm tra Cloud Logging với query
resource.type="vpn_gateway" and resource.labels.gateway_id="TUNNEL_ID_NUMBER", phát hiện log thường xuyên:- Log name:
…/logs/cloud.googleapis.com%2Fipsec_events - Type: "vpn_gateway"
- textPayload: "received NO_PROPOSAL_CHOSEN notify, no CHILD_SA built".
- Log name:
📝 Ý nghĩa log:
- "NO_PROPOSAL_CHOSEN" là thông báo IKEv2 từ peer (on-premises firewall) cho biết không chọn được proposal phù hợp cho Phase 2 (IPsec CHILD_SA - Security Association con cho dữ liệu mã hóa).
- Điều này xảy ra sau khi Phase 1 (IKE SA) có thể đã thành công một phần, nhưng Phase 2 thất bại do không khớp cipher suites (bộ mã hóa, như encryption algorithms, hash, DH groups, v.v.).
- BGP down là hậu quả vì tunnel VPN chưa up, không truyền được BGP updates.
🎯 Mục tiêu: Khắc phục sự cố dựa trên log, với quyền admin đầy đủ trên GCP và on-premises firewalls.
✅ Đáp án đúng và lý do lựa chọn
Đáp án đúng: Compare and review the Phase 2 settings on the on-premises firewall. Make sure the settings match one of the supported cipher suites for HA VPN.
Lý do 🛠️:
- Log rõ ràng chỉ ra vấn đề ở Phase 2 negotiation (CHILD_SA không build được do NO_PROPOSAL_CHOSEN).
- HA VPN trên GCP yêu cầu Phase 2 settings phải khớp chính xác với các cipher suites được hỗ trợ (theo docs GCP mới nhất 2024-2026: IKEv2 policy với encryption như AES_128_GCM/AES_256_GCM, integrity như SHA256_128, DH groups 19/20/21, v.v.).
- Hành động: So sánh và điều chỉnh Phase 2 trên on-premises (encryption, hash, PFS, lifetime) để khớp GCP → tunnel up, BGP hoạt động.
📋 Giải thích tất cả các phương án (đúng/sai)
-
[ĐÚNG] Compare and review the Phase 2 settings on the on-premises firewall. Make sure the settings match one of the supported cipher suites for HA VPN.
✅ Đúng vì: Log "NO_PROPOSAL_CHOSEN" và "no CHILD_SA built" trực tiếp chỉ vấn đề mismatch Phase 2 cipher suites. GCP HA VPN chỉ hỗ trợ các suite cụ thể (không custom), phải khớp on-premises để CHILD_SA thiết lập thành công. (Cập nhật 2026: GCP vẫn giữ policy cố định cho HA VPN over IKEv2). -
[SAI] Update the Google Cloud BGP session configuration to match the BGP peer ASN on the on-premises side.
❌ Sai vì: BGP down là hậu quả của VPN tunnel chưa up (negotiation failure). Không thể fix BGP trước khi tunnel hoạt động. ASN mismatch chỉ ảnh hưởng sau khi tunnel up, không liên quan log Phase 2. -
[SAI] Create a new Cloud VPN gateway in a region closer to the peer VPN gateway.
❌ Sai vì: Vấn đề là negotiation failure ở protocol layer (IKE/IPsec), không phải latency địa lý. Di chuyển region chỉ ảnh hưởng performance sau khi tunnel up, không fix được mismatch cipher suites. -
[SAI] Compare the Phase 1 settings and recreate the Cloud VPN tunnel by choosing a different IKE version and pre-shared key.
❌ Sai vì: Log về CHILD_SA (Phase 2), không phải Phase 1 (IKE SA). Nếu Phase 1 fail, sẽ không có notify Phase 2. PSK/IKE version (GCP mặc định IKEv2) chỉ liên quan Phase 1; Phase 2 mới cần check cipher.
📘 Tài liệu tham khảo (cập nhật mới nhất đến 2026)
- GCP Docs - VPN Troubleshooting: Troubleshoot Cloud VPN tunnels → Phần "IKE negotiation errors" giải thích NO_PROPOSAL_CHOSEN = Phase 2 mismatch.
- Cloud Logging cho VPN: VPN logging → Query chính xác như câu hỏi.
- HA VPN supported ciphers: HA VPN cipher suites → Danh sách Phase 1/2 suites (AES-GCM, SHA-256, DH 19-21).
- Best Practices 2026: Sử dụng Classic HA VPN hoặc External VPN với IKEv2 policy matcher cho on-premises (không thay đổi core logic).
Hy vọng phân tích này giúp bạn nắm vững! 🚀 Nếu cần demo config, hỏi thêm nhé!
- A Review the Service YAML file. Add a new path rule for the * character that directs to the base service. Reapply the YAML.
- B Review the Ingress YAML file. Add a new path rule for the * character that directs to the base service. Reapply the YAML.
- C Review the Ingress YAML file. Define the default backend. Reapply the YAML.
- D Review the Service YAML file. Define a default backend. Reapply the YAML.
Xem giải thích
🧩 Phân tích chi tiết nội dung câu hỏi
Câu hỏi mô tả tình huống trong Google Kubernetes Engine (GKE) trên Google Cloud Platform (GCP):
- Đội ngũ đã triển khai hai ứng dụng trong GKE và expose chúng qua external Application Load Balancer (cụ thể là HTTP(S) Load Balancer được tạo tự động từ Ingress).
- Các truy vấn đến www.mountkirkgames.com/sales và www.mountkirkgames.com/get-an-analysis hiển thị đúng trang (tức là các path cụ thể đã được route chính xác đến các backend services tương ứng).
- Tuy nhiên, truy cập root domain www.mountkirkgames.com (không có path cụ thể, tức path "/") trả về lỗi 404 Not Found.
- Yêu cầu: Khắc phục lỗi này một cách hiệu quả nhất.
Nguyên nhân gốc rễ 📘: Trong GKE Ingress (dựa trên Kubernetes Ingress resource), Load Balancer chỉ route traffic đến các path rule cụ thể được định nghĩa. Nếu không có quy tắc cho path gốc "/" hoặc default backend, request đến root domain sẽ không match bất kỳ rule nào, dẫn đến 404. Giải pháp cần chỉnh sửa Ingress YAML để xử lý default traffic.
(Lưu ý: Chủ đề thực tế là GCP/GKE, không phải AWS như đề cập ban đầu. Kiến thức dựa trên tài liệu GCP cập nhật đến 2026, Ingress vẫn giữ nguyên cơ chế default backend từ phiên bản GKE 1.27+ với Anthos Service Mesh hỗ trợ.)
✅ Đáp án đúng và lý do lựa chọn
Đáp án đúng: Review the Ingress YAML file. Define the default backend. Reapply the YAML.
Lý do 🛠️:
- Ingress YAML là file định nghĩa routing rules cho Load Balancer trong GKE, bao gồm host, paths và backends.
- Default backend (backend mặc định) được sử dụng để xử lý tất cả traffic không match bất kỳ path rule cụ thể nào, bao gồm root path "/".
- Bằng cách thêm
defaultBackendvào Ingress spec (ví dụ: trỏ đến một Service xử lý trang chủ), Load Balancer sẽ route root domain đến backend đó thay vì 404. Sau đókubectl applyđể áp dụng thay đổi. - Đây là giải pháp chuẩn và hiệu quả nhất theo best practices GCP, không cần tạo rule phức tạp.
Ví dụ YAML snippet (để minh họa):
apiVersion: networking.k8s.io/v1
kind: Ingress
spec:
defaultBackend:
service:
name: homepage-service # Service cho root page
port:
number: 80
rules:
- host: www.mountkirkgames.com
http:
paths:
- path: /sales
pathType: Prefix
backend:
service:
name: sales-service
port: {number: 80}
# Các path khác...
📋 Giải thích tất cả các phương án (đúng/sai)
Dưới đây là phân tích từng lựa chọn một, giữ nguyên văn bản gốc tiếng Anh. Mỗi phương án được đánh giá với lý do chi tiết bằng tiếng Việt:
-
❌ [SAI] Review the Service YAML file. Add a new path rule for the * character that directs to the base service. Reapply the YAML.
Lý do sai 🚫: Service YAML chỉ định nghĩa Service resource (clusterIP, ports, selectors), không hỗ trợ path rules hay wildcard "". Path routing thuộc về Ingress, không phải Service. Thêm "" vào Service sẽ gây lỗi YAML validation hoặc không có tác dụng. -
❌ [SAI] Review the Ingress YAML file. Add a new path rule for the * character that directs to the base service. Reapply the YAML.
Lý do sai 🚫: Mặc dù chỉnh Ingress YAML là đúng hướng, nhưng wildcard "*" không phải syntax chuẩn cho path rule trong GKE Ingress (dùngpathType: Prefixvới "/" hoặc exact match). Wildcard "*" chỉ dùng trong một số Ingress controller khác (như NGINX), không phải GCP Load Balancer Ingress. Sử dụng sẽ không match root và có thể gây conflict. -
✅ [ĐÚNG] Review the Ingress YAML file. Define the default backend. Reapply the YAML.
Lý do đúng 🟢: Như đã giải thích ở trên, đây là cách chính xác và được GCP khuyến nghị để handle unmatched traffic (bao gồm root "/"). Default backend áp dụng toàn cục cho host, giải quyết 404 mà không ảnh hưởng các path hiện có. -
❌ [SAI] Review the Service YAML file. Define a default backend. Reapply the YAML.
Lý do sai 🚫: Service YAML không có khái niệm "default backend". Default backend chỉ tồn tại trong Ingress spec để chỉ định fallback Service. Chỉnh Service sẽ không ảnh hưởng đến Load Balancer routing.
📚 Tài liệu tham khảo
- GCP Docs - Ingress Features: https://cloud.google.com/kubernetes-engine/docs/concepts/ingress#default_backend (cập nhật 2025-2026, hỗ trợ GKE 1.29+).
- Kubernetes Ingress API: https://kubernetes.io/docs/concepts/services-networking/ingress/#default-backend.
- GKE Troubleshooting 404: https://cloud.google.com/kubernetes-engine/docs/troubleshooting#ingress_404.
Hy vọng phân tích này giúp bạn nắm vững! 🚀 Nếu cần demo YAML đầy đủ, hãy cho biết thêm chi tiết.
- A Enable regional dynamic routing mode on the VPC. Configure BGP associated with the HA VPN in "region 1" to use a base priority value of 100. Configure BGP associated with the VAN attachments to use a base priority of 20000. Configure your on-premises routers to use similar multi exit discriminator (MED) values.
- B Enable regional dynamic routing mode on the VPC. Configure BGP associated with the HA VPN in "region 1" to use a base priority value of 20000. Configure BGP associated with the VLAN attachments to use a base priority of 100. Configure your on-premises routers to use similar multi exit discriminator (MED) values.
- C Enable global dynamic routing mode on the VPConfigure BGP associated with the HA VPN in "region 1" to use a base priority value of 20000. Configure BGP associated with the VLAN attachments to use a base priority of 100. Configure your on-premises routers to use similar multi exit discriminator (MED) values.
- D Enable global dynamic routing mode on the VPC. Configure BGP associated with the HA VPN in "region 1" to use a base priority value of 100. Configure BGP associated with the VLAN attachments to use a base priority of 20000. Configure your on-premises routers to use similar multi exit discriminator (MED) values.
Xem giải thích
🧩 Giải thích chi tiết nội dung câu hỏi
Câu hỏi này thuộc lĩnh vực mạng lưới trên Google Cloud Platform (GCP), cụ thể là về thiết lập kết nối hybrid giữa VPC đa vùng (multi-region VPC) và mạng nội bộ doanh nghiệp (corporate network).
- Bối cảnh: Bạn có một VPC với phạm vi toàn cầu (global scope VPC) đã cấu hình HA VPN (High Availability VPN) lâu dài ở region 1 để kết nối với mạng corporate. Bây giờ, bạn muốn thêm hai kết nối Dedicated Interconnect 10 Gbps cùng VLAN attachments ở region 2 để kết nối với cùng mạng corporate đó.
- Yêu cầu chính: Đảm bảo lưu lượng (traffic) từ VPC đến corporate network ưu tiên sử dụng Dedicated Interconnect làm đường dẫn chính (primary path) và HA VPN làm đường dẫn phụ (secondary path). Điều này đòi hỏi sử dụng dynamic routing qua BGP (Border Gateway Protocol) trên Cloud Router để kiểm soát ưu tiên đường dẫn.
- Các yếu tố kỹ thuật quan trọng:
- GCP hỗ trợ hai chế độ dynamic routing cho VPC: regional (riêng biệt từng vùng) và global (toàn cầu, phù hợp multi-region).
- Base priority trong BGP: Giá trị thấp hơn = ưu tiên cao hơn (lower value = higher preference).
- Cần cấu hình tương ứng trên router on-premises với MED (Multi-Exit Discriminator) để đồng bộ.
Mục tiêu là chọn cấu hình đúng để Interconnect (priority cao) được ưu tiên hơn HA VPN (priority thấp). 🛤️
✅ Đáp án đúng và lý do lựa chọn
Đáp án đúng: Enable global dynamic routing mode on the VPC. Configure BGP associated with the HA VPN in "region 1" to use a base priority value of 20000. Configure BGP associated with the VLAN attachments to use a base priority of 100. Configure your on-premises routers to use similar multi exit discriminator (MED) values.
Lý do:
- Global dynamic routing mode ✅: Bắt buộc cho VPC đa vùng (multi-region), vì regional mode chỉ xử lý intra-region, không chia sẻ route toàn cầu giữa region 1 và region 2 (theo tính năng GCP từ 2021, cập nhật đến 2026 vẫn giữ nguyên).
- Base priority: VLAN attachments (Interconnect) = 100 (cao ưu tiên, primary), HA VPN = 20000 (thấp ưu tiên, secondary) → Đúng thứ tự (low value = preferred).
- MED trên on-premises ✅: Đồng bộ để router corporate ưu tiên route từ GCP theo cùng logic.
- Kết quả: Traffic tự động chọn Interconnect primary, fallback sang HA VPN. Hoàn hảo cho HA hybrid connectivity! 🎯
📋 Phân tích tất cả các phương án (đúng/sai)
-
[SAI] Enable regional dynamic routing mode on the VPC. Configure BGP associated with the HA VPN in "region 1" to use a base priority value of 100. Configure BGP associated with the VAN attachments to use a base priority of 20000. Configure your on-premises routers to use similar multi exit discriminator (MED) values.
❌ Sai vì:- Regional mode không hỗ trợ route sharing giữa region 1 (HA VPN) và region 2 (VLAN attachments) → Traffic không thể failover đúng.
- Priority ngược: HA VPN 100 (primary, sai), VLAN 20000 (secondary, sai yêu cầu).
- "VAN attachments" có lẽ là lỗi đánh máy của "VLAN", nhưng không ảnh hưởng. Không đạt primary/secondary.
-
[SAI] Enable regional dynamic routing mode on the VPC. Configure BGP associated with the HA VPN in "region 1" to use a base priority value of 20000. Configure BGP associated with the VLAN attachments to use a base priority of 100. Configure your on-premises routers to use similar multi exit discriminator (MED) values.
❌ Sai vì:- Priority đúng (VLAN 100 primary, HA VPN 20000 secondary), MED đồng bộ tốt.
- Nhưng regional mode thất bại ở multi-region: Route không propagate global, traffic từ region 1 không biết đường region 2. Cần global mode!
-
[ĐÚNG] Enable global dynamic routing mode on the VPConfigure BGP associated with the HA VPN in "region 1" to use a base priority value of 20000. Configure BGP associated with the VLAN attachments to use a base priority of 100. Configure your on-premises routers to use similar multi exit discriminator (MED) values.
✅ Đúng hoàn toàn (như giải thích ở trên). Global mode + priority đúng + MED → Traffic ưu tiên Interconnect primary, HA VPN backup. Lý tưởng cho setup HA! -
[SAI] Enable global dynamic routing mode on the VPC. Configure BGP associated with the HA VPN in "region 1" to use a base priority value of 100. Configure BGP associated with the VLAN attachments to use a base priority of 20000. Configure your on-premises routers to use similar multi exit discriminator (MED) values.
❌ Sai vì:- Global mode đúng cho multi-region.
- Nhưng priority ngược: HA VPN 100 (primary, sai), VLAN 20000 (secondary, trái yêu cầu). Traffic sẽ dùng VPN trước, Interconnect sau → Không đáp ứng!
📘 Tài liệu tham khảo (cập nhật đến 2026)
- GCP Docs - Dynamic Routing Modes: Cloud Router global/regional modes (xác nhận global cho multi-region).
- BGP Priorities & MED: Partner Interconnect BGP config và HA VPN BGP (base priority range 0-65535, low=high pref).
- Hybrid Connectivity Best Practices: Multi-region HA design (2024 update, vẫn áp dụng 2026).
- Console CLI:
gcloud compute networks update-vpc --routing-mode=global.
Hy vọng phân tích giúp bạn nắm vững! 🚀 Nếu cần demo lab, hỏi nhé! 🛠️
•There should be no communication possible between production and non-production en-vironments.
•Communication between applications within an environment may be necessary.
•Network administrators should centrally manage all network resources, including subnets, routes, and firewall rules.
•Each application should be billed separately.
•Developers of an application within a project should have the autonomy to create their compute resources. They should not create or modify networking resources.
•Up to 1000 applications are expected per environment.
You need to create a design that accommodates these requirements. What should you do?
- A Create a design that has one Shared VPC host project for the production environment, and another Shared VPC host project for the nonproduction environment. Associate the various applications' service projects with the corresponding environment's host project.
- B Create a design that has a Shared VPC for each project. Implement hierarchical firewall policies to apply micro-segmentation between VPCs.
- C Create a design that implements a single Shared VPUse VPC firewall rules with secure tags to enforce micro-segmentation between environments.
- D Create a design where each project in each environment has its own VPC with its own subnets, routes, and firewall rules. Ensure all VPCs are added as spokes to a Network Connectivity Center hub.
Xem giải thích
🧩 Phân tích chi tiết nội dung câu hỏi
Câu hỏi này thuộc chủ đề thiết kế landing zone architecture trên Google Cloud Platform (GCP) (không phải AWS như đề cập ban đầu, vì các khái niệm như Shared VPC, host project, service projects là đặc trưng của GCP). Tổ chức cần một kiến trúc mạng đáp ứng các yêu cầu nghiêm ngặt sau:
- Không cho phép giao tiếp giữa môi trường production (prod) và non-production (non-prod): Đảm bảo sự cô lập hoàn toàn giữa hai môi trường để tránh rủi ro bảo mật.
- Cho phép giao tiếp giữa các ứng dụng (applications) trong cùng một môi trường: Các app trong prod có thể giao tiếp với nhau, tương tự cho non-prod.
- Quản trị viên mạng (network administrators) quản lý tập trung tất cả tài nguyên mạng: Bao gồm subnets, routes, và firewall rules – không phân tán quyền quản lý.
- Mỗi ứng dụng được tính phí (billed) riêng biệt: Yêu cầu tách biệt billing theo từng app.
- Nhà phát triển (developers) của ứng dụng trong một project chỉ có quyền tự chủ tạo tài nguyên compute (như VM): Nhưng không được tạo hoặc sửa đổi tài nguyên mạng (subnets, routes, firewalls).
- Dự kiến lên đến 1000 ứng dụng mỗi môi trường: Kiến trúc phải scalable cao.
Mục tiêu: Thiết kế mạng accommodates (đáp ứng đầy đủ) các yêu cầu này, ưu tiên Shared VPC để quản lý tập trung và cô lập môi trường. Kiến thức dựa trên phiên bản GCP mới nhất (2024-2026), với Shared VPC hỗ trợ hàng nghìn service projects và Hierarchical Firewall Policies cho central management. 📘 Tài liệu tham khảo:
✅ Đáp án đúng và lý do lựa chọn
Đáp án đúng: Create a design that has one Shared VPC host project for the production environment, and another Shared VPC host project for the nonproduction environment. Associate the various applications' service projects with the corresponding environment's host project.
Lý do chi tiết 🛠️:
- Cô lập môi trường: Hai host projects riêng biệt (một cho prod, một cho non-prod) với hai Shared VPC độc lập → Không thể giao tiếp giữa prod/non-prod (không shared network space).
- Giao tiếp nội bộ môi trường: Các service projects (mỗi app một project) attach vào host project tương ứng → Apps trong cùng môi trường chia sẻ subnets/routes/firewalls, cho phép giao tiếp.
- Quản lý tập trung: Network admins chỉ quản lý tại host projects (subnets, routes, firewall rules) → Service projects không thể tạo/modify network (constraints IAM và org policies ngăn chặn).
- Billing riêng: Mỗi app là service project riêng → Billing tách biệt theo project.
- Autonomy cho devs: Devs chỉ tạo compute (VMs) trong service project, sử dụng subnets từ host → Không chạm vào network.
- Scalable: Shared VPC hỗ trợ lên đến hàng nghìn service projects (chính thức >1000), phù hợp 1000 apps/env.
- Hoàn hảo match tất cả yêu cầu! 🚀
📋 Giải thích tất cả các phương án (đúng/sai)
-
Phương án đúng ✅:
Create a design that has one Shared VPC host project for the production environment, and another Shared VPC host project for the nonproduction environment. Associate the various applications' service projects with the corresponding environment's host project.
(Giải thích đã nêu ở trên – lý tưởng cho central management và isolation). -
Phương án sai ❌:
Create a design that has a Shared VPC for each project. Implement hierarchical firewall policies to apply micro-segmentation between VPCs.
Lý do sai: "Shared VPC for each project" mâu thuẫn khái niệm (Shared VPC yêu cầu một host project chia sẻ cho nhiều service projects, không phải mỗi project là host riêng). Dẫn đến phân tán quản lý (mỗi project tự quản VPC), vi phạm central management. Hierarchical firewall chỉ áp dụng intra-org, không giải quyết billing riêng hay devs autonomy hoàn chỉnh. Không scalable cho 1000 apps (quá nhiều host projects). 🧨 -
Phương án sai ❌:
Create a design that implements a single Shared VPUse VPC firewall rules with secure tags to enforce micro-segmentation between environments.
Lý do sai: (Lưu ý: Có lỗi type "VPUse" → single Shared VPC). Single Shared VPC cho tất cả env → Không cô lập hoàn toàn prod/non-prod (cùng address space, chỉ rely firewall/tags – dễ bypass, không "no communication possible"). Firewall rules/tags không đủ mạnh cho isolation tuyệt đối; devs có thể vô tình ảnh hưởng. Billing OK nhưng vi phạm yêu cầu no comm giữa env và central management dễ bị leak. Không phù hợp landing zone best practices. 🔒 -
Phương án sai ❌:
Create a design where each project in each environment has its own VPC with its own subnets, routes, and firewall rules. Ensure all VPCs are added as spokes to a Network Connectivity Center hub.
Lý do sai: Mỗi project own VPC → Decentralized management (devs phải tạo/modify subnets/routes/firewalls trong project → vi phạm "network admins centrally manage" và "devs not create networking"). NCC hub chỉ connect VPCs (tạo connectivity giữa env → phá vỡ isolation prod/non-prod). Không scalable (1000 VPCs/project = chaos), billing OK nhưng không central. NCC (trước là Hub-and-Spoke) không thay thế Shared VPC cho shared subnets. 🌐
- A Create a new Cloud Armor backend security policy, and use the --network-src-asns parameter.
- B Create a new Cloud Armor network edge security policy, and use the --network-src-asns parameter.
- C Create a new Cloud Armor edge security policy, and use the --network-src-asns parameter.
- D Create a new firewall policy ingress rule, and use the --network-src-asns parameter.
Xem giải thích
🧩 Phân tích nội dung câu hỏi
Câu hỏi tập trung vào việc bảo mật các Compute Engine instances trong Google Cloud Platform (GCP) đang được expose trực tiếp ra public internet. Mỗi instance có một network interface duy nhất với public IP, nghĩa là chúng có thể nhận kết nối trực tiếp từ internet mà không qua bất kỳ load balancer nào. Yêu cầu là chặn mọi kết nối (connection attempt) từ các client internet có IP thuộc BGP ASN cụ thể (BGP_ASN_TOBLOCK).
🛠️ Chi tiết kỹ thuật:
- BGP ASN (Autonomous System Number) là số định danh cho các mạng lớn trên internet, giúp xác định nguồn gốc traffic từ các nhà cung cấp như ISP lớn.
- Không dùng firewall thông thường vì VPC Firewall Rules chỉ hỗ trợ chặn dựa trên IP/CIDR, không hỗ trợ ASN trực tiếp.
- Cần giải pháp Cloud Armor ở mức network edge để filter traffic L3/L4 dựa trên ASN nguồn (source ASN) ngay tại biên mạng Google, trước khi đến VM.
- Đây là tính năng Network Edge Security Policy của Cloud Armor, hỗ trợ rule matching
--network-src-asnscho traffic TCP/UDP/any protocol, áp dụng cho external load balancers hoặc trực tiếp public IPs (với IP allowlisting nếu cần).
📘 Kiến thức cập nhật (đến 2026): Tính năng Network Edge Security Policy được giới thiệu từ 2023 và cập nhật liên tục (phiên bản gcloud SDK mới nhất hỗ trợ đầy đủ ASN blocking). Không liên quan AWS (có lẽ nhầm lẫn từ người dùng), đây là GCP thuần túy.
✅ Đáp án đúng và lý do lựa chọn
Đáp án đúng: Create a new Cloud Armor network edge security policy, and use the --network-src-asns parameter.
Lý do 🧩:
- Cloud Armor Network Edge Security Policy là loại policy chuyên biệt cho traffic L3/L4 tại network edge (áp dụng cho TCP Proxy LB, UDP Proxy LB, External TCP/UDP LB, hoặc public IPs của Compute Engine).
- Parameter
--network-src-asnscho phép chặn traffic dựa trên BGP ASN nguồn (deny rule với src-asns=BGP_ASN_TOBLOCK), hiệu quả ngay biên mạng, không cần attach backend. - Đây là giải pháp chính xác, scalable cho public-facing instances mà không cần thay đổi architecture.
📋 Giải thích tất cả các phương án
Dưới đây là phân tích từng lựa chọn một cách chi tiết, giữ nguyên văn bản gốc tiếng Anh:
-
❌ Create a new Cloud Armor backend security policy, and use the --network-src-asns parameter.
Sai vì: Backend security policy chỉ áp dụng sau load balancer (attach vào backend service của HTTP(S)/TCP/UDP LB), không hoạt động ở network edge cho public IPs trực tiếp. Parameter--network-src-asnskhông được hỗ trợ ở loại policy này (chỉ cho L7 rules như IP geo/threat intel). -
✅ Create a new Cloud Armor network edge security policy, and use the --network-src-asns parameter.
Đúng vì: Như đã giải thích ở trên, đây là loại policy chính xác cho network edge filtering dựa trên ASN nguồn. Command gcloud:gcloud network-security edge-security-policies create POLICY_NAME --network-src-asns=BGP_ASN_TOBLOCK --default-rule-action=deny. Áp dụng ngay cho Compute Engine public IPs qua organization/hierarchy policy hoặc direct attach. -
❌ Create a new Cloud Armor edge security policy, and use the --network-src-asns parameter.
Sai vì: Edge security policy (hay còn gọi legacy edge policy) chỉ dành cho L7 HTTP(S) Load Balancer, tập trung vào WAF rules (request headers, geo-IP, etc.). Không hỗ trợ ASN (--network-src-asnskhông tồn tại ở đây), và không chặn được non-HTTP traffic. -
❌ Create a new firewall policy ingress rule, and use the --network-src-asns parameter.
Sai vì: GCP VPC Firewall (hierarchical/ingress rules) không hỗ trợ ASN matching (--network-src-asnskhông có trong gcloud firewall commands). Chỉ hỗ trợ IP/CIDR, tags, service accounts. Không thể block dynamic ASN mà không liệt kê hàng nghìn CIDR (không khả thi).
📘 Tài liệu tham khảo
- Cloud Armor Network Edge Security Policy Overview ✅ (Chính thức GCP, cập nhật 2024).
- Create Network Edge Security Policy 🛠️ (Hướng dẫn gcloud CLI với
--network-src-asns). - gcloud Reference: edge-security-policies 📘 (Phiên bản mới nhất hỗ trợ đến 2026).
Hy vọng phân tích này giúp bạn ôn thi chứng chỉ Professional Cloud Network Engineer! 🚀
- A Place your NVAs behind an internal passthrough Network Load Balancer named ILB1. Add the global network firewall policy rules to allow traffic through your NVAs. Create a policy-based route (PBR) with the source IP range of the backend VM subnet, destination IP range of the frontend VM subnet, and the next hop of ILB1. Scope the PBR to the VMs with the backend network tag. Add a backend network tag to your backend servers.
- B Place your NVAs behind an internal passthrough Network Load Balancer named ILB1. Add global network firewall policy rules to allow traffic through your NVAs. Create a custom static route with the destination IP range of the backend VM subnet, frontend instance tag, and the next hop of ILB1. Add a frontend network tag to your frontend VMs.
- C Create your NVA with multiple interfaces. Configure NIC0 for NVA in the backend subnet. Configure NIC1 for NVA in the frontend subnet. Place your NVAs behind an internal passthrough Network Load Balancer named ILB1. Add global network firewall policy rules to allow traffic through your NVAs. Create a custom static route with the destination IP range of the backend VM subnet, frontend instance tag, and the next hop of ILB1. Add a frontend network tag to your frontend VMs.
- D Place your NVAs behind an internal passthrough Network Load Balancer named ILB1. Add global network firewall policy rules to allow traffic through your NVAs. Create a policy-based route (PBR) with the source IP range of the frontend VM subnet, destination IP range of the backend VM subnet, and the next hop of ILB1. Scope the PBR to the VMs with the frontend network tag. Add a frontend network tag to your frontend servers.
Xem giải thích
🧩 Phân tích chi tiết câu hỏi
✅ Nội dung câu hỏi được giải thích rõ ràng:
Câu hỏi mô tả một kiến trúc mạng trong Google Cloud VPC (không phải AWS, dù đề cập liên quan – terminology như "global network firewall policy", "policy-based route (PBR)", "internal passthrough Network Load Balancer" là đặc trưng của GCP). Các máy ảo (VMs) frontend và backend database nằm trong cùng một VPC nhưng khác subnet. Hiện tại, global network firewall policy (chính sách tường lửa phân cấp toàn cục) đã cho phép traffic từ frontend VMs đến backend VMs.
Yêu cầu mới từ compliance: Traffic này phải được kiểm tra (inspected) bởi NVAs (Network Virtual Appliances) – các firewall ảo nằm trong cùng VPC. NVAs được cấu hình là full network proxies (proxy đầy đủ, thực hiện source NAT cho traffic ra).
Nhiệm vụ: Cấu hình VPC routing để NVAs có thể inspect traffic giữa các subnet frontend → backend. Giải pháp cần sử dụng internal passthrough Network Load Balancer (ILB) để định tuyến traffic qua NVAs một cách symmetric (đi và về), tận dụng Policy-Based Routes (PBR) – tính năng routing nâng cao của GCP (ra mắt từ 2023, cập nhật đến 2026 hỗ trợ tags và IP ranges linh hoạt).
🛠️ Mục tiêu chính: Định tuyến traffic từ frontend subnet → ILB1 (backend là NVAs) → backend subnet, đảm bảo NVAs inspect và NAT đúng chiều (từ source frontend).
📘 Tài liệu tham khảo:
- GCP VPC Policy-Based Routing (PBR) docs (cập nhật 2025: hỗ trợ network tags scoping).
- Internal passthrough NLB for NVAs (hỗ trợ proxy-based inspection).
- Hierarchical Firewall Policies (global rules cho NVAs).
✅ Đáp án đúng và lý do lựa chọn
Đáp án đúng: Place your NVAs behind an internal passthrough Network Load Balancer named ILB1. Add global network firewall policy rules to allow traffic through your NVAs. Create a policy-based route (PBR) with the source IP range of the frontend VM subnet, destination IP range of the backend VM subnet, and the next hop of ILB1. Scope the PBR to the VMs with the frontend network tag. Add a frontend network tag to your frontend servers.
🧩 Lý do chọn đáp án này (phù hợp phiên bản GCP 2026):
- ILB1 passthrough: Đặt NVAs sau ILB internal passthrough để load balance traffic symmetric (đi/ về cùng đường), hỗ trợ NVAs full proxy với source NAT.
- Global firewall rules: Cho phép traffic qua NVAs (ingress/egress).
- PBR chính xác: Source = frontend subnet (traffic bắt đầu từ đây), dest = backend subnet, next-hop = ILB1. Scope PBR bằng network tag trên frontend VMs → chỉ áp dụng cho traffic từ frontend VMs có tag, tránh ảnh hưởng traffic khác. Thêm tag "frontend" vào frontend servers để scoping.
- Ưu điểm: Đơn giản, scalable, không cần multi-NIC phức tạp; đảm bảo inspection full traffic frontend → backend mà không break return path (symmetric routing).
❌ Phân tích tất cả các phương án (đúng/sai)
-
🛠️ Phương án 1 (SAI): Place your NVAs behind an internal passthrough Network Load Balancer named ILB1. Add the global network firewall policy rules to allow traffic through your NVAs. Create a policy-based route (PBR) with the source IP range of the backend VM subnet, destination IP range of the frontend VM subnet, and the next hop of ILB1. Scope the PBR to the VMs with the backend network tag. Add a backend network tag to your backend servers.
❌ Lý do sai: PBR đảo chiều source/dest (source backend → dest frontend), nhưng traffic thực tế là frontend → backend. Scope tag trên backend VMs cũng sai (routing phải bắt đầu từ source frontend). Không inspect đúng traffic yêu cầu, gây asymmetric routing và mất inspection. -
🛠️ Phương án 2 (SAI): Place your NVAs behind an internal passthrough Network Load Balancer named ILB1. Add global network firewall policy rules to allow traffic through your NVAs. Create a custom static route with the destination IP range of the backend VM subnet, frontend instance tag, and the next hop of ILB1. Add a frontend network tag to your frontend VMs.
❌ Lý do sai: Static route không hỗ trợ "instance tag" scoping (static routes chỉ dựa IP ranges, không dùng tags như PBR). Không chỉ rõ source, dẫn đến apply toàn VPC/subnet thay vì selective. Không xử lý return traffic symmetric, NVAs proxy sẽ fail NAT/inspection. PBR mới hơn và phù hợp hơn static routes (GCP ưu tiên PBR từ 2024). -
🛠️ Phương án 3 (SAI): Create your NVA with multiple interfaces. Configure NIC0 for NVA in the backend subnet. Configure NIC1 for NVA in the frontend subnet. Place your NVAs behind an internal passthrough Network Load Balancer named ILB1. Add global network firewall policy rules to allow traffic through your NVAs. Create a custom static route with the destination IP range of the backend VM subnet, frontend instance tag, and the next hop of ILB1. Add a frontend network tag to your frontend VMs.
❌ Lý do sai: Multi-NIC phức tạp không cần thiết cho ILB passthrough (GCP khuyến nghị single subnet cho NVAs với ILB). Static route vẫn sai như phương án 2 (không hỗ trợ tags). Multi-NIC gây overhead VRF/routing tables, dễ asymmetric và khó scale cho full proxy NVAs. Không khớp best practice GCP cho centralized inspection (2026 docs ưu tiên PBR + ILB).
🎯 Kết luận: Giải pháp đúng tận dụng PBR + ILB passthrough – pattern chuẩn cho NVA inspection trong GCP VPC intra-subnet traffic, đảm bảo compliance mà không downtime! 🚀
- A Create a design that uses the LOCAL_PREF BGP attribute to influence the egress path from Google Cloud to the on-premises environment.
- B Create a design that uses an equal-cost multipath (ECMP) with flow-based hashing on your on-premises devices.
- C Create a design that uses a BGP multi-exit discriminator (MED) attribute to influence the egress path from Google Cloud to the on-premises environment.
- D Create a design that uses the AS_PATH BGP attribute to influence the egress path from Google Cloud to the on-premises environment.
Xem giải thích
🧩 Giải thích chi tiết nội dung câu hỏi
Câu hỏi tập trung vào việc thiết kế mạng hybrid connectivity (kết nối lai giữa on-premises và Google Cloud) sử dụng VLAN attachments (các kết nối VLAN) kết thúc tại một Cloud Router duy nhất với 99.9% uptime (độ khả dụng cao).
Yêu cầu cụ thể:
- Thiết kế cho on-premises router (router tại chỗ).
- Cấu hình active/passive (một liên kết hoạt động, một dự phòng), chỉ sử dụng một VLAN attachment tại một thời điểm.
Mục tiêu là ảnh hưởng đến egress path từ Google Cloud đến on-premises (đường đi ra từ Google Cloud về môi trường tại chỗ), đảm bảo failover mượt mà mà không cần ECMP hoặc multi-active.
Đây là tình huống phổ biến trong Google Cloud Dedicated Interconnect hoặc Partner Interconnect, nơi Cloud Router xử lý BGP peering với on-premises qua VLAN attachments. Để đạt active/passive với single Cloud Router, cần sử dụng BGP attributes phù hợp để ưu tiên đường đi.
📘 Tài liệu tham khảo: - Google Cloud Interconnect VLAN attachments & BGP (cập nhật 2024-2026).
- High availability designs for Interconnect.
✅ Đáp án đúng
Create a design that uses a BGP multi-exit discriminator (MED) attribute to influence the egress path from Google Cloud to the on-premises environment.
Lý do chọn đáp án này:
🛠️ Trong thiết kế active/passive với single Cloud Router, on-premises router advertise routes BGP với MED thấp hơn trên VLAN active (ví dụ: MED=0) và MED cao hơn trên VLAN passive (ví dụ: MED=100). Cloud Router (GCP) sẽ ưu tiên đường có MED thấp nhất khi chọn egress path từ GCP về on-premises (traffic từ VPC qua Cloud Router đến VLAN active).
- Đảm bảo chỉ một VLAN active tại thời điểm, failover tự động khi passive có MED thấp hơn (thay đổi config).
- Đạt 99.9% uptime nhờ BGP convergence nhanh (~1-3 giây).
- Phù hợp yêu cầu "uses only one VLAN attachment at a time" vì tránh ECMP load-balancing.
✅ Hoàn hảo cho single Cloud Router HA setup (không cần dual routers).
📋 Giải thích tất cả các phương án
-
❌ [SAI] Create a design that uses the LOCAL_PREF BGP attribute to influence the egress path from Google Cloud to the on-premises environment.
🧩 LOCAL_PREF là attribute internal trong AS (dùng nội bộ GCP AS để chọn egress path từ Cloud Router). Không thể config trên on-premises router để ảnh hưởng trực tiếp đến GCP path selection. Nếu dùng, nó chỉ ưu tiên path nội bộ GCP chứ không kiểm soát active/passive VLAN từ on-premises side. Không phù hợp cho hybrid control. -
❌ [SAI] Create a design that uses an equal-cost multipath (ECMP) with flow-based hashing on your on-premises devices.
🛠️ ECMP yêu cầu multi-active paths (load-balance traffic qua nhiều VLAN đồng thời với equal cost), vi phạm yêu cầu "uses only one VLAN attachment at a time". Flow-based hashing chỉ phân tải, không hỗ trợ active/passive failover với single Cloud Router, dẫn đến downtime cao hơn nếu không config đúng. -
✅ [ĐÚNG] Create a design that uses a BGP multi-exit discriminator (MED) attribute to influence the egress path from Google Cloud to the on-premises environment.
(Giải thích chi tiết như phần đáp án đúng ở trên – lý tưởng cho on-premises control egress từ GCP). -
❌ [SAI] Create a design that uses the AS_PATH BGP attribute to influence the egress path from Google Cloud to the on-premises environment.
🧩 AS_PATH dùng prepend (làm dài path) để ảnh hưởng ingress traffic vào on-premises (từ on-premises influence GCP chọn path vào). Không hiệu quả cho egress từ GCP (vì GCP không prepend AS_PATH khi nhận từ on-premises). Failover chậm, không chính xác cho active/passive với single router.
Tóm tắt khuyến nghị 🚀: Sử dụng MED là best practice cho Google Cloud Interconnect HA active/passive (single Cloud Router). Test với BGP monitoring tools như Cloud Router logs để xác nhận convergence!
•The hierarchical firewall policy, bound at the organization level, is allowing/denying spe-cific external traffic.
•There is a global network firewall policy with rules that enforce intrusion prevention sys-tem (IPS) capabilities for specific external inbound/outbound traffic.
•The VPC firewall rules allow internal communication from RFC 1918 defined subnets communications.
•The VPC firewall contains an explicit deny rule with logs enabled.
This configuration was successful in multiple preexisting VF'Cs. However, you noticed that the logs were missing when you were reviewing a newly created VPC. All external communications are hanging, but internal traffic is working as expected. You want to fix the connectivity issue.
What should you do?
- A Create a new VPC and migrate existing resources to the new VPC. Delete the old VPC, and reapply the firewall policies and rules in the newVPC.
- B Raise the priority numbers of the firewall policy rules and lower the priority numbers of the VPC firewall rules.
- C Review the order in which the VPC firewall rules and policies are evaluated. If the VPC firewall rules are being evaluated before firewall policies, switch the order.
- D Lower the priority numbers of the firewall policy rules and raise the priority numbers of the VPC firewall rules.
Xem giải thích
🧩 Giải thích chi tiết nội dung câu hỏi
Câu hỏi mô tả tình huống triển khai các quy tắc tường lửa (firewall) phân cấp để bảo vệ tài nguyên trong một VPC mới được tạo trên Google Cloud Platform (GCP) (lưu ý: mặc dù người dùng đề cập "AWS", nhưng các khái niệm như hierarchical firewall policies, global network firewall policy, và VPC firewall rules là đặc trưng của GCP VPC Firewall, không phải AWS. AWS sử dụng Security Groups, NACLs và Network Firewall khác biệt).
-
Cấu hình firewall được mô tả:
- Hierarchical firewall policy (chính sách tường lửa phân cấp, ràng buộc ở mức tổ chức - organization level): Cho phép/từ chối lưu lượng bên ngoài cụ thể.
- Global network firewall policy: Áp dụng khả năng Intrusion Prevention System (IPS) cho lưu lượng vào/ra bên ngoài cụ thể.
- VPC firewall rules: Cho phép giao tiếp nội bộ từ các subnet theo chuẩn RFC 1918 (dải IP private như 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16).
- VPC firewall có quy tắc explicit deny (từ chối rõ ràng) với logs enabled (ghi log bật).
-
Vấn đề gặp phải:
- Cấu hình này hoạt động tốt ở nhiều VPC cũ.
- Ở VPC mới:
- Logs bị thiếu khi kiểm tra.
- Lưu lượng bên ngoài (external) bị treo (hanging) – nghĩa là bị chặn hoàn toàn.
- Lưu lượng nội bộ (internal) hoạt động bình thường.
-
Mục tiêu: Sửa lỗi kết nối (fix connectivity issue), tập trung vào lý do logs mất và external traffic bị block.
Nguyên nhân gốc rễ: Thứ tự đánh giá (evaluation order) các quy tắc firewall bị sai ở VPC mới. Trong GCP, thứ tự mặc định là Hierarchical policies trước, sau đó mới đến VPC firewall rules. Nếu VPC rules evaluate trước, quy tắc explicit deny ở VPC sẽ block external traffic ngay lập tức, khiến hierarchical/global policies không được áp dụng, dẫn đến external hanging và logs chỉ từ deny rule (nhưng có thể không ghi đúng nếu order sai). Internal ok vì RFC 1918 rules cho phép. (Kiến thức cập nhật GCP 2024-2026: VPC Firewall Rules evaluation order được tài liệu hóa rõ ràng).
📘 Nguồn tham khảo:
- GCP Docs: VPC firewall rules overview (cập nhật 2025).
- GCP Docs: Hierarchical firewall policies (phiên bản mới nhất 2026 hỗ trợ global scope).
✅ Đáp án đúng và lý do lựa chọn
Đáp án đúng: Review the order in which the VPC firewall rules and policies are evaluated. If the VPC firewall rules are being evaluated before firewall policies, switch the order.
Lý do (🛠️ Giải thích chi tiết):
- Trong GCP VPC Firewall, thứ tự đánh giá mặc định là:
- Hierarchical firewall policies (organization/folder/project) + global network policies.
- VPC network firewall rules.
- Nếu ở VPC mới, VPC rules evaluate trước policies (có thể do config sai hoặc legacy setup), thì explicit deny rule ở VPC sẽ block external traffic ngay lập tức, bỏ qua policies (IPS và allow/deny external). Kết quả: External hanging, logs chỉ từ deny rule nhưng missing vì không hit đúng (hoặc log config chưa sync).
- Internal traffic ok vì VPC rules allow RFC 1918 trước deny.
- Giải pháp: Kiểm tra và switch order để policies evaluate trước → External traffic được xử lý bởi policies (allow/deny + IPS), logs từ deny rule nếu cần sẽ xuất hiện đúng. Đây là fix nhanh, không cần migrate hay thay priority.
- Hoạt động ở VPC cũ chứng tỏ order đúng ở đó.
🛠️ Phân tích tất cả các phương án (đúng/sai)
-
❌ [SAI] Create a new VPC and migrate existing resources to the new VPC. Delete the old VPC, and reapply the firewall policies and rules in the newVPC.
- Giải thích sai: Đây là giải pháp quá cực đoan và tốn kém (downtime cao, migrate resources phức tạp với Compute Engine, GKE,...). Vấn đề chỉ là order evaluation ở VPC hiện tại, không cần tạo VPC mới hay xóa cũ. Reapply policies/rules không giải quyết gốc rễ order sai, và có nguy cơ lặp lỗi.
-
❌ [SAI] Raise the priority numbers of the firewall policy rules and lower the priority numbers of the VPC firewall rules.
- Giải thích sai: Priority numbers trong GCP: Số thấp hơn = ưu tiên cao hơn (ví dụ: priority 100 > 900).
- "Raise priority numbers of policy rules" = làm policy ít ưu tiên hơn.
- "Lower priority numbers of VPC rules" = làm VPC rules ưu tiên cao hơn.
- Kết quả: VPC rules (với deny) sẽ evaluate trước policies → làm tệ hơn, external vẫn hanging, logs vẫn miss. Không fix order evaluation.
- Giải thích sai: Priority numbers trong GCP: Số thấp hơn = ưu tiên cao hơn (ví dụ: priority 100 > 900).
-
✅ [ĐÚNG] Review the order in which the VPC firewall rules and policies are evaluated. If the VPC firewall rules are being evaluated before firewall policies, switch the order.
- Giải thích đúng: Như phần trên, trực tiếp nhắm vào nguyên nhân gốc (evaluation order sai ở VPC mới). Switch order để policies first → External traffic qua hierarchical/global policies (IPS + allow/deny), chỉ đến VPC rules nếu match. Logs từ explicit deny sẽ hoạt động nếu hit. Fix nhanh, không ảnh hưởng internal traffic.
-
❌ [SAI] Lower the priority numbers of the firewall policy rules and raise the priority numbers of the VPC firewall rules.
- Giải thích sai: Ngược với option trước, nhưng vẫn sai logic:
- "Lower priority numbers of policy rules" = policy ưu tiên cao hơn.
- "Raise priority numbers of VPC rules" = VPC ít ưu tiên hơn.
- Tuy nghe có lý, nhưng không giải quyết evaluation order (order là sequence cố định, priority chỉ trong cùng layer). Nếu VPC vẫn evaluate trước, deny vẫn block. Hơn nữa, hierarchical policies không dùng priority number như VPC rules (chúng evaluate theo hierarchy level).
- Giải thích sai: Ngược với option trước, nhưng vẫn sai logic:
Kết luận 🎯: Tập trung fix evaluation order qua GCP Console/CLI (gcloud compute firewall-rules ... hoặc VPC Network settings) để khôi phục connectivity và logs. Test với gcloud logging read để verify!