View the VPC route table

This page describes how to view VPC route tables. This page assumes that you are familiar with how to list routes for a VPC network.

List routes in a project

To list all Network Connectivity Center-VPC routes in a project, follow these steps.

Console

  1. In the Google Cloud console, go to the Routes page.

    Go to Routes

  2. On the Effective routes tab, do the following:

    • Choose a VPC network.
    • Choose a region.
  3. Click View.

  4. You can filter Network Connectivity Center routes by using the following filters:

    • Type (Network Connectivity Center subnet)
    • Next hop type (hub)

gcloud

Run the gcloud compute routes list command:

gcloud compute routes list \
   --filter='(nextHopHub:*)'

Use the asterisk * to get all the routes in this project with a non-empty nextHopHub field. To view details of a route, save the route name from the command output and use it to describe a route in a project.

The output is similar to the following:

NAME                                                   NETWORK  DEST_RANGE   NEXT_HOP                                           PRIORITY
ncc-subnet-route-01db62e0-243a-5b2c-895d-9d4e0018b678  vpc-2    10.1.2.0/24  projects/_project_id_/locations/global/hubs/hub  0

List routes for a specific VPC spoke

To list the VPC routes for a specific VPC network, follow these steps.

Console

  1. In the Google Cloud console, go to the Routes page.

    Go to Routes

  2. On the Effective routes tab, do the following:

    • Choose a VPC network.
    • Choose a region.
  3. Click View. Network Connectivity Center subnet routes are listed with a link to the hub in the Next hop tab.

gcloud

Run the gcloud compute routes list command

gcloud compute routes list \
    --filter='(nextHopHub:*) AND (network:NETWORK)'

Use the asterisk * to get all the routes in this project with a non-empty nextHopHub field. Replace NETWORK with the name of the VPC network. To view details of a route, save the route name from the command output and use it to describe a route in a project.

Your output is similar to the following:

NAME                                                   NETWORK  DEST_RANGE   NEXT_HOP                                           PRIORITY
ncc-subnet-route-01db62e0-243a-5b2c-895d-9d4e0018b678  vpc-2    10.1.2.0/24  projects/_project_id_/locations/global/hubs/hub  0

Describe a route in a project

To get details of the VPC routes for a specific VPC network, follow these steps.

Console

  1. In the Google Cloud console, go to the Routes page.

    Go to Routes

  2. On the Effective routes tab, do the following:

    • Choose a VPC network.
    • Choose a region.
  3. To view the details for a specific route, such as route type, destination IP address, and next hop type, click the route name.

gcloud

Run the gcloud compute routes describe command

gcloud compute routes describe ROUTE_NAME

Replace ROUTE_NAME with the name of the route that you want to view details for. Route names are auto-generated. You can get the route name from the output of the gcloud compute routes list command.

Your output is similar to the following:


gcloud compute routes describe ncc-subnet-route-01db62e0-243a-5b2c-895d-9d4e0018b678
creationTimestamp: '2023-06-09T08:04:40.860-07:00'
description: Auto-generated subnet route via Network Connectivity Center [projects/173801823221/locations/global/hubs/hub/routeTables/default/routes/route-13d51af1-f9fa-4187-93bf-762736c67a9e].
destRange: 10.1.2.0/24
id: '5706930874196328807'
kind: compute#route
name: ncc-subnet-route-01db62e0-243a-5b2c-895d-9d4e0018b678
network: https://www.googleapis.com/compute/staging_1/projects/owner-ncc-vpc-spoke/global/networks/vpc-2
nextHopHub: projects/173801823221/locations/global/hubs/hub
priority: 0
selfLink: https://www.googleapis.com/compute/staging_1/projects/owner-ncc-vpc-spoke-testing/global/routes/ncc-subnet-route-01db62e0-243a-5b2c-895d-9d4e0018b678

What's next