Skip to main content
Public subnets
Last update:

Public subnets

A public subnet is a range of public static IP addresses limited by a prefix (mask) size. All devices on the public subnet have a public IP address and access to and from the Internet. You can configure public subnet access for a cloud server, cloud load balancer, and cloud database cluster — see the instructions for details Set up access to and from the Internet.

IP addresses from the public subnet are not processed cloud router with 1:1 NAT, but connect directly to devices: cloud server, cloud load balancer, cloud database cluster. Because of the lack of NAT, this type of device connection to the Internet is more resilient and faster, but less secure than connecting via a public IP address.

Devices on a public subnet communicate with each other through public interfaces.

A public subnet can only be used within a single projects and one pool.

Within public subnets there are limits on the amount of traffic — bandwidth. You can see it in the table Throughput.

You can work with public subnets in the control panels or Terraform.

Size of public subnets

Public subnets ranging in size from /29 (five free IPv4 addresses) to /24 (253 free IPv4 addresses) are available. Three service IP addresses are reserved in each public subnet:

  • The first IP address is the network address;
  • the second IP address is the gateway address;
  • the last IP address is a broadcast address.

The remaining IP addresses can be assigned to devices.

Example for a subnetwork 192.0.2.0/29 — five addresses are available:

  • 192.0.2.0 is the network address;
  • 192.0.2.1 is the gateway address;
  • 192.0.2.2 is usable;
  • 192.0.2.3 is usable;
  • 192.0.2.4 is usable;
  • 192.0.2.5 is usable;
  • 192.0.2.6 is usable;
  • 192.0.2.7 is the broadcast address.

If you run out of free IP addresses on the public subnet, you can create a new public subnet.

Automatic public subnet settings

Public subnets specify default settings: default gateway and DNS servers. The settings are automatically applied to the devices on the subnet.

Default gateway

When you create a public subnet, a second IP address is reserved for the default gateway. The default gateway on a public subnet cannot be changed.

DNS servers

When you create a public subnet, Selectel DNS servers are automatically assigned to the devices on the subnet. You can change the DNS servers by subnetting or modify after creation.

Static routes

By default, subnets do not have static routes specified. For public subnets, you can configure static routes.

Create a public subnet

  1. В control panels go to Cloud platformNetwork.
  2. Open the tab Public subnets.
  3. Click Create a subnet.
  4. Select pool, a public subnet will be created.
  5. Select subnet size — the range of IP addresses available on the subnet.
  6. Optional: To change the DNS servers, tap . Enter one to three values. Press .
  7. Click Create.

Configure public subnet access in different projects

By default, a public subnet can only be used within a single projects and one pool. You can configure public subnet sharing in different projects within the same account. The subnet will also be available only within the same pool.

The public subnet will have a tag Кросспроектная. You will only be able to manage the subnet in the project in which the subnet resides.

  1. В control panels go to Cloud platform.
  2. Copy the ID of the destination project with which you want to share the subnet. Open the projects menu (name of the current project) and in the line of the desired project click on .
  3. Make sure you are in the project in which the subnet is located. Open the projects menu (name of the current project) and select the source project.
  4. Go to the section Cloud platformNetwork.
  5. Open the tab Public subnets.
  6. Open the network card → tab Projects.
  7. Click Add project.
  8. Paste the destination project ID you copied in step 2.
  9. Click .

Configure IPv6 addressing for a public subnet

Public subnets can be used simultaneously with IPv4 and IPv6 addressing. An IPv6 subnet of size /64 can be added to any IPv4 subnet.

  1. Create a ticket with a request to connect IPv6 addressing for the public subnet.
  2. Configure the public subnet network interface on the cloud server.

Create a ticket

  1. Create a ticket with a request to connect IPv6 addressing for a public subnet. Specify:

    • The ID of the project in which the public subnet is located. You can copy it to control panels: go to the section Cloud platform → open the project menu (name of the current project) → in the line of the desired project, click ;
    • CIDR of a public IPv4 subnet. Can be copied to control panels: go to the section Cloud platformNetwork → tab Public subnets → in the subnet card, tap ;
    • poolwhere the public subnet is located.
  2. We will send the IPv6 subnet data in the ticket. Public IPv6 subnets are not displayed in the control panel.

Configure the public subnet network interface

Configure the public subnet network interface on the cloud server. Use when configuring:

  • The default gateway is the first address of the public IPv6 subnet (::1);
  • the mask of the public IPv6 subnet — /64;
  • Selectel DNS servers: 2a00:ab00:2000:1::53, 2a00:ab00:1000::53, 2a00:ab00::53.

Change the DNS servers on the public subnet

When you create a public subnet on devices in the subnet, the following are automatically assigned to the subnet Selectel recursive DNS servers. DNS servers can be changed by creating a public subnet or for an existing public subnet.

  1. В control panels go to Cloud platformNetwork.
  2. Open the tab Public networks.
  3. Open the public subnet card → tab Subnetworks.
  4. In the subnet row, in the column DNS servers click .
  5. Enter one to three values.
  6. Click .

Delete a public subnet

  1. В control panels go to Cloud platformNetwork.
  2. Open the tab Public subnets.
  3. On the menu. on the public subnet, select Delete subnet.
  4. Enter the subnet address to confirm the deletion.
  5. Click Delete.