Creating a Route Table

You can create a route table that you can associate to one or more Subnets to control their traffic routing. Once your route table is created, you can create routes in it to custom how traffic is routed within its associated Subnets.

Every route table contains the local route that routes traffic targeting an IP of the Net CIDR block locally. This route cannot be modified or deleted.

Creating a Route Table Using Cockpit v2

Before you begin: Create a Net. For more information, see Creating a Net.

  1. In the Route Tables dashboard, click IconAddFull Create Route Table.
    The CREATE ROUTE TABLE dialog box appears.

  2. In the Name field, type a name for the route table.

    This action adds a Name tag of 255 characters maximum. You can use any character, including accented letters.

  3. From the Net list, select the Net for which you want to create the route table.

  4. Click Create Route Table.
    The route table is created.

Creating a Route Table Using OSC CLI

Before you begin: Create a Net. For more information, see Creating a Net.

The CreateRouteTable command creates a route table for a specified Net.
You can then add routes and associate this route table with a Subnet.

For more information, see About Route Tables.

Request sample
$ osc-cli api CreateRouteTable --profile "default" \
    --NetId "vpc-12345678"

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.

  • NetId: The ID of the Net for which you want to create a route table.

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

Creating a Route Table Using AWS CLI

Before you begin:

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

Request sample
$ aws ec2 create-route-table \
    --profile YOUR_PROFILE \
    --vpc-id vpc-12345678 \
    --endpoint https://fcu.eu-west-2.outscale.com

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

The create-route-table command returns the following elements:

  • RouteTable: Information about the newly created route table. This element contains the following information:

    • Association: One or more associations between the route table and subnets.

    • RouteTableId: The ID of the route table.

    • VpcId: The ID of the VPC.

    • PropagatingVgws: The ID of virtual private gateways (VGW) propagating routes using the 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 (only the local route at creation). This element contains the following information:

      • GatewayId: The target gateway used for the route (here, local).

      • DestinationCidrBlock: The destination range of IPs (here, the VPC CIDR block).

      • State: The state of the route.

Result sample
 {
    "RouteTable": {
        "Associations": [],
        "RouteTableId": "rtb-87654321",
        "VpcId": "vpc-123456782",
        "PropagatingVgws": [],
        "Tags": [],
        "Routes": [
            {
                "GatewayId": "local",
                "DestinationCidrBlock": "10.0.0.0/16",
                "State": "active"
            }
        ]
    }
}

The route table is created.

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.