本頁面說明如何設定 NCC Gateway 宣傳的路徑。每個 NCC 閘道宣傳路徑都會安裝在 NCC 閘道輪輻連線的 Network Connectivity Center 中樞路徑表中。NCC 閘道本身是宣傳的每個路由的下一個躍點。在優先順序方面,NCC Gateway 公告的路徑會遵循標準最佳路徑選取模式。
NCC 閘道宣傳的路由會提供路徑,讓中樞其他輪輻中的資源用來將封包傳送至對應的 NCC 閘道。
建立 NCC 閘道廣告路徑
如要為從虛擬私人雲端網路傳送至 NCC Gateway 的流量建立路徑,請按照下列步驟操作:
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 Gateway 的專案 IDSPOKE_NAME
:閘道輪輻的名稱IP_RANGE
:NCC Gateway 宣傳路徑的目的地 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 Gateway 的專案 IDREGION
:包含 NCC 閘道的區域SPOKE_NAME
:閘道輪輻的名稱IP_RANGE
:NCC Gateway 宣傳路徑的目的地 IP 位址範圍。PRIORITY
:通告路徑的優先順序。預設值為 0
取得閘道廣告路徑的詳細資料
如要取得 NCC Gateway 宣傳路徑的詳細資料,請按照下列步驟操作:
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 Gateway 的專案 IDSPOKE_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 Gateway 的專案 IDREGION
:包含 NCC 閘道的區域SPOKE_NAME
:閘道輪輻的名稱ROUTE_NAME
:NCC 閘道宣傳路由的名稱
查看閘道宣傳路徑清單
您可以按照下列步驟查看 NCC Gateway 廣告路徑清單。
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 Gateway 的專案 IDSPOKE_NAME
:閘道輪輻的名稱
API
使用 projects.locations.spokes.gatewayAdvertisedRoutes.list
方法,並附上空白要求主體:
LIST https://networkconnectivity.googleapis.com/v1beta/projects/PROJECT/regions/REGION/spokes/SPOKE_NAME/gatewayAdvertisedRoutes
更改下列內容:
PROJECT
:包含 NCC Gateway 的專案 IDREGION
:包含 NCC 閘道的區域SPOKE_NAME
:閘道輪輻的名稱
刪除通告路徑
如要刪除 NCC Gateway 宣傳路線,請按照下列步驟操作:
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 Gateway 的專案 IDSPOKE_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 Gateway 的專案 IDREGION
:包含 NCC 閘道的區域SPOKE_NAME
:閘道輪輻的名稱ROUTE_NAME
:您要刪除的 NCC 閘道宣傳路徑名稱
後續步驟
- 如要瞭解 NCC 閘道,請參閱 NCC 閘道總覽。
- 如要瞭解如何設定 NCC 閘道,請參閱「NCC 閘道設定總覽」。
- 如需常見問題的解決方案,請參閱「排解 Network Connectivity Center 相關問題」。
- 如要進一步瞭解 API 和 Google Cloud CLI 指令,請參閱「API 和參考資料」。