Virtual Private Clouds (VPC)
In this article:
Virtual Private Clouds (VPC)#
General information#
Virtual Private Cloud (VPC) provides an isolated network environment for running K2 Cloud services. VPC is analogous to Virtual Routing and Forwarding (VRF) on classic hardware routers. By default, subnets in different VPCs do not have IP connectivity, while subnets in one VPC are interconnected, thus forming a “routing domain”. IP connectivity between subnets inside a region is ensured regardless of which availability zone they are created in.
Users get complete control over the virtual network environment and can configure the VPC as they want: set their own address space, create subnets, and configure route tables. In addition, two-level traffic filtering using network access control lists (ACL) and security groups allows you to control access to resources deployed in the VPC.
In each project, a default VPC is created along with an attached internet gateway. A route through the gateway to the Internet (to 0.0.0.0./0
) is automatically added to the main route table of this VPC. Other VPCs are created without an internet gateway. If Internet access is required for instances in these VPCs, you can, for example, connect them to the default VPC using a transit gateway, or create and attach an internet gateway to them. Either way, you will also need to configure routing.
In the VPC, you can create and/or configure the following services:
Subnets to perform additional resource segmentation within a VPC;
Instances to run servers and applications;
Network Interfaces to flexibly connect instances to subnets;
Route tables to define traffic forwarding rules;
ACL (or network access control lists) to filter traffic between networks;
Security groups to filter traffic on network interfaces;
DHCP options to fine-tune DHCP server;
VPN connections to establish a secure connection between the VPC and user infrastructure;
internet gateway to establish Internet access.
Note
Built-in VPC components such as a VPN gateway are not explicitly defined and cannot be configured by a user.
Note
Elastic IP addresses are created within the project and are bound to a specific VPC only when they are assigned to a network interface.
Публичные IP-адреса#
Important
Для анонсирования публичных IP-адресов K2 Cloud использует ASN 51219.
Ресурсам в VPC могут назначаться публичные IP-адреса из следующих диапазонов:
5.8.180.0/23
5.35.73.0/24
5.35.74.0/23
5.35.76.0/22
81.23.10.0/23
91.184.232.0/22
91.184.236.0/23
93.183.64.0/22
178.216.96.0/21
185.12.28.0/23
185.12.30.0/24
185.102.122.0/24
194.242.120.0/22
217.73.57.0/24
217.73.58.0/23
217.73.60.0/24
217.73.62.0/23
Эти IP-адреса используются при доступе в интернет с помощью NAT, в качестве Elastic IP-адресов, для назначения туннелям VPN-соединения и других сервисах K2 Cloud.
Create and delete VPC#
When creating a project, a default VPC is automatically created, where you can run instances right away. Along with the VPC, one subnet is created in each availability zone. You can use the default VPC, or you can create your own. If you don’t need a default VPC, you can delete it.
Creating a default VPC#
Если в проекте нет VPC по умолчанию, то его можно создать:
Перейдите в раздел Виртуальные машины Сеть VPC.
Выберите в меню создания VPC Создать VPC по умолчанию.
In the dialog window, set the following parameters:
(Optional) Name tag.
CIDR-блок — IP-адрес подсети в нотации CIDR (<адрес сети>/<префикс сети>). VPC по умолчанию имеет адресное пространство
172.31.0.0/16
. Вместе с VPC в каждой зоне доступности будет создана подсеть по умолчанию. Подсети по умолчанию имеют размер /20 и используют последовательные блоки адресов.
Если необходимо назначить дополнительные теги, перейдите на следующий шаг, нажав Добавить теги. Укажите ключ тега и его значение.
After setting all the required parameters, click Create.
Созданное VPC будет отображаться в таблице ресурсов в подразделе VPC. Посмотреть информацию о настройках VPC, а также изменить их можно на вкладке Информация на странице этого VPC.
Creating a VPC#
Чтобы создать новое VPC:
Перейдите Виртуальные машины Сеть VPC и нажмите Создать.
Либо нажмите стрелку рядом с кнопкой Создать и выберите Создать VPC.
In the dialog window, set the following parameters:
(Optional) Name tag.
CIDR-блок — IP-адрес подсети в нотации CIDR (<адрес сети>/<префикс сети>).
Important
В дальнейшем все подсети в данном VPC можно будет создавать только в пределах выбранного диапазона адресов.
Important
CIDR prefix may have values from /16 to /28.
The CIDR block of an existing VPC cannot be changed. Therefore, the address range should be selected with further scaling and connectivity to other networks in mind. On the one hand, the VPC must accommodate the required number of subnets, and, on the other hand, the selected range must not overlap with the address spaces of the networks in the connected infrastructure.
Если необходимо назначить дополнительные теги, перейдите на следующий шаг, нажав Добавить теги. Укажите ключ тега и его значение.
After setting all the required parameters, click Create.
Созданное VPC будет отображаться в таблице ресурсов в подразделе VPC. Посмотреть информацию о настройках VPC, а также изменить их можно на вкладке Информация на странице этого VPC.
Deleting VPC#
Attention
To delete a VPC, first delete the instances, network interfaces and VPN connections that were created in this VPC, and disconnect external networks.
Перейдите в раздел Виртуальные машины Сеть VPC.
Выберите виртуальное частное облако в таблице ресурсов и нажмите Удалить.
In the dialog window, confirm the deletion.
Кроме того, вы можете удалить VPC на его странице. Для этого на вкладке Информация нажмите Удалить и подтвердите действие.
Additional VPC settings#
Назначить параметры DHCP#
When a VPC is created, a distributed DHCP server is created with a set of default DHCP options as well. If you need, for example, to specify your DNS or NTP server, you can specify extra DHCP options in addition to mandatory options. How to do this is described in detail in DHCP documentation.
Чтобы установить предварительно созданный набор параметров DHCP:
Перейдите в раздел Виртуальные машины Сеть VPC.
Выберите VPC в таблице ресурсов и нажмите Назначить параметры DHCP.
В открывшемся окне выберите нужный набор параметров DHCP из списка и нажмите Назначить.
Либо вы можете перейти на страницу VPC и отредактировать Параметры DHCP на вкладке Информация — для этого выберите нужный набор параметров из раскрывающегося списка.
Сбросить параметры DHCP#
Чтобы вернуть параметры DHCP по умолчанию:
Перейдите в раздел Виртуальные машины Сеть VPC.
Выберите VPC в таблице ресурсов и нажмите Сбросить параметры DHCP.
В открывшемся окне подтвердите действие, нажав Сбросить.
Либо вы можете перейти на страницу VPC и отредактировать Параметры DHCP на вкладке Информация — для этого выберите набор default из раскрывающегося списка.
Enabling/disabling DNS support#
In K2 Cloud, each VPC has a DNS server enabled by default. It allows you to find the internal IP addresses of instances and IP addresses of external resources by their DNS names.
VPC’s DNS server is accessible at the first used IP address of each subnet. For example, if a subnet address is 172.31.0.0/24
, then the DNS server will handle requests at the IP address 172.31.0.1.
Перейдите в раздел Виртуальные машины Сеть VPC.
Найдите в таблице ресурсов нужное VPC и нажмите на идентификатор для перехода на его страницу.
На вкладке Информация переведите переключатель Поддержка DNS в нужное положение.
Включить распространение маршрутов#
For dynamic routing over VPN connections, BGP is used. To allow instances in a VPC to use BGP-advertised routes, they must be added to a route table. This is done with the Route propagation feature.
Чтобы включить распространение маршрутов:
Перейдите в раздел Виртуальные машины Сеть VPC.
Найдите в таблице ресурсов нужное VPC и нажмите на идентификатор для перехода на его страницу.
На вкладке Информация выберите целевую таблицу маршрутизации, куда будут устанавливаться маршруты, из раскрывающегося списка для параметра Распространение маршрутов.
Отключить распространение маршрутов#
Чтобы отключить распространение маршрутов:
Перейдите в раздел Виртуальные машины Сеть VPC.
Найдите в таблице ресурсов нужное VPC и нажмите на идентификатор для перехода на его страницу.
На вкладке Информация перейдите в режим редактирования параметра Распространение маршрутов, нажмите на кнопку очистки поля ввода и подтвердите действие.
Information about a VPC#
General information about VPCs can be viewed in the resource table in Virtual machines Networking VPC. To open a page with a particular VPC, click its ID in the resource table in the VPC subsection.
The Information tab displays the main VPC parameters:
VPC name (Name tag);
whether it is a default VPC (Yes/No);
state;
selected DHCP parameter set;
target route table, if route propagation is enabled;
CIDR — IP address of the subnet;
attached internet gateway;
DNS support option (toggle switch).
Here you can:
modify VPC name (Name tag);
The Tags tab displays all tags assigned to the VPC. You can add new, modify existing, and delete no-longer-needed tags.