Internet gateways
In this article:
Internet gateways#
General information#
An internet gateway provides connectivity between a VPC and the Internet that allows cloud resources to access the Internet and vice versa. For example, you can connect to an instance in the cloud from a local computer.
All VPCs (except for the default one) are created without an internet gateway. To allow a VPC to access the Internet, you must create a gateway, attach it to the VPC, and configure routing. The route table should specify a route (0.0.0.0/0) to the Internet through the gateway, or you can limit access to a specific range of public IP addresses, such as of your enterprise network.
If a subnet is associated with a route table that specifies a route through the internet gateway, then the subnet is called public. If the associated route table does not contain a route through the internet gateway, then the network is considered internal. Any instance on a public network can access the Internet regardless of whether it has a public IP address.
When instances with public IP addresses access the Internet, Network Address Translation (NAT) is applied. For outbound traffic, the instance’s internal IP address is replaced with its public IP address, and vice versa for inbound traffic.
To enable Internet access for instances without an Elastic IP address, source NAT is used (Masquerade). Public IP addresses used for this purpose are allocated dynamically by the cloud, so they are subject to change. Please do not include them in rules for ACLs, security groups, and other services, including third-party ones. NAT only applies when packets are sent from VPCs to the Internet.
Billing#
Internet gateways are not charged. Internet traffic (both inbound and outbound) is charged based on the actual amount in gibibytes (1 gibibyte = 1024 mebibytes = 230 bytes).
Any traffic to public IP addresses that does not leave the K2 Cloud region (for example, traffic between Elastic IP addresses in the same region or between Elastic IP addresses and any endpoint of the cloud platform API in the same region) is free of charge. Traffic between Elastic IP addresses in different K2 Cloud regions is charged as regular public traffic.
Available quotas#
The following default quotas are allocated to internet gateways:
2 internet gateways in a project.
If necessary, you can increase quotas. To do this, contact the support service via the support portal or by email support@k2.cloud.
Managing internet gateways#
Create an internet gateway#
В веб-интерфейсе в верхнем меню выберите проект и регион, где требуется создать интернет-шлюз.
Expand the side menu by clicking .
Перейдите в раздел Виртуальные машины Сеть Интернет-шлюзы. Для быстрого нахождения раздела вы можете воспользоваться поиском по меню.
Click Create.
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.
Для завершения создания интернет-шлюза нажмите Создать.
Attach an internet gateway#
An internet gateway can be attached only to a VPC without an attached gateway.
Important
If you attach an internet gateway to a VPC, from which it was detached earlier, then all routes through this gateway will become active again.
В веб-интерфейсе в верхнем меню выберите проект и регион, где требуется присоединить интернет-шлюз к VPC.
Expand the side menu by clicking .
Перейдите в раздел Виртуальные машины Сеть Интернет-шлюзы. Для быстрого нахождения раздела вы можете воспользоваться поиском по меню.
Выберите интернет-шлюз в таблице ресурсов и нажмите Присоединить на всплывающей панели действий.
In the window that opens, select a VPC to which you want to attach the gateway.
Click Attach to complete the operation.
Кроме того, эту операцию можно выполнить на странице интернет-шлюза. Для этого перейдите на вкладку Информация, нажмите Присоединить и выберите VPC из раскрывающегося списка.
Detach an internet gateway#
An internet gateway can only be detached if a VPC has no resources with public or Elastic IP addresses.
Important
After the gateway is detached, all routes through this internet gateway in the route tables of this VPC will become blackholed.
В веб-интерфейсе в верхнем меню выберите проект и регион, где требуется отсоединить интернет-шлюз от VPC.
Expand the side menu by clicking .
Перейдите в раздел Виртуальные машины Сеть Интернет-шлюзы. Для быстрого нахождения раздела вы можете воспользоваться поиском по меню.
Выберите интернет-шлюз в таблице ресурсов и нажмите Отсоединить на всплывающей панели действий.
Подтвердите отсоединение в открывшемся окне.
Кроме того, эту операцию можно выполнить на странице интернет-шлюза. Для этого перейдите на вкладку Информация и нажмите Отсоединить.
Delete an internet gateway#
To delete an internet gateway, detach it first.
В веб-интерфейсе в верхнем меню выберите проект и регион, где требуется удалить интернет-шлюз.
Expand the side menu by clicking .
Перейдите в раздел Виртуальные машины Сеть Интернет-шлюзы. Для быстрого нахождения раздела вы можете воспользоваться поиском по меню.
Выберите интернет-шлюз в таблице ресурсов и нажмите Удалить на всплывающей панели действий. Вы можете выбрать сразу несколько интернет-шлюзов для удаления.
In the window that opens, confirm the deletion.
Кроме того, эту операцию можно выполнить на странице интернет-шлюза. Для этого перейдите на вкладку Информация и нажмите Удалить.
Configuring Internet access#
If a VPC has no attached internet gateway, then to configure Internet access, do the following:
Configure Internet routing for a subnet.
Important
If a route table is associated with other subnets as well, then Internet access will be granted to them too. If you want to grant Internet access only from this particular subnet, then create a separate route table and associate it with the subnet.
В веб-интерфейсе в верхнем меню выберите проект и регион, где требуется настроить маршрутизацию для подсети.
Expand the side menu by clicking .
Перейдите в раздел Виртуальные машины Сеть Таблицы маршрутизации. Для быстрого нахождения раздела вы можете воспользоваться поиском по меню.
In the resource table, find the route table associated with this subnet and click its ID.
Open the Routes tab.
Click Add.
In the window that opens, enter
0.0.0.0/0in the Network field to grant access to all Internet addresses (or specify a particular subnet to restrict access) and selectStandard Internet gatewayin the Gateway type field.Нажмите Создать для завершения настройки.
After the routing is configured, verify that the subnet resources can access the Internet. For example, make sure that instances have Elastic IP addresses and their assigned security groups allow traffic to and from the Internet.
Alarm setup#
Important
Настройка алармов для интернет-шлюзов пока недоступна в новом веб-интерфейсе. Используйте предыдущую версию веб-интерфейса.
Internet gateway information#
General information about available internet gateways can be viewed in the resource table in Virtual machines Networking Internet gateways. To open a page of a particular internet gateway, click its ID in the resource table.
На вкладке Информация отображается VPC, к которому присоединён шлюз.
Here you can attach, detach or delete the gateway.
The Tags tab displays all tags assigned to the internet gateway. You can add new, modify existing, and delete no-longer-needed tags.