Getting Information About Your Route Tables

You can get information about one or more of your route tables, like the Net they are created for or the routes they contain.

Getting Information About Your Route Tables Using Cockpit v2

See the Route Tables dashboard.

Getting Information About Your Route Tables Using OSC CLI

The ReadRouteTables command lists one or more of your route tables.
In your Net, each Subnet must be associated with a route table. If a Subnet is not explicitly associated with a route table, it is implicitly associated with the main route table of the Net.

Request sample
$ osc-cli api ReadRouteTables --profile "default" \
    --Filters '{
        "RouteTableIds": ["rtb-12345678"],
      }'
Request sample
$ osc-cli api ReadRouteTables --profile "default" \
    --Filters '{
        "NetIds": ["vpc-12345678", "vpc-87654321"],
        "LinkRouteTableMain": True,
      }'

This command contains the following attributes that you need to specify:

  • DryRun: (optional) If true, checks whether you have the required permissions to perform the action.

  • Filters: (optional) One or more filters.

  • NextPageToken: (optional) The token to request the next page of results. Each token refers to a specific page.

  • ResultsPerPage: (optional) The maximum number of logs returned in a single response (between 1`and `1000, both included). By default, 100.

The ReadRouteTables command returns the following elements:

  • NextPageToken: The token to request the next page of results. Each token refers to a specific page.

  • ResponseContext: Information about the context of the response.

  • RouteTables: Information about one or more route tables.

Result sample
{
  "RouteTables": [
    {
      "Routes": [
        {
          "DestinationIpRange": "10.0.0.0/16",
          "CreationMethod": "CreateRouteTable",
          "State": "active"
        }
      ],
      "LinkRouteTables": [
        {
          "Main": true,
          "LinkRouteTableId": "rtbassoc-12345678",
          "RouteTableId": "rtb-12345678",
          "NetId": "vpc-12345678"
        }
      ],
      "NetId": "vpc-12345678",
      "Tags": [],
      "RoutePropagatingVirtualGateways": [],
      "RouteTableId": "rtb-12345678"
    }
  ],
  "ResponseContext": {
    "RequestId": "0475ca1e-d0c5-441d-712a-da55a4175157"
  }
}

Getting Information About Your Route Tables Using AWS CLI

To get information about one or more route tables, use the describe-route-tables command following this syntax:

Request sample
$ aws ec2 describe-route-tables \
    --profile YOUR_PROFILE \
    [--route-table-id NOT_SPECIFIED] \
    --filters Name=vpc-id,Values=vpc-12345678 \
    --endpoint https://fcu.eu-west-2.outscale.com

This command contains the following attributes that you need to specify:

  • (optional) profile: The named profile you want to use, created when configuring AWS CLI. For more information, see Installing and Configuring AWS CLI.

  • (optional) route-table-ids: One or more IDs of route tables.

  • (optional) filters: One or more filters, in the "Name=X,Values=Y" format.

    You can specify several values for a same filter using the "Name=X,Values=Y, Z" format.

    The following filters are available:

    • association.route-table-association-id: The ID of an association for the route table.

    • association.route-table-id: The ID of the route table involved in the association.

    • association.subnet-id: The ID of the subnet involved in the association.

    • association.main: Indicates whether the route table is the main one for the VPC (true | false).

    • route-table-id: The ID of the route table.

    • route.destination-cidr-block: The destination range of IPs specified in a route in the table, in CIDR notation.

    • route.destination-prefix-list-id: The prefix list ID of the service reachable through a VPC endpoint specified in a route in the table. For more information, see Getting Information About Prefix Lists.

    • route.gateway-id: The ID of the Internet gateway or Virtual Private gateway attached to the VPC used as the route target.

    • route.instance-id: The ID of an instance in the VPC used as the route target.

    • route.nat-gateway-id: The ID of a NAT gateway used a the route target.

    • route.origin: Indicates how the route was created (create-route-table if the route was automatically created when creating the route table, create-route if the route was manually created, or vgw-route-propagation if the route was propagated using route propagation).

    • route.state: The state of a route in the route table (always active). For more information, see About Route Tables.

    • route.vpc-peering-connection-id: The ID of a VPC peering connection specified in a route of the route table.

    • tag-key: The key of a tag associated with the resource.

    • tag-value: The value of a tag associated with the resource.

    • tag:XXXX: The value of a tag associated with the resource, where XXXX is the key of the tag.

      To filter a tag whose key is XXXX and value is YYYY, you can therefore use either of the following two formats:

      • --filters Name=tag-key,Values=XXXX Name=tag-value,Values=YYYY

      • --filters Name=tag:XXXX,Values=YYYY

    • vpc-id: The ID of the VPC.

  • endpoint: The endpoint corresponding to the Region you want to send the request to.

The describe-route-tables command returns the following elements:

  • RouteTable: Information about one or more route tables. This element contains the following information:

    • Association: One or more associations between the route table and subnets. This element contains the following information:

      • RouteTableAssociationId: The ID of the association between the route table and a subnet.

      • Main: If true, the route table is the main one for the VPC. If false, it is not.

      • RouteTableId: The ID of the route table.

    • RouteTableId: The ID of the route table.

    • VpcId: The ID of the VPC.

    • PropagatingVgws: Virtual Private gateways (VGW) propagating routes, in BGP protocol.

    • Tags: One or more tags associated with the route table. This element contains the following information:

      • Value: The value of the tag.

      • Key: The key of the tag.

    • Routes: Information about the routes contained in the route table. This element contains the following information:

      • GatewayId: The target gateway used for the route.

        This can also be a instance-id or a nat-gateway-id.

      • DestinationCidrBlock: The destination range of IPs, in CIDR notation.

      • State: The state of the route.

Result sample
{
    "RouteTables": [
        {
            "Associations": [
                {
                    "RouteTableAssociationId": "rtbassoc-1234abcd",
                    "Main": true,
                    "RouteTableId": "rtb-4321dcba"
                }
            ],
            "RouteTableId": "rtb-5678abcd",
            "VpcId": "vpc-12345678",
            "PropagatingVgws": [],
            "Tags": [
                {
                    "Value": "SUB1",
                    "Key": "Name"
                }
            ],
            "Routes": [
                {
                    "GatewayId": "local",
                    "DestinationCidrBlock": "10.0.0.0/16",
                    "State": "active"
                }
            ]
        }
    ]
}

Related Pages

Corresponding API Methods

AWS™ and Amazon Web Services™ are trademarks of Amazon Technologies, Inc or its affiliates in the United States and/or other countries.