建立及管理 NCC Gateway 廣告路徑

本頁說明如何設定 NCC 閘道播送的路徑。每個 NCC 閘道 advertise 的路由都會安裝在 Network Connectivity Center (NCC) 中樞的路徑表中,NCC 閘道輪輻會連線至該中樞。NCC 閘道本身是其宣傳的每個路徑的下一個躍點。NCC 閘道公告路徑的優先順序遵循標準最佳路徑選取模式

NCC 閘道 advertise 的路由會提供路徑,讓中樞其他輪輻中的資源可用於將封包傳送至對應的 NCC 閘道。

建立 NCC 閘道 advertise 路由

如要建立路徑,將虛擬私有雲網路的流量導向 NCC 閘道,請按照下列步驟操作:

gcloud

使用 gcloud beta network-connectivity spokes gateways advertised-routes create 指令

gcloud beta network-connectivity spokes gateways advertised-routes create ROUTE_NAME \
    --region=REGION \
    --project=PROJECT \
    --spoke=SPOKE_NAME \
    --ip-range=IP_RANGE \
    --priority=PRIORITY \
    --advertise-to-hub

更改下列內容:

  • ROUTE_NAME:您要建立的 NCC 閘道播送路由名稱
  • REGION:包含 NCC 閘道的區域
  • PROJECT:包含 NCC 閘道的專案 ID
  • SPOKE_NAME:閘道輪輻的名稱
  • IP_RANGE:NCC 閘道通告路由的目的地 IP 位址範圍。
  • PRIORITY:通告路徑的優先順序。預設值為 0

API

使用 projects.locations.spokes.gatewayAdvertisedRoutes 方法,並指定 IP 位址範圍和優先順序:

POST https://networkconnectivity.googleapis.com/v1beta/projects/PROJECT/locations/REGION/spokes/SPOKE_NAME/gatewayAdvertisedRoutes
{
"ip_range": "IP_RANGE",
"priority": "PRIORITY",
"recipient": "ADVERTISE_TO_HUB",
}

更改下列內容:

  • PROJECT:包含 NCC 閘道的專案 ID
  • REGION:包含 NCC 閘道的區域
  • SPOKE_NAME:閘道輪輻的名稱
  • IP_RANGE:NCC 閘道通告路由的目的地 IP 位址範圍。
  • PRIORITY:通告路徑的優先順序。預設值為 0

取得閘道 advertise 路由的詳細資料

如要取得 NCC 閘道 advertise 路由的詳細資料,請按照下列步驟操作:

gcloud

使用 gcloud beta network-connectivity spokes gateways advertised-routes describe 指令:

gcloud beta network-connectivity spokes gateways advertised-routes describe ROUTE_NAME \
    --region=REGION \
    --project=PROJECT \
    --spoke=SPOKE_NAME

更改下列內容:

  • ROUTE_NAME:NCC 閘道播送的路由名稱
  • REGION:包含 NCC 閘道的區域
  • PROJECT:包含 NCC 閘道的專案 ID
  • SPOKE_NAME:閘道輪輻的名稱

API

使用空白要求主體呼叫 projects.locations.spokes.gatewayAdvertisedRoutes.get 方法

GET https://networkconnectivity.googleapis.com/v1beta/projects/PROJECT/regions/REGION/spokes/SPOKE_NAME/gatewayAdvertisedRoutes/ROUTE_NAME

更改下列內容:

  • PROJECT:包含 NCC 閘道的專案 ID
  • REGION:包含 NCC 閘道的區域
  • SPOKE_NAME:閘道輪輻的名稱
  • ROUTE_NAME:NCC 閘道播送的路由名稱

查看閘道 advertise 路由清單

如要查看 NCC 閘道 advertise 的路由清單,請按照下列步驟操作。

gcloud

使用 gcloud beta network-connectivity spokes gateways advertised-routes list 指令:

gcloud beta network-connectivity spokes gateways advertised-routes list \
    --region=REGION \
    --project=PROJECT \
    --spoke=SPOKE_NAME

更改下列內容:

  • REGION:包含 NCC 閘道的區域
  • PROJECT:包含 NCC 閘道的專案 ID
  • SPOKE_NAME:閘道輪輻的名稱

API

使用空白要求主體呼叫 projects.locations.spokes.gatewayAdvertisedRoutes.list 方法

LIST https://networkconnectivity.googleapis.com/v1beta/projects/PROJECT/regions/REGION/spokes/SPOKE_NAME/gatewayAdvertisedRoutes

更改下列內容:

  • PROJECT:包含 NCC 閘道的專案 ID
  • REGION:包含 NCC 閘道的區域
  • SPOKE_NAME:閘道輪輻的名稱

刪除通告路徑

如要刪除 NCC 閘道 advertise 路由,請按照下列步驟操作:

gcloud

使用 gcloud beta network-connectivity spokes gateways advertised-routes delete 指令:

gcloud beta network-connectivity spokes gateways advertised-routes delete ROUTE_NAME \
  --region=REGION \
  --project=PROJECT \
  --spoke=SPOKE_NAME

更改下列內容:

  • ROUTE_NAME:要刪除的 NCC 閘道播送路由名稱
  • REGION:包含 NCC 閘道的區域
  • PROJECT:包含 NCC 閘道的專案 ID
  • SPOKE_NAME:閘道輪輻的名稱

API

使用空白要求主體呼叫 projects.locations.spokes.gatewayAdvertisedRoutes.delete 方法

DELETE https://networkconnectivity.googleapis.com/v1beta/projects/PROJECT/regions/REGION/spokes/SPOKE_NAME/gatewayAdvertisedRoutes/ROUTE_NAME

更改下列內容:

  • PROJECT:包含 NCC 閘道的專案 ID
  • REGION:包含 NCC 閘道的區域
  • SPOKE_NAME:閘道輪輻的名稱
  • ROUTE_NAME:要刪除的 NCC 閘道播送路由名稱

後續步驟