Yandex Cloud
Search
Contact UsGet started
  • Pricing
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • ML Services
    • Business tools
  • 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
  • Pricing
  • Customer Stories
  • Documentation
  • Blog
© 2025 Direct Cursus Technology L.L.C.
Yandex BareMetal
  • Getting started
    • All guides
      • Creating a VRF
      • Creating a private subnet
      • Ordering a dedicated public subnet
      • Creating a private connection to cloud networks
    • Overview
      • Overview
      • Server configurations
      • Disk status analysis
      • Additional server settings
      • Overview
      • DHCP
      • MC-LAG
      • Restrictions in BareMetal networks
    • Images
    • Quotas and limits
    • All tutorials
    • Connecting an existing BareMetal server to Cloud Backup
    • Configuring VRRP for a cluster of BareMetal servers
    • Establishing network connectivity in a BareMetal private subnet
    • Establishing network connectivity between BareMetal and Virtual Private Cloud private subnets
    • Establishing network connectivity between a BareMetal private subnet and on-premise resources
    • Delivering USB devices to a BareMetal server or virtual machine
    • Configuring an OPNsense firewall in high availability cluster mode
    • Deploying a web app on BareMetal servers with an L7 load balancer and Smart Web Security protection
  • Monitoring metrics
  • Audit Trails events
  • Access management
  • Pricing policy
  • 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 July 22, 2025
Management console
CLI
  1. In the management console, select the folder where you want to create a private subnet.

  2. In the list of services, select 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:

    • 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.
  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.

  11. Click Create subnet.

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.

  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 "vrf-id=<VRF_ID>,vrf-name=<VRF_name>,cidr=<CIDR>,gateway-ip=<gateway_ID_address>,dhcp=[start-ip=<IP_address_range_start>,end-ip=<IP_address_range_end>]"
    

    Where:

    • --hardware-pool-id: Pool to lease a server from.

    • --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.

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

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

      • vrf-name: VRF name.

      • cidr: Subnet CIDR.

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

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

      • dhcp: IP address range for assigning addresses using DHCP to server network interfaces. This is an optional parameter.

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

ExampleExample

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

CLI
yc baremetal private-subnet create \
  --hardware-pool-id ru-central1-m3 \
  --name demo-private-subnet \
  --description "My first private subnet" \
  --labels env=test \
  --hardware-pool-id ru-central1-m3 \
  --vrf-options "vrf-id=ly5j5qluq32z********,cidr=10.0.0.0/8,gateway-ip=10.0.0.1,dhcp=[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

Was the article helpful?

Previous
Creating a VRF
Next
Ordering a dedicated public subnet
© 2025 Direct Cursus Technology L.L.C.