Skip to main content

Public subnets

A public subnet is a range of public static IP addresses bounded by the prefix (mask) size. All devices in a public subnet have a public IP address and access to and from the internet. You can configure access via a public subnet for a cloud server, cloud load balancer, and Managed Databases cluster — learn more in the Configure internet access instructions.

IP addresses from a public subnet are not processed by a cloud router using 1:1 NAT, but are connected directly to devices: cloud server, cloud load balancer, and Managed Databases cluster. Due to the lack of NAT, this type of device connection to the internet is more fault-tolerant and faster, but less secure than connecting via a public floating IP address.

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

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

Within public subnets, there are traffic volume limits — bandwidth. You can view it in the Bandwidth table.

You can work with public subnets in the Control Panel or Terraform.

Public subnet sizes

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

  • first IP address — network address;
  • second IP address — gateway address;
  • last IP address — broadcast address.

The remaining IP addresses can be assigned to devices.

Example for the 192.0.2.0/29 subnet — five addresses are available:

  • 192.0.2.0 — network address;
  • 192.0.2.1 — gateway address;
  • 192.0.2.2 — available for use;
  • 192.0.2.3 — available for use;
  • 192.0.2.4 — available for use;
  • 192.0.2.5 — available for use;
  • 192.0.2.6 — available for use;
  • 192.0.2.7 — broadcast address.

If there are no free IP addresses left in a public subnet, you can create a new public subnet.

Automatic public subnet settings

Default settings are specified for public subnets: default gateway and DNS servers. The settings are applied to devices in the subnet automatically.

Default gateway

When creating a public subnet, the second IP address is reserved for the default gateway. The default gateway in a public subnet cannot be changed.

DNS servers

When creating a public subnet, Selectel DNS servers are automatically configured on devices in the subnet. You can change DNS servers when creating a subnet or change them after creation.

Static routes

By default, static routes are not specified in subnets. For public subnets, you can configure static routes.

Create a public subnet

  1. In the Control Panel, go to Products → Cloud Servers.
  2. Go to the Network → Public subnets tab.
  3. Click Create subnet.
  4. Select the location where the public subnet will be created.
  5. Select the subnet size, which is the range of IP addresses available in the subnet.
  6. Optional: to change DNS servers, click . Enter between one and three values. Click .
  7. Click Create.

Configure access to a public subnet in different projects

By default, a public subnet can only be used within a single project and a single pool. You can configure shared access to a public subnet across different projects within the same account. The subnet will still only be available within a single pool.

The public subnet will receive the Cross-project tag. You will only be able to manage the subnet in the project where the subnet is located.

  1. In the Control Panel, in the top menu, click Products and select Cloud Servers.
  2. Go to Network → Public networks tab.
  3. Copy the ID of the recipient project with which you want to share the subnet. Open the project menu (name of the current project) and in the row of the desired project, click .
  4. Make sure you are in the project where the subnet is located.
  5. Open the network card → Projects tab.
  6. Click Add project.
  7. Paste the ID of the destination project that you copied in step 3.
  8. Click .

Change DNS servers in a public subnet

When creating a public subnet, Selectel recursive DNS servers are automatically configured on devices in the subnet. DNS servers can be changed when creating a public subnet or for an existing public subnet.

  1. In the Control Panel, in the top menu, click Products and select Cloud Servers.
  2. Go to Network → Public networks tab.
  3. Open the public subnet card → Subnets tab.
  4. In the subnet row, in the DNS servers column, click .
  5. Enter from one to three values.
  6. Click .

Delete a public subnet

  1. In the Control Panel, in the top menu, click Products and select Cloud Servers.

  2. Go to Network → Public networks tab.

  3. Open the subnet card → Ports tab.

  4. If there are ports with an inactive button, prepare them for deletion:

    4.1. In the Connected to column, see which device the port is connected to.

    4.2. Prepare the port for deletion depending on the device:

    • cloud server — switch the server to the status ACTIVE, PAUSED, or STOPPED;
    • any other device — delete the device, and the port will be automatically deleted along with the device.

    4.3. If there are still ports with an inactive button in the subnet, repeat steps 4.1–4.2 for each of them.

  5. Go to Network → Public networks tab.

  6. In the menu of the public subnet, select Delete subnet.

  7. Enter the subnet address to confirm the deletion.

  8. Click Delete.