Yandex Cloud
Search
Discuss with expertTry it for free
  • Customer Stories
  • Documentation
  • Blog
  • All Services
    • Cloud Interconnect
    • Cloud Backup
    • Cloud Registry
    • Yandex AI Studio
    • Compute Cloud
    • Object Storage
    • Managed Service for Kubernetes®
    • Yandex BareMetal
    • Smart Web Security
    • Security Deck
    • Managed Service for PostgreSQL
    • Managed Service for ClickHouse®
    • Monium
    • Cloud CDN
    • Network Load Balancer
    • Virtual Private Cloud
    • Cloud DNS
    • Application Load Balancer
    • Yandex Cloud Video
    • Stackland
    • Yandex Cloud Router
    • Yandex Managed Service for Trino
    • Managed Service for MySQL®
    • Managed Service for Valkey™
    • Managed Service for Apache Spark™
    • Yandex StoreDoc
    • Managed Service for OpenSearch
    • Managed Service for Apache Kafka®
    • Data Transfer
    • Yandex MPP Analytics Engine for PostgreSQL
    • Yandex Managed Service for Apache Airflow®
    • Data Processing
    • Yandex MetaData Hub
    • Managed Service for YDB
    • Managed Service for Sharded PostgreSQL
    • Managed Service for YTsaurus
    • Yandex WebSQL
    • DataLens
    • Yandex Search API
    • SpeechSense
    • SpeechKit
    • DataSphere
    • Vision OCR
    • Translate
    • Yandex Identity Hub
    • Key Management Service
    • Certificate Manager
    • Yandex Lockbox
    • Audit Trails
    • SmartCaptcha
    • Yandex SIEM
    • SourceCraft Code Assistant
    • Container Registry
    • Managed Service for GitLab
    • Managed Service for Prometheus®
    • Cloud Functions
    • API Gateway
    • Yandex Cloud Postbox
    • Message Queue
    • IoT Core
    • Data Streams
    • Serverless Containers
    • Cloud Notification Service
    • Identity and Access Management
    • Yandex Cloud Console
    • Resource Manager
    • Yandex Cloud Billing
    • Yandex Cloud Quota Manager
    • Cloud Apps
  • System Status
  • Marketplace
    • Featured
    • Infrastructure & Network
    • Data Platform
    • AI for business
    • Security
    • DevOps tools
    • Serverless
    • Monitoring & Resources
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
    • Price calculator
    • Pricing plans
  • Customer Stories
  • Documentation
  • Blog
© 2026 Direct Cursus Technology L.L.C.
Yandex BareMetal
    • All guides
      • Creating a VRF
      • Creating a private subnet
      • Configuring DNS in a private subnet
      • Ordering a dedicated public subnet
      • Deleting a dedicated public subnet
      • Creating a private connection to cloud networks
      • Creating a static route
    • Overview
    • Integrations with other Yandex Cloud services
      • Overview
      • Stock server configurations
      • Custom server configuration
      • On-request server configuration
      • Overview
      • Extend: Virtualization
      • Extend: Yandex Cloud Stackland
      • Extend: Managed Service for Kubernetes®
      • Overview
      • Public network
      • Private network
      • DHCP
      • DNS in a private network
      • MC-LAG
      • Restrictions in BareMetal networks
      • Overview
      • Images
      • Access management
      • Additional server settings
      • Management console
      • Monitoring metrics
    • Quotas and limits
  • Pricing policy
  • Release notes
  • FAQ
  1. Step-by-step guides
  2. Network
  3. Creating a private subnet

Creating a private subnet

