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
    • All guides
      • Stopping and starting a VM
      • Resetting a Windows Server VM user password
      • Attaching a disk to a VM
      • Detaching a disk from a VM
      • Moving a VM to a different availability zone
      • Moving a VM to a different folder
      • Moving a VM to a different cloud
      • Adding another network interface to a VM
      • Deleting a network interface from a VM
      • Assigning a public IP address to a VM
      • Unassigning a public IP address from a VM
      • Making a VM public IP address static
      • Reassigning a public IP address from one VM to another
      • Updating the VM internal IP address
      • Updating a VM
      • Changing VM computing resources
      • Changing VM security groups
      • VM maintenance policy management
      • Configuring VM access permissions
      • Linking a service account to a VM
      • Deleting a VM
    • Viewing operations with resources
  • Yandex Container Solution
  • Access management
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • Release notes
  1. Step-by-step guides
  2. Managing a VM
  3. Deleting a network interface from a VM

Deleting a network interface from a VM

Written by
Yandex Cloud
Updated at May 5, 2025

A virtual machine supports up to eight network interfaces. You can delete network interfaces you no longer need on both stopped and running VMs.

Note

Still, you cannot delete a VM's network interface if it is the only one it has.

To delete a network interface from a VM:

CLI
API

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

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

  1. See the description of the CLI command for deleting a network interface from a VM:

    yc compute instance detach-network-interface --help
    
  2. Get a list of VMs in the default folder:

    yc compute instance list
    

    Result:

    +----------------------+-----------------+---------------+---------+----------------------+
    |          ID          |       NAME      |    ZONE ID    | STATUS  |     DESCRIPTION      |
    +----------------------+-----------------+---------------+---------+----------------------+
    | fhm0b28lgfp4******** | first-instance  | ru-central1-a | RUNNING | my first vm via CLI  |
    | fhm9gk85nj7g******** | second-instance | ru-central1-a | RUNNING | my second vm via CLI |
    +----------------------+-----------------+---------------+---------+----------------------+
    

    Save the ID of the VM from which you want to delete a network interface.

  3. Stop the selected VM if needed by specifying its ID:

    Note

    The feature of adding and removing network interfaces on running VMs is at the Preview stage. To access the feature, contact support.

    yc compute instance stop <VM_ID>
    
  4. Get a list of network interfaces for the selected VM by specifying its ID:

    yc compute instance get <VM_ID>
    

    Result:

    ...
    network_interfaces:
      - index: "0"
        mac_address: d0:0d:1a:**:**:**
        subnet_id: e2lrucutusnd********
        primary_v4_address:
          address: 192.168.1.20
          one_to_one_nat:
            address: 158.***.**.***
            ip_version: IPV4
        security_group_ids:
          - enpuatgvejtn********
      - index: "1"
        mac_address: d0:1d:1a:**:**:**
        subnet_id: e2lpp96bvvgp********
        primary_v4_address:
          address: 192.168.2.3
        security_group_ids:
          - enpuatgvejtn********
          - enpg8d2hqh1o********
      - index: "2"
        mac_address: d0:2d:1a:**:**:**
        subnet_id: e2lv9c6aek1d********
        primary_v4_address:
          address: 192.168.4.17
        security_group_ids:
          - enpuatgvejtn********
          - enpg8d2hqh1o********
    ...
    

    Save the number (the index field value) of the network interface you want to delete.

  5. Delete the network interface:

    yc compute instance detach-network-interface \
      --id <VM_ID> \
      --network-interface-index <network_interface_number>
    

    Where:

    • --id: ID of the selected VM. Instead of the ID, you can use the --name parameter to specify the VM name.
    • --network-interface-index: Previously saved number of the VM's network interface you need to delete.

    Result:

    ...
    network_interfaces:
      - index: "0"
        mac_address: d0:0d:1a:**:**:**
        subnet_id: e2lrucutusnd********
        primary_v4_address:
          address: 192.168.1.20
          one_to_one_nat:
            address: 158.***.**.***
            ip_version: IPV4
        security_group_ids:
          - enpuatgvejtn********
      - index: "1"
        mac_address: d0:1d:1a:**:**:**
        subnet_id: e2lpp96bvvgp********
        primary_v4_address:
          address: 192.168.2.3
        security_group_ids:
          - enpuatgvejtn********
          - enpg8d2hqh1o********
    ...
    

Use the detachNetworkInterface REST API method for the Instance resource or the InstanceService/DetachNetworkInterface gRPC API call.

Was the article helpful?

Previous
Adding another network interface to a VM
Next
Assigning a public IP address to a VM
Yandex project
© 2025 Yandex.Cloud LLC