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.

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

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.