Written by
Yandex Cloud
Improved by
Danila N.
Updated at November 2, 2026
View in Markdown
Management console
CLI
API
  1. In the management console, select the folder where you want to create a private subnet.

  2. Navigate to BareMetal.

  3. In the left-hand panel, select Private subnets.

  4. At the top right, click Create subnet.

  5. In the Availability zone field, select the availability zone where your server will be located.

  6. In the Pool field, select the pool containing available servers for leasing.

  7. In the Name field, specify your subnet name. The naming requirements are as follows:

    • Length: between 3 and 63 characters.
    • It can only contain lowercase Latin letters, numbers, and hyphens.
    • It must start with a letter and cannot end with a hyphen.
  8. Optionally, you can add a subnet Description.

  9. Optionally, you can add labels.

  10. Optionally, configure routing to allow communication with servers from other pools:

    1. Enable IP addressing and routing.

    2. In the Virtual network segment (VRF) field, select an existing VRF or create a new one.

    3. In the CIDR field, specify the subnet CIDR.

    4. In the Default gateway field, specify the gateway IP address for routing traffic from this subnet to other VRF-connected subnets.

      By default, the gateway IP address is the first available address in the specified subnet CIDR range.

    5. Optionally, enable Assigning IP addresses via DHCP to allow network interfaces on the private subnet to obtain IP addresses automatically.

    6. If you have enabled Assigning IP addresses via DHCP, specify an IP address range for assigning addresses to server network interfaces.

      By default, the assigned range matches the subnet’s CIDR block.

    7. Optionally, if DHCP is enabled, configure the DNS servers and domain name to provide to servers within the subnet:

      1. Enable the DNS server option.
      2. In the Domain name server field, select the inbound DNS connection from the list or enter the IPv4 address of your own DNS server and add it to the list.
      3. Optionally, to specify another DNS server, click Add server and select an inbound DNS connection or enter an IPv4 address. You can specify up to three DNS servers.
      4. Optionally, in the Domain name field, specify the search domain without leading or trailing dots, e.g., example.internal. When resolving short names, the OS will automatically append this domain: app → app.example.internal. Make sure all specified DNS servers can resolve names within this domain.

      To use an incoming DNS connection, first configure network connectivity between the VRF and the Virtual Private Cloud cloud network, then create a DNS connection in that network. Selecting a DNS server does not create routes or check its availability.

  11. Click Create subnet.

If you do not have the Yandex Cloud CLI yet, install and initialize it.

The folder used by default is the one specified when creating the CLI profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also specify a different folder for any command using --folder-name or --folder-id.

If you access a resource by its name, the search will be limited to the default folder. If you access a resource by its ID, the search will be global, i.e., through all folders based on access permissions.

To configure DNS, use CLI version 1.37.0 or higher.

  1. View the description of the command for creating a private subnet:

    yc baremetal private-subnet create --help
    
  2. Create a subnet:

    yc baremetal private-subnet create \
      --hardware-pool-id <pool> \
      --name <private_subnet_name> \
      --description "<private_subnet_description>" \
      --labels <key>=<value> \
      --vrf-options-spec '{
        vrf-id=<VRF_ID>,
        cidr=<CIDR>,
        gateway-ip=<gateway_IP_address>,
        dhcp-options={
          start-ip=<IP_address_range_start>,
          end-ip=<IP_address_range_end>,
          dns-options={
            servers=[
              {server={dns-inbound-endpoint-id=<DNS_connection_ID>}}
            ],
            domain-name=example.internal
          }
        }
      }'
    

    Where:

    • --hardware-pool-id: Pool to lease a server from. This is a required setting.

    • --name: Subnet name. The naming requirements are as follows:

      • Length: between 3 and 63 characters.
      • 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 setting.

    • --labels: Subnet labels. This is an optional setting.

    • --vrf-options-spec: Routing settings for communication with servers from other pools. This is an optional setting. Possible settings:

      • vrf-id: ID of the virtual network segment (VRF).

      • cidr: Subnet CIDR.

      • gateway-ip: Gateway IP address for routing traffic from this subnet to other VRF-connected subnets. This is an optional setting.

        By default, the gateway IP address is the first available address in the specified subnet CIDR range.

      • dhcp-options: DHCP settings. If the section is not provided, DHCP in the subnet is disabled. In start-ip and end-ip, specify the start and end of your IP address range for assigning addresses to server network interfaces.

        By default, the assigned range matches the subnet’s CIDR block.

        Under dns-options, you can customize DNS settings:

        • servers: List of DNS servers. For each server item, specify either dns-inbound-endpoint-id, i.e., the incoming DNS connection ID, or ip-address, i.e., the IPv4 address of a custom DNS server, e.g., {server={ip-address=192.168.10.2}}. You can specify up to three items, comma-separated. For an inbound DNS connection, configure network connectivity first. You can get the connection ID by running this command: yc dns inbound-endpoint list.
        • domain-name: Search domain. This is an optional parameter. Replace example.internal with a custom domain, or delete the parameter if you do not need a search domain.

        If you do not need DNS settings, delete the dns-options section.

