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 and describe routes in a VPC spoke

You can use the Google Cloud CLI or the API to list and view details about the following types of routes:

Neither the gcloud CLI commands nor the API methods show the following types of routes:

To see the complete route view, use the Google Cloud console. To list and describe policy-based routes, see Use policy-based routes.

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 on properties including route type, destination IP range, and next hop type.

  5. Optional: Click the Show suppressed routes toggle to the on position to view routes that are suppressed. To view the reason why a route is suppressed, point to the icon in the Status column.

gcloud

To list and view details for subnet routes and static routes, use the gcloud compute routes commands. These commands don't show other types of routes. To see all routes, use the Google Cloud console.

To list routes, do the following:

gcloud compute routes list \
    --filter="network=NETWORK_NAME" \
    --project=PROJECT_ID

To get details for a route, do the following:

gcloud compute routes describe ROUTE_NAME \
    --format="flattened()" \
    --project=PROJECT_ID

Replace the following:

  • NETWORK_NAME: the name of the VPC network.
  • PROJECT_ID: the project ID that contains your VPC network.
  • ROUTE_NAME: the name of the route.

API

To list and view details for subnet routes and static routes, use the routes.list and routes.get methods. These methods don't show other types of routes. To see all routes, use the Google Cloud console.

To list routes, do the following:

GET https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/global/routes?filter=network="NETWORK_URL

To get details for a route, do the following:

GET https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/global/routes/ROUTE_NAME

Replace the following:

  • PROJECT_ID: the project ID that contains your VPC network.
  • NETWORK_URL: the URL of the VPC network.
  • ROUTE_NAME: the name of the route.

What's next