Yandex Cloud
Search
Contact UsTry it for free
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • 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
      • Leasing a stock configuration server
      • Leasing a custom-configured server
      • Getting information about a server
      • Updating a server
      • Connecting to the KVM console
      • Stopping and starting a server
      • Canceling a server lease
      • Uploading a custom OS image
      • Connecting an existing BareMetal server to Cloud Backup
      • Using the Rescue CD
      • Setting up a secondary private subnet
      • 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
      • Disk status analysis
      • Analyzing server status using HWCheck
    • Overview
      • 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
      • Audit Trails events
      • Access management
      • Additional server settings
      • 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 March 9, 2026

In addition to the main private subnet, you can attach several additional 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. Here is an 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 Private network.

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

See alsoSee also

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

Was the article helpful?

Previous
Reinstalling the OS from your ISO image
Next
Configuring the MC-LAG aggregation group
© 2026 Direct Cursus Technology L.L.C.