Route tables#

General information#

Route tables contain a set of rules (routes), which are used to direct network traffic.

Each subnet in a VPC is associated with a route table. If necessary, you can associate a subnet with an arbitrary route table; subnets without an explicit association will be automatically associated with the main route table.

Glossary#

Route table – a route table you create for your VPC.

Main route table – a route table that is automatically added when you create a VPC. It controls the routing for all VPC subnets, which are not explicitly associated with a route table.

Route propagation – the propagation of learned routes. If this feature is enabled, your VPN connection routes will be dynamically included in the specified routing table.

Route – a route table entry containing information about where to direct traffic for IP addresses from the specified network.

Network – a range of IP addresses in CIDR notation for which you want to add a routing rule.

Gateway — a standard Internet gateway, VPN connection, instance, network interface or transit gateway where traffic should be routed according to the current rule.

Route selection algorithm#

The cloud uses the most accurate (priority) route for the network traffic, in accordance with the generally accepted rules for choosing the best route:

  • static routes have higher priority than dynamic ones;

  • the route with the longest subnet prefix will get higher priority if several routes are suitable for the packet;

  • if a suitable route for the packet is not found in the route table associated with the subnet, then the route lookup is now stopped and the packet is discarded.

Operations with route tables#

Create a route table#

  1. Go to Virtual machines Networking Route tables.

  2. Click Create.

  3. In the window that opens, fill in the following parameters:

    • Name tag (optional);

    • VPC, in which you want to create a route table.

  4. If you need to assign tags, proceed to the next step by clicking Add tags. Enter the tag key and value.

  5. After setting all the required parameters, click Create.

Associate a route table with a subnet#

To associate a subnet with an arbitrary route table:

  1. Go to Virtual machines Networking Route tables.

  2. Select the route table in the resource table.

  3. Click Associate with subnets.

  4. In the window that opens, select the subnets to associate the route table with.

  5. Click Assign.

This operation can also be performed on the page of the selected route table. To do this, go to the Subnets tab and click Associate with subnets.

A subnet can only be associated with one route table at a time, but you can associate one route table with multiple subnets.

Important

This operation will change traffic routing in the selected subnets according to the specified or main route table rules.

Note

You can explicitly associate the main route table with a subnet, even if they are already implicitly associated.

Select a main route table#

In K2 Cloud, you can use multiple route tables, but only one will be the main table. To set a selected route table as the main one, do the following:

  1. Go to Virtual machines Networking Route tables.

  2. Select the route table in the resource table.

  3. Click Set table as main.

  4. In the window that opens, click Set table as main once more to confirm the action.

This operation can also be performed on the page of the selected route table. To do this, go to the Information tab and click Set table as main.

This operation impacts routing rules of all subnets without explicit associations: all implicitly associated subnets will refer to the new main table, so additional confirmation is required to apply the changes. If you are sure that you need to change the main route table, in the dialog window, click again Set table as main.

Important

All implicitly associated subnets will use routing rules of the default table.

Disassociate a route table#

To disassociate a route table with a subnet:

  1. Go to Virtual machines Networking Route tables.

  2. Select the route table in the resource table.

  3. Click Disassociate.

  4. In the window that opens, select one or several subnets to be disassociated.

  5. In the window that opens, click Disassociate once more to confirm the action .

This operation can also be performed on the page of the selected route table. To do this, go to the Subnets tab, select the subnet and click Disassociate.

Important

This operation will change traffic routing in the selected subnets according to the specified or main route table rules.

Note

The main route table can only be disassociated from a subnet which it is explicitly associated with. If you cancel an explicit association of the main route table with a subnet, it will be implicitly associated with it.

Specify tags for a route table#

To add, modify or delete tags for a route table:

  1. Go to Virtual machines Networking Route tables.

  2. In the resource table, select the route table for which tags should be edited and click on the table ID to go to its page.

  3. Open the Tags tab.

  4. To add a tag, click Add tag and specify the Key and Value fields.

    To modify a tag, edit the required fields (Value and/or Key) of the respective tag.

    To delete a tag, click the icon next to the tag you no longer need.

    Note

    If no tags have been set earlier, you can add the Name tag by clicking Add Name tag and specifying its value.

    Note

    You can also modify the Name tag in the Information tab by editing the corresponding field.

  5. Click Apply to save the changes.

Delete a route table#

Important

You can delete a route table if it is not the main one and is not associated with any subnet.

  1. Go to Virtual machines Networking Route tables.

  2. In the resource table, select the route table and click Delete.

  3. In the window that opens, confirm the deletion.

This operation can also be performed on the page of the route table. To do this, go to the Information tab and click Delete.

Working with routing rules#

Go to the Routes tab on the route table page to get information about routing rules.

Each rule has a set of parameters:

  • Network – the range of IP addresses in CIDR notation where data is sent.

  • Gateway type — a standard Internet gateway, VPN connection, instance, network interface or transit gateway where traffic for the specified network should be routed.

  • Instance – ID of the instance this rule is related to.

  • State – information about the route state:

    • active – the route is active and used;

    • blackhole – a state in which traffic will be lost (for example, when a route goes through a VPN connection or instance’s network interface, which was deleted).

Add a route#

  1. Go to Virtual machines Networking Route tables.

  2. Find the route table in the resource table and click its ID to go to the route table page.

  3. In the Routes tab click Add.

  4. In the window that opens, set the following parameters:

    • network — the range of IP addresses in CIDR notation where data is sent;

    • gateway type — a standard Internet gateway, VPN connection, instance, network interface or transit gateway where traffic for the specified network should be routed;

    • gateway — ID of the resource, which is used as a gateway (if applicable).

  5. Once all parameters are set, click Add.

Delete a route#

  1. Go to Virtual machines Networking Route tables.

  2. Find the route table in the resource table and click its ID to go to the route table page.

  3. In the Routes tab, select the route and click Delete.

  4. In the window that opens, confirm the deletion.

You can delete several routes at once.

Route table information#

For general information about the available route tables, see the Route tables section. To view all route tables in the project, select All VPC in the VPC filter. To display route tables of a particular VPC, select the desired VPC in the filter.

To view detailed information about a particular route table, go to Virtual machines Networking Route tables and select the desired table from the list. To facilitate the route table search, select its relevant VPC in the VPC filter or use the search function.

Once you have selected the desired route table, click its ID. In addition to general information, the route table page contains data on the established routes and subnets which it is associated with.

The Information tab displays the main parameters of the route table:

  • route table name (Name tag);

  • whether it is a main table (Yes/No);

  • number of subnets with which it is associated;

  • enabling route propagation (Yes/No);

  • ID of the VPC with which the table is associated.

Here you can also:

The Routes tab displays a table with details of routing rules:

  • network – the range of IP addresses in CIDR notation where network traffic is forwarded;

  • gateway type;

  • route creation method;

  • ID of the instance, which is used as a gateway (if applicable);

  • state.

The sequence and scope of the displayed data may vary depending on the table settings.

Here you can also add or delete a route.

The Subnets tab displays a table with details of subnets with which the route table is associated:

  • subnet ID;

  • subnet name;

  • IP address range of a subnet;

  • availability zone in which the subnet is located;

  • status of an explicit association with the route table.

Here you can also associate the table with other subnets and cancel the existing association.

The Tags tab displays all tags assigned to the route table. You can add new, modify existing, and delete no-longer-needed tags.