Ordering a dedicated public subnet
A dedicated public subnet is a public subnet made up of an IP address range that will be available to your servers in the selected pools.
You can lease a new dedicated public subnet or convert an existing ephemeral public subnet to a dedicated one.
Leasing a new dedicated public subnet
-
In the management console
, select the folder where you want to reserve a dedicated public subnet. -
In the list of services, select BareMetal.
-
In the left-hand panel, select
Public addresses and subnets. -
At the top right, click Order a public subnet.
-
In the Availability zone field, select the availability zone where the subnet will be available.
-
In the Pool field, select the pools where the subnet will be available.
You can link a dedicated public subnet to multiple pools at once.
-
Select the size of the subnet you want to order.
In the management console, you can only order subnets of size
/29(six available IP addresses) and/28(14 available IP addresses). If you need a larger public subnet, contact support to request it. -
Under General information:
- In the Name field, enter the name of the public subnet.
- (Optional) In the Description field, add a subnet description.
- (Optional) In the Labels field, set the labels.
-
Click Order.
If you do not have the Yandex Cloud CLI installed yet, install and initialize it.
By default, the CLI uses the folder specified when creating the profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also set a different folder for any specific command using the --folder-name or --folder-id parameter.
-
View the description of the command for leasing a new dedicated public subnet:
yc baremetal public-subnet create --help -
Lease a subnet:
yc baremetal public-subnet create \ --hardware-pool-id <pool> \ --prefix-length 29 \ --name <public_subnet_name> \ --description "<public_subnet_description>" \ --labels <key>=<value>Where:
-
--hardware-pool-id: Pools where the subnet will be available.You can link a dedicated public subnet to multiple pools at once.
-
--prefix-length: Size of the subnet you want to order.You can only order subnets of size
/29(six available IP addresses) and/28(14 available IP addresses). -
--name: Subnet name. The naming requirements are as follows:- It must be from 2 to 63 characters long.
- It can only contain lowercase Latin letters, numbers, and hyphens.
- It must start with a letter and cannot end with a hyphen.
-
--description: Subnet description. This is an optional parameter. -
--labels: Subnet labels. This is an optional parameter.
-
Converting an ephemeral public subnet to a dedicated one
Note
You can only convert an ephemeral public subnet to a dedicated public subnet of size /31.
- In the management console
, select the folder containing the ephemeral public subnet you want to convert to a dedicated one. - In the list of services, select BareMetal.
- In the left-hand panel, select
Public addresses and subnets. - In the list of public subnets that opens, in the ephemeral subnet row, click
and select Make dedicated. -
In the Pool field, select the pools where the subnet will be available.
You can link a dedicated public subnet to multiple pools at once.
-
Under General information:
- In the Name field, enter the name of the public subnet.
- (Optional) In the Description field, add a subnet description.
- (Optional) In the Labels field, set the labels.
- Click Order.
-
View the description of the command for transforming an ephemeral public subnet:
yc baremetal public-subnet update --help -
Transform the subnet:
yc baremetal public-subnet update \ --id <ephemeral_public_subnet_ID> \ --type dedicated \ --hardware-pool-id <pool> \ --name <public_subnet_name> \ --description "<public_subnet_description>" \ --labels <key>=<value>Where:
-
--id: ID of the ephemeral public subnet. -
--type: Type to transform the subnet into. -
--hardware-pool-id: Pools where the subnet will be available.You can link a dedicated public subnet to multiple pools at once.
-
--name: Subnet name. -
--description: Subnet description. This is an optional parameter. -
--labels: Subnet labels. This is an optional parameter.
-
Examples
Leasing a new dedicated public subnet
Lease a new dedicated public subnet of the /29 size:
yc baremetal public-subnet create \
--hardware-pool-id ru-central1-m3 \
--prefix-length 29 \
--name demo-public-subnet \
--description "My first public subnet" \
--labels env=test
Result
id: ly5jmqxxrcsu********
cloud_id: b1gia87mbaom********
folder_id: b1g0ijbfaqsn********
name: demo-public-subnet
description: My first public subnet
zone_id: ru-central1-m
hardware_pool_ids:
- ru-central1-m3
type: DEDICATED
prefix_length: "29"
cidr: 94.139.248.184/29
gateway_ip: 94.139.248.185
created_at: "2025-06-26T14:11:49.458568Z"
labels:
env: test
Transforming an ephemeral public subnet into a dedicated one
Change the public subnet type from ephemeral to dedicated:
yc baremetal public-subnet update \
--id ly5vr6tugxk7******** \
--type dedicated \
--description "Transformed dedicated public subnet"
Result
id: ly5vr6tugxk7********
cloud_id: b1gia87mbaom********
folder_id: b1g0ijbfaqsn********
name: transformed-public-subnet
description: Transformed dedicated public subnet
zone_id: ru-central1-m
hardware_pool_ids:
- ru-central1-m3
type: DEDICATED
prefix_length: "29"
cidr: 94.139.248.184/29
gateway_ip: 94.139.248.185
created_at: "2025-06-26T14:11:49.458568Z"