Deleting a Route

You can delete a route you created in a route table to remove the corresponding routing option for virtual machines (VMs) placed in the associated Subnets.

You cannot delete the default local route.

Deleting a Route Using Cockpit v2

  1. In the Route Tables dashboard, click the ID of the route table in which you want to delete a route.
    The route table details panel appears.

  2. Click inside the panel to make checkboxes appear.

  3. Check the box of the route you want to delete.
    The route is selected and an action menu appears.

  4. Click IconTerminate Delete.
    A confirmation dialog box appears.

  5. Click Delete.
    The route is deleted.

Deleting a Route Using OSC CLI

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.

  • RouteTable: Information about the route table.

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

Deleting a Route Using AWS CLI

To delete a route in a route table, use the delete-route command following this syntax:

Request sample
$ 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

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.

  • route-table-id: The ID of the route table in which you want to delete a route.

  • destination-cidr-block: The destination range of IPs of the route to delete, in CIDR notation.

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

The specified route is deleted.

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.