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
    • Cloud Desktop
    • SourceCraft Code Assistant
    • Container Registry
    • Managed Service for GitLab
    • Managed Service for Prometheus®
    • Cloud Functions
    • API Gateway
    • Yandex Cloud Postbox
    • Message Queue
    • Serverless Integrations
    • IoT Core
    • Data Streams
    • Serverless Containers
    • Cloud Notification Service
    • Yandex Query
    • 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
      • Renting a stock configuration server
      • Renting a custom-configured server
      • Getting information about a server
      • Reconfiguring a server
      • Connecting to the KVM console
      • Stopping and starting a server
      • Canceling a server rent
      • Restoring a server from quarantine
      • Uploading a custom OS image
      • Connecting an existing BareMetal server to Cloud Backup
      • Using the Rescue CD
      • Setting up a secondary private subnet
      • Switching the type of a network connected to a network interface
      • Configuring the MC-LAG aggregation group
      • Resetting a password on the server
      • Replacing a disk in a RAID array
      • Adding a new SSH key for a user
      • Restoring the OS bootloader
      • Analyzing server status using HWCheck
    • Overview
    • Integrating with other Yandex Cloud services
      • Overview
      • Stock server configurations
      • Custom server configuration
      • On-request server configuration
      • Overview
      • Public network
      • Private network
      • DHCP
      • MC-LAG
      • Restrictions in BareMetal networks
      • Overview
      • Images
      • Access management
      • Additional server settings
      • Management console
      • Monitoring metrics
    • Quotas and limits
  • Pricing policy
  • FAQ
  1. Step-by-step guides
  2. Servers
  3. Setting up a secondary private subnet

Setting up a secondary private subnet with a tagged VLAN on a server

Written by
Yandex Cloud
Updated at July 13, 2026
View in Markdown

In addition to the main private subnet, you can attach several secondary private subnets to the server's network interface (or the MC-LAG aggregation group) connected to a private network.

For information on how to attach or detach a secondary private subnet to a server, see this section.

