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 Virtual Private Cloud (VPC) CIDR block locally. This route cannot be modified or deleted.

Creating a Route Table Using Cockpit

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

  1. Click Network/Security > Route Tables.

  2. Click Create .
    The CREATE ROUTE TABLE dialog box appears.

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

  4. From the VPC list, select the VPC for which you want to create the route table.

  5. Click Create to validate.
    The route table is created and appears on the Route Tables page.

    To identify your resources more easily, you can add tags to them. For more information, see Tagging Your Resources.

Creating a Route Table Using AWS CLI

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

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:

  • (optional) profile: The named profile you want to use, created when configuring AWS CLI. For more information, see Installing and Configuring AWS CLI.

  • vpc-id: The ID of the VPC.

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

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 Method

AWS™ and Amazon Web Services™ are trademarks of Amazon Technologies, Inc or its affiliates in the United States and/or other countries.