Supprimer une route

Vous pouvez supprimer une route que vous avez créée dans une route table afin de supprimer l’option de routage correspondante pour les machines virtuelles (VM) placées dans les Subnets associés.

Vous ne pouvez pas supprimer la route local.

Supprimer une route avec Cockpit v2

  1. Dans le dashboard Route Tables, cliquez sur l’ID de la route table dans laquelle vous souhaitez supprimer une route.
    Le volet de détails de la route table apparaît.

  2. Cliquez à l’intérieur du volet pour faire apparaître des cases à cocher.

  3. Cochez la case de la route que vous voulez supprimer.
    La route est sélectionnée et un menu d’actions apparaît.

  4. Cliquez sur IconTerminate Supprimer.
    Une boîte de dialogue de confirmation apparaît.

  5. Cliquez sur Supprimer.
    La route est supprimée.

Supprimer une route avec OSC CLI

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

The DeleteRoute command deletes a route from a specified route table.

Request sample
$ osc-cli api DeleteRoute --profile "default" \
    --RouteTableId "rtb-12345678" \
    --DestinationIpRange "198.51.100.0/24"

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

  • DestinationIpRange: The exact IP range for the route.

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

  • RouteTableId: The ID of the route table from which you want to delete a route.

The DeleteRoute command returns the following elements:

  • ResponseContext: Information about the context of the response.

    • RequestId: The ID of the request.

  • RouteTable: Information about the route table.

    • 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
{
  "RouteTable": {
    "Routes": [
      {
        "DestinationIpRange": "10.0.0.0/16",
        "CreationMethod": "CreateRouteTable",
        "State": "active"
      }
    ],
    "LinkRouteTables": [],
    "NetId": "vpc-12345678",
    "Tags": [],
    "RoutePropagatingVirtualGateways": [],
    "RouteTableId": "rtb-12345678"
  },
  "ResponseContext": {
    "RequestId": "0475ca1e-d0c5-441d-712a-da55a4175157"
  }
}

Supprimer une route avec AWS CLI

Pour supprimer une route dans une route table, utilisez la commande delete-route en suivant cette syntaxe :

Exemple de requête
$ aws ec2 delete-route \
    --profile YOUR_PROFILE \
    --route-table-id rtb-1234abcd \
    --destination-cidr-block 0.0.0.0/0 \
    --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.

  • route-table-id : L’ID de la route table dans laquelle vous souhaitez supprimer une route.

  • destination-cidr-block : La plage d’IP de destination de la route à supprimer, en notation CIDR.

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

La route table spécifiée est supprimée.

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.