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#
In the top menu of the web interface, select the project and region where you want to create an internet gateway.
Expand the side menu by clicking .
Go to Virtual machines Networking Internet gateways. To quickly find the section, you can use the menu search.
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.
To complete the creation of internet gateway, click Create.
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.
In the top menu of the web interface, select the project and region where you want attach an internet gateway to a VPC.
Expand the side menu by clicking .
Go to Virtual machines Networking Internet gateways. To quickly find the section, you can use the menu search.
In the resource table, select the internet gateway and click Attach on the pop-up action bar.
In the window that opens, select a VPC to which you want to attach the gateway.
Click Attach to complete the operation.
This operation can also be performed on the page of the internet gateway. To do this, go to the Information tab and click Attach and select the VPC from the drop-down list.
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.
In the top menu of the web interface, select the project and region where you want to detach an internet gateway from a VPC.
Expand the side menu by clicking .
Go to Virtual machines Networking Internet gateways. To quickly find the section, you can use the menu search.
In the resource table, select the internet gateway and click Detach on the pop-up action bar.
In the window that opens, confirm the detachment.
This operation can also be performed on the page of the internet gateway. To do this, go to the Information tab and click Detach.
Delete an internet gateway#
To delete an internet gateway, detach it first.
In the top menu of the web interface, select the project and region where you want to delete an internet gateway.
Expand the side menu by clicking .
Go to Virtual machines Networking Internet gateways. To quickly find the section, you can use the menu search.
In the resource table, select the internet gateway and click Delete on the pop-up action bar. You can select and delete several internet gateways at once.
In the window that opens, confirm the deletion.
This operation can also be performed on the page of the internet gateway. To do this, go to the Information tab and click Delete.
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.
In the top menu of the web interface, select the project and region where you want to set up routing for a subnet.
Expand the side menu by clicking .
Go to Virtual machines Networking Route tables. To quickly find the section, you can use the menu search.
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.Click Create to complete configuration.
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
Setup of alarms for Internet gateways is not available in the new web interface yet. Please use the previous version of the web interface.
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.
The Information tab displays the VPC to which the gateway is attached.
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.