To create a private subnet, use the create REST API method for the PrivateSubnet resource or the PrivateSubnetService/Create gRPC API call.

ExampleExample

Create a private subnet with a VRF, CIDR, default gateway, and IP address range:

CLI
API
yc baremetal private-subnet create \
  --hardware-pool-id ru-central1-m3 \
  --name demo-private-subnet \
  --description "My first private subnet" \
  --labels env=test \
  --vrf-options-spec '{
    vrf-id=ly5j5qluq32z********,
    cidr=10.0.0.0/8,
    gateway-ip=10.0.0.1,
    dhcp-options={start-ip=10.0.1.2,end-ip=10.0.1.10}
  }'

Result:

id: ly5p3zynykcg********
cloud_id: b1gia87mbaom********
folder_id: b1gcqo0asnc1********
name: demo-private-subnet
description: My first private subnet
status: READY
zone_id: ru-central1-m
hardware_pool_id: ru-central1-m3
vrf_options:
  vrf_id: ly5j5qluq32z********
  cidr: 10.0.0.0/8
  dhcp_options:
    start_ip: 10.0.1.2
    end_ip: 10.0.1.10
  gateway_ip: 10.0.0.1
created_at: "2025-06-26T13:28:29.348159Z"
labels:
  env: test
curl -X POST \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <IAM_token>" \
  -d '{
    "folderId": "b1g07hj5r6i4********",
    "hardwarePoolId": "ru-central1-m3",
    "name": "demo-private-subnet",
    "description": "My first private subnet",
    "labels": {
      "env": "test"
    },
    "vrfOptionsSpec": {
      "vrfId": "ly5uyq2gbxu2********",
      "cidr": "10.0.*.*/8",
      "dhcpOptions": {
        "startIp": "10.0.*.*",
        "endIp": "10.0.*.*"
      },
      "gatewayIp": "10.0.*.*"
    }
  }' \
  "https://baremetal.api.cloud.yandex.net/baremetal/v1alpha/privateSubnets"

Where:

  • <IAM_token>: IAM token used for authentication.

  • folderId: Folder ID.

  • hardwarePoolId: ID of the pool to lease a server from.

  • name: Subnet name. The naming requirements are as follows:

    • Length: between 3 and 63 characters.
    • 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.

  • vrfId: ID of the virtual network segment (VRF).

  • cidr: Subnet CIDR.

  • gatewayIp: Gateway IP address. This is an optional parameter.

  • startIp, endIp: Address range for DHCP. This is an optional parameter.

Result:

{
  "done": true,
  "metadata": {
    "@type": "type.googleapis.com/yandex.cloud.baremetal.v1alpha.CreatePrivateSubnetMetadata",
    "privateSubnetId": "ly52xefxa2hi********"
  },
  "response": {
    "@type": "type.googleapis.com/yandex.cloud.baremetal.v1alpha.PrivateSubnet",
    "vrfOptions": {
      "dhcpOptions":
      {
        "startIp": "10.0.*.*",
        "endIp": "10.0.*.*"
      },
      "vrfId": "ly5licxve4z3********",
      "cidr": "10.0.*.*/8",
      "gatewayIp": "10.0.*.*"
    },
    "labels": {
      "env": "test"
    },
    "id": "ly52xefxa2hi********",
    "cloudId": "b1gia87mbaom********",
    "folderId": "b1g07hj5r6i4********",
    "name": "demo-private-subnet",
    "description": "My first private subnet",
    "status": "READY",
    "zoneId": "ru-central1-m",
    "hardwarePoolId": "ru-central1-m3",
    "createdAt": "2025-12-14T14:42:58.372557Z"
  },
  "id": "ly5hcnsbx3l4********",
  "description": "Private subnet create",
  "createdAt": "2025-12-14T14:42:58.375290Z",
  "createdBy": "ajeb9l33h6mu********",
  "modifiedAt": "2025-12-14T14:42:58.375290Z"
}

Follow the status of the operation by the done field.

Was the article helpful?

Previous
Creating a VRF
Next
Configuring DNS in a private subnet
© 2026 Direct Cursus Technology L.L.C.