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 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.
$ osc-cli api ReadRouteTables --profile "default" \
--Filters '{
"RouteTableIds": ["rtb-12345678"]
}'
$ 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.-
LinkRouteTableIds
: (optional) The IDs of the route tables involved in the associations. -
LinkRouteTableLinkRouteTableIds
: (optional) The IDs of the associations between the route tables and the Subnets. -
LinkRouteTableMain
: (optional) If true, the route tables are the main ones for their Nets. -
LinkSubnetIds
: (optional) The IDs of the Subnets involved in the associations. -
NetIds
: (optional) The IDs of the Nets for the route tables. -
RouteCreationMethods
: (optional) The methods used to create a route. -
RouteDestinationIpRanges
: (optional) The IP ranges specified in routes in the tables. -
RouteDestinationServiceIds
: (optional) The service IDs specified in routes in the tables. -
RouteGatewayIds
: (optional) The IDs of the gateways specified in routes in the tables. -
RouteNatServiceIds
: (optional) The IDs of the NAT services specified in routes in the tables. -
RouteNetPeeringIds
: (optional) The IDs of the Net peerings specified in routes in the tables. -
RouteStates
: (optional) The states of routes in the route tables (alwaysactive
). -
RouteTableIds
: (optional) The IDs of the route tables. -
RouteVmIds
: (optional) The IDs of the VMs specified in routes in the tables. -
TagKeys
: (optional) The keys of the tags associated with the route tables. -
TagValues
: (optional) The values of the tags associated with the route tables. -
Tags
: (optional) The key/value combination of the tags associated with the route tables, in the following format: "Filters":{"Tags":["TAGKEY=TAGVALUE"]}.
-
-
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 (between1
and1000
, 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.-
RequestId
: The ID of the request.
-
-
RouteTables
: Information about one or more route tables.-
LinkRouteTables
: One or more associations between the route table and Subnets.-
LinkRouteTableId
: The ID of the association between the route table and the Net or Subnet. -
Main
: If true, the route table is the main one. -
NetId
: The ID of the Net, if the route table is not explicitly linked to a Subnet. -
RouteTableId
: The ID of the route table. -
SubnetId
: The ID of the Subnet, if the route table is explicitly linked to a Subnet.
-
-
NetId
: The ID of the Net for the route table. -
RoutePropagatingVirtualGateways
: Information about virtual gateways propagating routes.-
VirtualGatewayId
: The ID of the virtual gateway.
-
-
RouteTableId
: The ID of the route table. -
Routes
: One or more routes in the route table.-
CreationMethod
: The method used to create the route. -
DestinationIpRange
: The IP range used for the destination match, in CIDR notation (for example,10.0.0.0/24
). -
DestinationServiceId
: The ID of the OUTSCALE service. -
GatewayId
: The ID of the internet service or virtual gateway attached to the Net. -
NatServiceId
: The ID of a NAT service attached to the Net. -
NetAccessPointId
: The ID of the Net access point. -
NetPeeringId
: The ID of the Net peering. -
NicId
: The ID of the NIC. -
State
: The state of a route in the route table (alwaysactive
). -
VmAccountId
: The account ID of the owner of the VM. -
VmId
: The ID of a VM specified in a route in the table.
-
-
Tags
: One or more tags associated with the route table.-
Key
: The key of the tag, with a minimum of 1 character. -
Value
: The value of the tag, between 0 and 255 characters.
-
-
{
"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 oapi-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.
$ oapi-cli --profile "default" ReadRouteTables \
--Filters '{
"RouteTableIds": ["rtb-12345678"]
}'
$ oapi-cli --profile "default" ReadRouteTables \
--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.-
LinkRouteTableIds
: (optional) The IDs of the route tables involved in the associations. -
LinkRouteTableLinkRouteTableIds
: (optional) The IDs of the associations between the route tables and the Subnets. -
LinkRouteTableMain
: (optional) If true, the route tables are the main ones for their Nets. -
LinkSubnetIds
: (optional) The IDs of the Subnets involved in the associations. -
NetIds
: (optional) The IDs of the Nets for the route tables. -
RouteCreationMethods
: (optional) The methods used to create a route. -
RouteDestinationIpRanges
: (optional) The IP ranges specified in routes in the tables. -
RouteDestinationServiceIds
: (optional) The service IDs specified in routes in the tables. -
RouteGatewayIds
: (optional) The IDs of the gateways specified in routes in the tables. -
RouteNatServiceIds
: (optional) The IDs of the NAT services specified in routes in the tables. -
RouteNetPeeringIds
: (optional) The IDs of the Net peerings specified in routes in the tables. -
RouteStates
: (optional) The states of routes in the route tables (alwaysactive
). -
RouteTableIds
: (optional) The IDs of the route tables. -
RouteVmIds
: (optional) The IDs of the VMs specified in routes in the tables. -
TagKeys
: (optional) The keys of the tags associated with the route tables. -
TagValues
: (optional) The values of the tags associated with the route tables. -
Tags
: (optional) The key/value combination of the tags associated with the route tables, in the following format: "Filters":{"Tags":["TAGKEY=TAGVALUE"]}.
-
-
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 (between1
and1000
, 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.-
RequestId
: The ID of the request.
-
-
RouteTables
: Information about one or more route tables.-
LinkRouteTables
: One or more associations between the route table and Subnets.-
LinkRouteTableId
: The ID of the association between the route table and the Net or Subnet. -
Main
: If true, the route table is the main one. -
NetId
: The ID of the Net, if the route table is not explicitly linked to a Subnet. -
RouteTableId
: The ID of the route table. -
SubnetId
: The ID of the Subnet, if the route table is explicitly linked to a Subnet.
-
-
NetId
: The ID of the Net for the route table. -
RoutePropagatingVirtualGateways
: Information about virtual gateways propagating routes.-
VirtualGatewayId
: The ID of the virtual gateway.
-
-
RouteTableId
: The ID of the route table. -
Routes
: One or more routes in the route table.-
CreationMethod
: The method used to create the route. -
DestinationIpRange
: The IP range used for the destination match, in CIDR notation (for example,10.0.0.0/24
). -
DestinationServiceId
: The ID of the OUTSCALE service. -
GatewayId
: The ID of the internet service or virtual gateway attached to the Net. -
NatServiceId
: The ID of a NAT service attached to the Net. -
NetAccessPointId
: The ID of the Net access point. -
NetPeeringId
: The ID of the Net peering. -
NicId
: The ID of the NIC. -
State
: The state of a route in the route table (alwaysactive
). -
VmAccountId
: The account ID of the owner of the VM. -
VmId
: The ID of a VM specified in a route in the table.
-
-
Tags
: One or more tags associated with the route table.-
Key
: The key of the tag, with a minimum of 1 character. -
Value
: The value of the tag, between 0 and 255 characters.
-
-
{
"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
Before you begin: Install and configure AWS CLI. For more information, see Installing and Configuring AWS CLI. |
To get information about one or more route tables, use the describe-route-tables command following this syntax:
$ 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, orvgw-route-propagation
if the route was propagated using route propagation). -
route.state
: The state of a route in the route table (alwaysactive
). 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, whereXXXX
is the key of the tag.To filter a tag whose key is
XXXX
and value isYYYY
, 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. For more information, see Installing and Configuring AWS CLI.
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
: Iftrue
, the route table is the main one for the VPC. Iffalse
, 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 anat-gateway-id
. -
DestinationCidrBlock
: The destination range of IPs, in CIDR notation. -
State
: The state of the route.
-
-
{
"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.