IBM Cloud Docs
Viewing details of a routing table

Viewing details of a routing table

You can view details of a routing table by using the console, CLI, API, or Terraform. From the Routing table details page in the console, you can also view details of attached routes and subnets, as well as go to other pages to view VPC details, manage address prefixes, and more.

Viewing details of a routing table in the console

To view the details of a routing table in the console, follow these steps:

  1. From the IBM Cloud console, select the Navigation Menu Navigation Menu icon, then click Infrastructure VPC icon > Network > Routing tables. The Routing tables for VPC page appears.

  2. Click the name of the routing table that you want details for. The Routing table details page appears.

Field descriptions are as follows.

Routing table details and Traffic
Field Description
Tags Click the Add tags or Edit icon Edit icon to edit your tags for the routing table.
Name Click the Edit icon Edit icon to update the name.
Routing table ID The ID of this routing table.
Virtual private cloud The VPC for this routing table.
Created date The origination date of the routing table.
Routes The number of destination routes.
Default Indicates whether the routing table is the default routing table.
Attached subnets In the Traffic section, view the number of attached subnets. Click the Subnets tab to see subnet details.

In the Routes section, you can view the routes associated with this routing table.

For descriptions of the routing table columns, see Listing routes of a routing table.

Viewing details of a routing table from the CLI

To view details of a specific routing table:

ibmcloud is vpc-routing-table VPC ROUTING_TABLE [--json]

To view details of the default routing table:

ibmcloud is vpc-default-routing-table VPC [--json]

To view details of a routing table that is attached to the subnet:

ibmcloud is subnet-routing-table SUBNET [--json]

Where:

VPC
Is the ID or name of the VPC.
ROUTING_TABLE
Is the ID or name of the VPC routing table.
SUBNET
Is the ID or name of the subnet.
--json
Formats output in JSON.

Viewing details of a routing table with the API

To view the details of a routing table with the API, follow these steps:

  1. Set up your API environment.

  2. Store the following values in variables to be used in the API command:

    export VpcId=<your_vpc_id>
    export RoutingTableId=<your_routing_table_id>
    
  3. View details of a routing table:

    curl -X GET "$vpc_api_endpoint/v1/vpcs/$VpcId/routing_tables/$RoutingTableId?version=$api_version&generation=2" \
         -H "Authorization: $iam_token"
    

    To view the routing table that is attached to a subnet:

    export SubnetId=<your_subnet_id>
    curl -X GET "$vpc_api_endpoint/v1/subnets/$SubnetId/routing_table?version=$api_version&generation=2" \
         -H "Authorization: $iam_token"
    

Viewing details of a routing table with Terraform

To view details of all or a specific routing table with Terraform, follow these steps:

  1. Set up your Terraform environment.

  2. Use one of the following examples:

    • To list and view details of all routing tables for a VPC:

      data "ibm_is_vpc_routing_tables" "example" {
        vpc = ibm_is_vpc.example.id
      }
      

      For more information about the ibm_is_vpc_routing_tables resource, see the Terraform Registry.

    • To retrieve a single routing table specified by the identifier:

      data "ibm_is_vpc_routing_table" "example_routing_table" {
        vpc                 = ibm_is_vpc.example_vpc.id
        routing_table     = ibm_is_vpc_routing_table.example_rt.routing_table
      }
      

      For more information about the ibm_is_vpc_routing_table resource, see the Terraform Registry.

    • To retrieve the default routing table for the VPC specified by the identifier:

      data "ibm_is_vpc_default_routing_table" "example" {
        vpc = ibm_is_vpc.example.id
      }
      

      For more information about the ibm_is_vpc_default_routing_table resource, see the Terraform Registry.