Create and manage NCC Gateway advertised routes

This page describes how to configure NCC Gateway advertised routes. Each NCC Gateway advertised route is installed in the route table of the Network Connectivity Center hub to which the NCC Gateway spoke is connected. The NCC Gateway itself is the next hop for each route that it advertises. NCC Gateway advertised routes follow standard best path selection modes when it comes to priority.

NCC Gateway advertised routes provide paths that resources in other spokes of the hub use to send packets to the corresponding NCC Gateway.

Create NCC Gateway advertised routes

To create routes for traffic from the VPC networks to the NCC Gateway, follow these steps:

gcloud

Use the gcloud beta network-connectivity spokes gateways advertised-routes create command:

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

Replace the following:

  • ROUTE_NAME: the name for the NCC Gateway advertised route that you want to create
  • REGION: the region that contains the NCC Gateway
  • PROJECT: the ID of the project that contains the NCC Gateway
  • SPOKE_NAME: the name of the gateway spoke
  • IP_RANGE: the destination IP address range of the NCC Gateway advertised route.
  • PRIORITY: the priority for the advertised route. The default value is 0

API

Use the projects.locations.spokes.gatewayAdvertisedRoutes method with the IP address range and priority specified:

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

Replace the following:

  • PROJECT: the ID of the project that contains the NCC Gateway
  • REGION: the region that contains the NCC Gateway
  • SPOKE_NAME: the name of the gateway spoke
  • IP_RANGE: the destination IP address range of the NCC Gateway advertised route.
  • PRIORITY: the priority for the advertised route. The default value is 0

Get details of a gateway advertised route

You can get details of an NCC Gateway advertised route by following these steps:

gcloud

Use the gcloud beta network-connectivity spokes gateways advertised-routes describe command:

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

Replace the following:

  • ROUTE_NAME: the name of the NCC Gateway advertised route
  • REGION: the region that contains the NCC Gateway
  • PROJECT: the ID of the project that contains the NCC Gateway
  • SPOKE_NAME: the name of the gateway spoke

API

Use the projects.locations.spokes.gatewayAdvertisedRoutes.get method with an empty request body:

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

Replace the following:

  • PROJECT: the ID of the project that contains the NCC Gateway
  • REGION: the region that contains the NCC Gateway
  • SPOKE_NAME: the name of the gateway spoke
  • ROUTE_NAME: the name of the NCC Gateway advertised route

View a list of gateway advertised routes

You can view a list of NCC Gateway advertised routes by following these steps.

gcloud

Use the gcloud beta network-connectivity spokes gateways advertised-routes list command:

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

Replace the following:

  • REGION: the region that contains the NCC Gateway
  • PROJECT: the ID of the project that contains the NCC Gateway
  • SPOKE_NAME: the name of the gateway spoke

API

Use the projects.locations.spokes.gatewayAdvertisedRoutes.list method with an empty request body:

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

Replace the following:

  • PROJECT: the ID of the project that contains the NCC Gateway
  • REGION: the region that contains the NCC Gateway
  • SPOKE_NAME: the name of the gateway spoke

Delete an advertised route

You can delete an NCC Gateway advertised route by following these steps:

gcloud

Use the gcloud beta network-connectivity spokes gateways advertised-routes delete command:

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

Replace the following:

  • ROUTE_NAME: the name of the NCC Gateway advertised route that you want to delete
  • REGION: the region that contains the NCC Gateway
  • PROJECT: the ID of the project that contains the NCC Gateway
  • SPOKE_NAME: the name of the gateway spoke

API

Use the projects.locations.spokes.gatewayAdvertisedRoutes.delete method with an empty request body:

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

Replace the following:

  • PROJECT: the ID of the project that contains the NCC Gateway
  • REGION: the region that contains the NCC Gateway
  • SPOKE_NAME: the name of the gateway spoke
  • ROUTE_NAME: the name of the NCC Gateway advertised route that you want to delete

What's next