Yandex Cloud
Search
Contact UsGet started
  • Blog
  • Pricing
  • Documentation
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • ML & AI
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Customer Stories
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
  • Blog
  • Pricing
  • Documentation
Yandex project
© 2025 Yandex.Cloud LLC
Yandex Compute Cloud
  • Yandex Container Solution
  • Access management
  • Pricing policy
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • Release notes
    • General questions
    • Virtual machines
    • _Not enough resources_ error
    • Connection
    • Disks, snapshots, and images
    • Instance groups
    • Monitoring
    • Licensing
    • Troubleshooting
    • All questions on a single page
  1. FAQ
  2. Troubleshooting

Troubleshooting in Compute Cloud

Written by
Yandex Cloud
Updated at March 7, 2025

This section describes typical problems that may arise when using Compute Cloud and the relevant solutions.

You cannot connect to a new VM with multiple network interfaces over SSHYou cannot connect to a new VM with multiple network interfaces over SSH

When creating a Linux VM with multiple network interfaces, the additional network interfaces may not work correctly in the OS. In some cases, this issue can hinder network connectivity and prevent you from connecting to your VM over SSH.

To fix it, delete the VM and create a new one by providing additional cloud-init parameters in the new VM metadata:

Management console
CLI
Terraform

Expand the Metadata section and add the user-data key with the following configuration:

For Ubuntu

In the write_files.content.network.ethernets configuration section, specify the settings for the required number of network interfaces you want to create on this VM, as shown below. Interfaces are numbered starting from zero. This example shows how to set up three interfaces. You can add up to eight network interfaces to a single VM.

#cloud-config

datasource:
  Ec2:
    strict_id: false
ssh_pwauth: yes
users:
  - name: <username>
    sudo: ALL=(ALL) NOPASSWD:ALL
    shell: /bin/bash
    ssh_authorized_keys:
      - <public_SSH_key>
write_files:
  - path: "/etc/netplan/01-netcfg.yaml"
    permissions: "0644"
    content: |
      # This file describes the network interfaces available on your system
      # For more information, see netplan(5).
      network:
        version: 2
        renderer: networkd
        ethernets:
          eth0:
            dhcp4: yes
          eth1:
            dhcp4: yes
            dhcp4-overrides:
              use-dns: false
              use-routes: false
            dhcp6: no
          eth2:
            dhcp4: yes
            dhcp4-overrides:
              use-dns: false
              use-routes: false
            dhcp6: no
runcmd:
  - sleep 1
  - sudo -i
  - netplan apply
For Debian

In the Primary network interface and Other network interfaces configuration sections, specify the settings for the required number of network interfaces you want to create on this VM, as shown below. Interfaces are numbered starting from zero. This example shows how to set up three interfaces. You can add up to eight network interfaces to a single VM.

#cloud-config

datasource:
  Ec2:
    strict_id: false
ssh_pwauth: yes
users:
  - name: <username>
    sudo: ALL=(ALL) NOPASSWD:ALL
    shell: /bin/bash
    ssh_authorized_keys:
      - <public_SSH_key>
