Obtenir des informations sur vos route tables

Vous pouvez obtenir des informations à propos d’une ou plusieurs de vos route tables, comme le Net pour lequel elles sont créées ou les routes qu’elles contiennent.

Obtenir des informations sur vos route tables avec Cockpit v2

Voir le dashboard Route Tables.

Obtenir des informations sur vos route tables avec OSC CLI

À ce jour, cette section est disponible en anglais uniquement.

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.

    • 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 (always active).

    • 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 (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.

    • 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 (always active).

      • 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.

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"
  }
}

Obtenir des informations sur vos route tables avec AWS CLI

Pour obtenir des informations sur une ou plusieurs route tables, utilisez la commande describe-route-tables en suivant cette syntaxe :

Exemple de requête
$ 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

Cette commande contient les attributs suivants que vous devez spécifier :

  • (optionnel) profile : Le profil nommé que vous voulez utiliser, créé pendant la configuration d’AWS CLI. Pour en savoir plus, voir Installer et configurer AWS CLI.

  • (optionnel) route-table-ids : Un ou plusieurs ID de route tables.

  • (optionnel) filters : Un ou plusieurs filtres, au format "Name=X,Values=Y".

    Vous pouvez spécifier plusieurs valeurs pour un même filtre en utilisant le format "Name=X,Values=Y, Z".

    Les filtres suivants sont disponibles :

    • association.route-table-association-id : L’ID d’une association pour la route table.

    • association.route-table-id : L’ID de la route table impliquée dans l’association.

    • association.subnet-id : L’ID du subnet impliqué dans l’association.

    • association.main : Indique si la route table est la principale pour le VPC ( true | false).

    • route-table-id : L’ID de la route table.

    • route.destination-cidr-block : La plage d’IP de destination spécifiée pour la route table, en notation CIDR.

    • route.destination-prefix-list-id : L’ID de la prefix list du service atteignable par un VPC endpoint spécifié dans une route de la route table. Pour en savoir plus, voir Obtenir des informations sur les prefix lists.

    • route.gateway-id : L’ID de l’Internet gateway ou de la Virtual Private gateway attachée au VPC et utilisée comme target pour la route.

    • route.instance-id : L’ID d’une instance dans le VPC utilisée comme target pour la route.

    • route.nat-gateway-id : L’ID d’une NAT gateway utilisée comme target pour la route.

    • route.origin : Indique comment la route a été créée (create-route-table si la route a été automatiquement créée lors de la création de la route table, create-route si la route a été créée manuellement, vgw-route-propagation si la route a été propagée à l’aide de la propagation de route).

    • route.state : L’état d’une route dans la route table (toujours active). Pour en savoir plus, voir À propos des route tables.

    • route.vpc-peering-connection-id : L’ID d’une VPC peering connection spécifiée dans une route de la route table.

    • tag-key : La clé d’un tag associé à la ressource.

    • tag-value : La valeur d’un tag associé à la ressource.

    • tag:XXXX : La valeur d’un tag associé à la ressource, où XXXX est la clé du tag.

      Pour filtrer un tag dont la clé est XXXX et la valeur est YYYY, vous pouvez donc utiliser un des deux formats suivants :

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

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

    • vpc-id : L’ID du VPC.

  • endpoint : Le endpoint correspondant à la Région à laquelle vous voulez envoyer la requête.

La commande describe-route-tables renvoie les éléments suivants :

  • RouteTable : Informations à propos d’une ou plusieurs route tables. Cet élément contient les informations suivantes :

    • Association : Une ou plusieurs associations entre la route table et des subnets. Cet élément contient les informations suivantes :

      • RouteTableAssociationId : L’ID de l’association entre la route table et un subnet.

      • Main : Si true, la route table est la principale pour le VPC. Si false, elle ne l’est pas.

      • RouteTableId : L’ID de la route table.

    • RouteTableId : L’ID de la route table.

    • VpcId : L’ID du VPC.

    • PropagatingVgws : Les Virtual Private gateways (VGW) qui propagent les routes, en protocole BGP.

    • Tags : Un ou plusieurs tags associés à la route table. Cet élément contient les informations suivantes :

      • Value : La valeur du tag.

      • Key : La clé du tag.

    • Routes : Informations à propos des routes contenues dans la route table. Cet élément contient l’information suivante :

      • GatewayId : La target utilisée pour la route.

        Cet élément peut également être un instance-id ou un nat-gateway-id.

      • DestinationCidrBlock : La plage d’IP de destination, en notation CIDR.

      • State : L’état de la route.

Exemple de résultat
{
    "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"
                }
            ]
        }
    ]
}

Pages connexes

Méthodes API correspondantes

AWS™ et Amazon Web Services™ sont des marques de commerce d’Amazon Technologies, Inc. ou de ses affiliées aux États-Unis et/ou dans les autres pays.