Once you have changed the number or composition of secondary private subnets attached to the server, you need to configure the network interface in its operating system. Here is an example of how to configure a network interface in Linux Ubuntu 24.04 with Netplan:

  1. Connect to the server over SSH:

    ssh root@<server_public_IP_address>
    

    You can also access the server via the KVM console using your username and password.

  2. Find out the name of the Netplan configuration file:

    ls /etc/netplan/
    

    Result:

    50-cloud-init.yaml
    
  3. Open the Netplan configuration file with a text editor. In this guide, we use nano:

    nano /etc/netplan/50-cloud-init.yaml
    
  4. To configure secondary private subnets with tagged VLANs on a server, add the vlans section to the Netplan configuration that contains information about secondary private subnets attached to the server. The settings for servers without reserved network connections and servers with MC-LAG are different. For example:

    Server without network reservation
    Server with MC-LAG
    network:
        version: 2
        ethernets:
            etx1:
                dhcp4: true
                match:
                    macaddress: b4:2e:99:58:5b:cc
                set-name: etx1
            etx2:
                dhcp4: true
                match:
                    macaddress: b4:2e:99:58:5b:ce
                set-name: etx2
        vlans:
            myvlan:
                id: <VLAN_ID>
                link: <network_interface_name>
                addresses:
                    - <IP_address_of_server_in_secondary_subnet>
                routes:
                    - to: <secondary_subnet_CIDR>
                      via: <default_gateway_of_secondary_subnet>
    

    Where:

    • myvlan: ID the virtual network (VLAN) will be assigned in the OS.

      In the vlans section, create a separate section with a unique ID for each additional private subnet attached to the server.

    • <VLAN_ID>: Unique VLAN ID assigned to the private subnet. You can look up the VLAN ID in the VLAN field on the private subnet info page in the management console.

    • <network_interface_name>: Name assigned in the Netplan configuration (the ethernets section) to the network interface connected to a private network, e.g., etx1.

      To find out which of the server's network interfaces is connected to a private network, use its MAC address: the MAC address is indicated in the management console on the server information page under Network interfaces.

    • <server_IP_address_in_secondary_subnet>: IPv4 address the server will use in the secondary subnet, with the CIDR prefix, e.g., 192.168.1.10/24.

      This address must be available and belong to the secondary private subnet range.

      Note

      You can associate only a private subnet with disabled DHCP as an additional subnet for a server.

    • <additional_subnet_CIDR>: address range available in the additional private subnet in CIDR notation, e.g., 192.168.1.0/24.

    • <default_gateway_of_additional_subnet>: IPv4 address of the default gateway in the additional private subnet you are configuring, e.g., 192.168.1.1.

    network:
        version: 2
        ethernets:
            etx1:
                dhcp4: false
                match:
                    macaddress: 58:a2:e1:ad:38:2a
                set-name: etx1
            etx2:
                dhcp4: false
                match:
                    macaddress: 58:a2:e1:ad:38:2b
                set-name: etx2
            etx3:
                dhcp4: false
                match:
                    macaddress: b8:ce:f6:40:12:d6
                set-name: etx3
            etx4:
                dhcp4: false
                match:
                    macaddress: b8:ce:f6:40:12:d7
                set-name: etx4
        bonds:
            bond1:
                dhcp4: true
                interfaces:
                - etx3
                - etx1
                macaddress: b8:ce:f6:40:12:d6
                parameters:
                    lacp-rate: fast
                    mode: 802.3ad
                    transmit-hash-policy: layer3+4
            bond2:
                dhcp4: true
                interfaces:
                - etx4
                - etx2
                macaddress: b8:ce:f6:40:12:d7
                parameters:
                    lacp-rate: fast
                    mode: 802.3ad
                    transmit-hash-policy: layer3+4
        vlans:
            myvlan:
                id: <VLAN_ID>
                link: <network_interface_name>
                addresses:
                    - <IP_address_of_server_in_secondary_subnet>
                routes:
                    - to: <secondary_subnet_CIDR>
                      via: <default_gateway_of_secondary_subnet>
    

    Where:

    • myvlan: ID the virtual network (VLAN) will be assigned in the OS.

      In the vlans section, create a separate section with a unique ID for each additional private subnet attached to the server.

    • <VLAN_ID>: Unique VLAN ID assigned to the private subnet. You can look up the VLAN ID in the VLAN field on the private subnet info page in the management console.

    • <network_interface_name>: Name assigned in the Netplan configuration (the bonds section) to the aggregation group connected to a private network, e.g., bond1.

      Learn how to find out which aggregation group is connected to a private network in this section.

    • <server_IP_address_in_secondary_subnet>: IPv4 address the server will use in the secondary subnet, with the CIDR prefix, e.g., 192.168.1.10/24.

      This address must be available and belong to the secondary private subnet range.

      Note

      You can associate only a private subnet with disabled DHCP as an additional subnet for a server.

    • <additional_subnet_CIDR>: address range available in the additional private subnet in CIDR notation, e.g., 192.168.1.0/24.

    • <default_gateway_of_additional_subnet>: IPv4 address of the default gateway in the additional private subnet you are configuring, e.g., 192.168.1.1.

    If you have detached all secondary private subnets from the server, delete the vlans section from the settings file.

  5. Apply updated Netplan settings:

    netplan apply
    

Tip

If you made a mistake and created a VLAN for the wrong network interface (aggregation group):

  1. Adjust the settings in the Netplan configuration file.

  2. Delete the wrong VLAN interface. To do this, run this command, specifying its ID:

    ip link del myvlan
    
  3. Apply updated Netplan settings:

    netplan apply
    

Useful linksUseful links

  • Reserving a BareMetal network connection using MC-LAG
  • Network

Was the article helpful?

Previous
Reinstalling the OS from your ISO image
Next
Switching the type of a network connected to a network interface
© 2026 Direct Cursus Technology L.L.C.