write_files:
  - path: "/etc/network/interfaces"
    permissions: "0644"
    content: |
      # This file describes the network interfaces available on your system
      # and how to activate them. For more information, see interfaces(5).

      source /etc/network/interfaces.d/*

      # Loopback network interface
      auto lo
      iface lo inet loopback

      # Primary network interface
      allow-hotplug eth0
      iface eth0 inet dhcp

      # Other network interfaces
      auto eth1
      allow-hotplug eth1
      iface eth1 inet dhcp

      auto eth2
      allow-hotplug eth2
      iface eth2 inet dhcp
      post-up ip route del default
runcmd:
  - sleep 1
  - sudo -i
  - systemctl restart networking

Where:

  • name:: Username for connecting to the VM over SSH.
  • ssh_authorized_keys:: List of public SSH keys to connect the user to the VM over SSH. Specify at least one public SSH key.
  1. Create a file with the cloud-init configuration, e.g., vm-init.tpl:

    For Ubuntu

    In the write_files.content.network.ethernets configuration section, specify the settings for the required number of network interfaces you want to create on this VM, as shown below. Interfaces are numbered starting from zero. This example shows how to set up three interfaces. You can add up to eight network interfaces to a single VM.

    #cloud-config
    
    datasource:
      Ec2:
        strict_id: false
    ssh_pwauth: yes
    users:
      - name: <username>
        sudo: ALL=(ALL) NOPASSWD:ALL
        shell: /bin/bash
        ssh_authorized_keys:
          - <public_SSH_key>
    write_files:
      - path: "/etc/netplan/01-netcfg.yaml"
        permissions: "0644"
        content: |
          # This file describes the network interfaces available on your system
          # For more information, see netplan(5).
          network:
            version: 2
            renderer: networkd
            ethernets:
              eth0:
                dhcp4: yes
              eth1:
                dhcp4: yes
                dhcp4-overrides:
                  use-dns: false
                  use-routes: false
                dhcp6: no
              eth2:
                dhcp4: yes
                dhcp4-overrides:
                  use-dns: false
                  use-routes: false
                dhcp6: no
    runcmd:
      - sleep 1
      - sudo -i
      - netplan apply
    
    For Debian

    In the Primary network interface and Other network interfaces configuration sections, specify the settings for the required number of network interfaces you want to create on this VM, as shown below. Interfaces are numbered starting from zero. This example shows how to set up three interfaces. You can add up to eight network interfaces to a single VM.

    #cloud-config
    
    datasource:
      Ec2:
        strict_id: false
    ssh_pwauth: yes
    users:
      - name: <username>
        sudo: ALL=(ALL) NOPASSWD:ALL
        shell: /bin/bash
        ssh_authorized_keys:
          - <public_SSH_key>
    write_files:
      - path: "/etc/network/interfaces"
        permissions: "0644"
        content: |
          # This file describes the network interfaces available on your system
          # and how to activate them. For more information, see interfaces(5).
    
          source /etc/network/interfaces.d/*
    
          # Loopback network interface
          auto lo
          iface lo inet loopback
    
          # Primary network interface
          allow-hotplug eth0
          iface eth0 inet dhcp
    
          # Other network interfaces
          auto eth1
          allow-hotplug eth1
          iface eth1 inet dhcp
    
          auto eth2
          allow-hotplug eth2
          iface eth2 inet dhcp
          post-up ip route del default
    runcmd:
      - sleep 1
      - sudo -i
      - systemctl restart networking
    
  2. When creating a VM, provide the created configuration file in the --metadata-from-file parameter. Here is an example:

    yc compute instance create --name=multi-net-vm --hostname=multi-net-vm \
      --zone ru-central1-a \
      --create-boot-disk image-folder-id=standard-images,image-id=fd8bi0vgcf8vco49q3bm \
      --cores=2 --memory=4G --core-fraction=100 \
      --network-interface subnet-name=subnet1,ipv4-address=auto,nat-ip-version=ipv4 \
      --network-interface subnet-name=subnet2,ipv4-address=auto \
      --network-interface subnet-name=subnet3,ipv4-address=auto \
      --metadata-from-file user-data=vm-init.tpl
    

    Note

    The commands yc compute instance create | create-with-container | update | add-metadata support substitution of environment variable values into VM metadata. When you execute a Yandex Cloud CLI command, these values, specified in the user-data key in $<variable_name> format, will be substituted into the VM metadata from the environment variables of the environment the command is executed in.

    To change such behavior, i.e. to provide a variable name to the VM metadata in $<variable_name> format rather than take the variable value from the CLI command runtime environment, use the two-dollar syntax, e.g., $$<variable_name>.

    For more information, see Specifics of providing environment variables in metadata via the CLI.

  1. Create a file with the cloud-init configuration, e.g., vm-init.tpl:

    For Ubuntu

    In the write_files.content.network.ethernets configuration section, specify the settings for the required number of network interfaces you want to create on this VM, as shown below. Interfaces are numbered starting from zero. This example shows how to set up three interfaces. You can add up to eight network interfaces to a single VM.

    #cloud-config
    
    datasource:
      Ec2:
        strict_id: false
    ssh_pwauth: yes
    users:
      - name: <username>
        sudo: ALL=(ALL) NOPASSWD:ALL
        shell: /bin/bash
        ssh_authorized_keys:
          - <public_SSH_key>
    write_files:
      - path: "/etc/netplan/01-netcfg.yaml"
        permissions: "0644"
        content: |
          # This file describes the network interfaces available on your system
          # For more information, see netplan(5).
          network:
            version: 2
            renderer: networkd
            ethernets:
              eth0:
                dhcp4: yes
              eth1:
                dhcp4: yes
                dhcp4-overrides:
                  use-dns: false
                  use-routes: false
                dhcp6: no
              eth2:
                dhcp4: yes
                dhcp4-overrides:
                  use-dns: false
                  use-routes: false
                dhcp6: no
    runcmd:
      - sleep 1
      - sudo -i
      - netplan apply
    
    For Debian

    In the Primary network interface and Other network interfaces configuration sections, specify the settings for the required number of network interfaces you want to create on this VM, as shown below. Interfaces are numbered starting from zero. This example shows how to set up three interfaces. You can add up to eight network interfaces to a single VM.

    #cloud-config
    
    datasource:
      Ec2:
        strict_id: false
    ssh_pwauth: yes
    users:
      - name: <username>
        sudo: ALL=(ALL) NOPASSWD:ALL
        shell: /bin/bash
        ssh_authorized_keys:
          - <public_SSH_key>
    write_files:
      - path: "/etc/network/interfaces"
        permissions: "0644"
        content: |
          # This file describes the network interfaces available on your system
          # and how to activate them. For more information, see interfaces(5).
    
          source /etc/network/interfaces.d/*
    
          # Loopback network interface
          auto lo
          iface lo inet loopback
    
          # Primary network interface
          allow-hotplug eth0
          iface eth0 inet dhcp
    
          # Other network interfaces
          auto eth1
          allow-hotplug eth1
          iface eth1 inet dhcp
    
          auto eth2
          allow-hotplug eth2
          iface eth2 inet dhcp
          post-up ip route del default
    runcmd:
      - sleep 1
      - sudo -i
      - systemctl restart networking
    
  2. When creating a VM, provide the created metadata file in the yandex_compute_instance.metadata section. Here is an example:

    resource "yandex_compute_instance" "multi-net-vm" {
      name        = "multi-net-vm"
      platform_id = "standard-v2"
      zone        = "ru-central1-a"
     
      resources {
        cores  = "2"
        memory = "2"
      }
    
      boot_disk {
        initialize_params {
          image_id = "fd8bi0vgcf8vco49q3bm"
        }
      }
    
      network_interface {
        subnet_id          = "e2lrucutusnd********"
        nat                = true
      }
    
      network_interface {
        subnet_id          = "e2lpp96bvvgp********"
        nat                = false
      }
    
      network_interface {
        subnet_id          = "e2lv9c6aek1d********"
        nat                = false
      }
    
      metadata = {
        user-data = "${file("./vm-init.tpl")}"
      }
    }
    

Additional network interfaces do not work after you attach them to an existing VMAdditional network interfaces do not work after you attach them to an existing VM

After you attach additional network interfaces to a Linux VM, they may not work correctly in the operating system. In some cases, this issue can hinder network connectivity and prevent you from connecting to your VM over SSH.

To fix it, try upgrading the VM's operating system to its latest version.

If upgrading the OS is not possible or does not help:

  1. Connect to the VM over SSH.

    If the SSH connection fails due to network connectivity issues, remove all additional network interfaces and reboot the VM.

  2. Update the OS network configuration:

    Ubuntu
    Debian
    1. Add the configuration of the new network interfaces to the /etc/netplan/01-netcfg.yaml file:

      sudo nano /etc/netplan/01-netcfg.yaml
      

      In the write_files.content.network.ethernets configuration section, specify the settings for the required number of existing or new VM network interfaces, as shown below. Interface numbering starts from zero. This example shows how to set up three interfaces. You can add up to eight network interfaces to a single VM.

      # This file describes the network interfaces available on your system
      # For more information, see netplan(5).
      network:
        version: 2
        renderer: networkd
        ethernets:
          eth0:
            dhcp4: yes
          eth1:
            dhcp4: yes
            dhcp4-overrides:
              use-dns: false
              use-routes: false
            dhcp6: no
          eth2:
            dhcp4: yes
            dhcp4-overrides:
              use-dns: false
              use-routes: false
            dhcp6: no
      
    2. Assign the required permissions to the /etc/netplan/01-netcfg.yaml file:

      sudo chmod 0644 /etc/netplan/01-netcfg.yaml
      
    3. Apply the network configuration changes:

      sudo netplan apply
      
    1. Add the configuration of the new network interfaces to the /etc/network/interfaces file:

      sudo nano /etc/network/interfaces
      

      In the Primary network interface and Other network interfaces configuration sections, specify the settings for the required number of existing or new VM network interfaces, as shown below. Interface numbering starts from zero. This example shows how to set up three interfaces. You can add up to eight network interfaces to a single VM.

      # This file describes the network interfaces available on your system
      # and how to activate them. For more information, see interfaces(5).
      
      source /etc/network/interfaces.d/*
      
      # Loopback network interface
      auto lo
      iface lo inet loopback
      
      # Primary network interface
      allow-hotplug eth0
      iface eth0 inet dhcp
      
      # Other network interfaces
      auto eth1
      allow-hotplug eth1
      iface eth1 inet dhcp
      
      auto eth2
      allow-hotplug eth2
      iface eth2 inet dhcp
      post-up ip route del default
      
    2. Restart the network service:

      sudo systemctl restart networking
      
  3. If you previously had to remove additional network interfaces, add them back.

Was the article helpful?

Previous
Licensing
Next
All questions on a single page
Yandex project
© 2025 Yandex.Cloud LLC