Route tables
In this article:
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.
Key concepts#
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 in 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.
Billing#
Route tables are free of charge.
Available quotas#
The following default quotas are allocated to route tables:
20 route tables per a VPC;
50 static routes per a route table;
10,000 dynamic routes per a route table;
If necessary, you can increase quotas. To do this, contact the support service via the support portal or by email support@k2.cloud.
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#
In the top menu of the web interface, select the project and region where you want to create a route table.
Expand the side menu by clicking .
Перейдите в раздел Сеть Таблицы маршрутизации. Для быстрого нахождения раздела вы можете воспользоваться поиском по меню.
Click Create.
In the window that opens, specify the VPC, in which you want to create a route table.
If you need to set a tag, click Add tag and specify the tag key and value. To assign more tags, click Add tag again.
To complete the route table creation, click Create.
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.
Associate a route table with a subnet#
To associate an arbitrary route table with a subnet:
In the top menu of the web interface, select the project and region where you want to associate a route table with a subnet.
Expand the side menu by clicking .
Перейдите в раздел Сеть* Таблицы маршрутизации. Для быстрого нахождения раздела вы можете воспользоваться поиском по меню.
In the resource table, select the route table and click Associate with subnets on the pop-up action bar.
From the drop-down list, select the subnet with which the route table should be associated. You can select multiple subnets at once by ticking next to the desired subnets. To deselect, clear the checkbox.
In the window that opens, click Associate to confirm the action .
This operation can also be performed on the page of the selected route table. To do this, go to its page 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.
Select a main route table#
In K2 Cloud, you can use multiple route tables in each VPC, but only one can be the main table in a particular VPC.
In the top menu of the web interface, select the project and region where you want to set a route table as a main one.
Expand the side menu by clicking .
Перейдите в раздел Сеть Таблицы маршрутизации. Для быстрого нахождения раздела вы можете воспользоваться поиском по меню.
In the resource table, select the route table and click Set as main on the pop-up action bar.
In the window that opens, click Apply to confirm the action .
This operation can also be performed on the page of the selected route table. To do this, go to its page and click Set as main.
Important
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 Apply.
Important
All implicitly associated subnets will use routing rules of the default table.
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.
Disassociate a route table from a subnet#
To disassociate a route table with a subnet:
In the top menu of the web interface, select the project and region where you want to disassociate a route table from a subnet.
Expand the side menu by clicking .
Перейдите в раздел Сеть Таблицы маршрутизации. Для быстрого нахождения раздела вы можете воспользоваться поиском по меню.
In the resource table, select the route table and click Disassociate from networks on the pop-up action bar.
From the drop-down list, select the subnet from which the route table should be disassociated. You can select multiple subnets at once by ticking next to the desired subnets. To deselect, clear the checkbox.
In the window that opens, click Disassociate to confirm the action .
Alternatively, you can do it by navigating to the page of the selected route table and clicking Disassociate from subnets. If you don’t see this button, expand the additional action menu by clicking .
Specify tags for a route table#
To add, modify or delete tags for a route table:
In the top menu of the web interface, select the project and region where you want to set tags for a route table.
Expand the side menu by clicking .
Перейдите в раздел Сеть Таблицы маршрутизации. Для быстрого нахождения раздела вы можете воспользоваться поиском по меню.
Find the route table in the resource table and click its ID to go to the resource page.
Open the Tags tab and click Edit to set tags.
If no tags have been set before, you can set them by filling the Key and Value fields. To assign the next tag, click Add tag.
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.
To complete editing, click Save 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.
In the top menu of the web interface, select the project and region where you want to delete a route table.
Expand the side menu by clicking .
Перейдите в раздел Сеть Таблицы маршрутизации. Для быстрого нахождения раздела вы можете воспользоваться поиском по меню.
In the resource table, select the route table and click Delete in the pop-up action bar.
To confirm the action, click Delete in the window that opens. If you don’t see this button, expand the additional action menu by clicking .
This operation can also be performed on the page of the selected route table. To do this, go to its page 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, NAT gateway, VPN connection, instance, network interface, or transit gateway where traffic should be sent for the specified network.
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#
In the top menu of the web interface, select the project and region where you want to add a routing rule.
Expand the side menu by clicking .
Перейдите в раздел Сеть Таблицы маршрутизации. Для быстрого нахождения раздела вы можете воспользоваться поиском по меню.
Find the route table in the resource table and click its ID to go to the resource page.
In the Routes tab, click Add.
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, transit or NAT gateway where traffic for the specified network should be routed;
gateway — ID of the resource, which is used as a gateway (if applicable).
Once all parameters have beent set, click Create.
Delete a route#
In the top menu of the web interface, select the project and region where you want to delete a routing rule.
Expand the side menu by clicking .
Перейдите в раздел Сеть Таблицы маршрутизации. Для быстрого нахождения раздела вы можете воспользоваться поиском по меню.
Find the route table in the resource table and click its ID to go to the resource page.
In the Routes tab, select a route and click Delete in the pop-up action bar. You can select multiple routes at once by ticking the next to the desired routes. To deselect, clear the checkbox.
In the window that opens, click Delete to confirm the action .
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.
Для просмотра детальной информации о конкретной таблице маршрутизации перейдите в раздел Сеть Таблицы маршрутизации и выберите нужную таблицу из списка.
Для упрощения поиска таблицы маршрутизации вы можете в фильтре VPC выбрать VPC, в котором создана таблица, либо воспользоваться поиском.
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:
whether it is a main table (Yes/No);
number of subnets with which it is associated;
number of routing rules in this route table;
enabling route propagation (Yes/No);
ID of the VPC with which the route 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;
type of the gateway through which the traffic goes;
route creation method;
ID of the instance, which is used as a gateway (if applicable);
route state.
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 in CIDR notation;
availability zone in which the subnet is located;
status of an explicit association with the route table.
The Tags tab displays all tags assigned to the route table. You can add new, modify existing, and delete no-longer-needed tags.