Yandex Cloud
Documentation
PresentationContact UsTry it for free
© 2026 Direct Cursus Technology L.L.C.
Yandex Compute Cloud
    • All guides
      • 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
      • Changing VM security groups
      • Enabling a software-accelerated network
    • Viewing operations with resources
    • Viewing metrics Monitoring
  • Yandex Container Solution
  • Access management
  • Pricing policy
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • Release notes
  1. Step-by-step guides
  2. Network
  3. Deleting a network interface from a VM

Deleting a network interface from a VM

Written by
Yandex Cloud
Updated at November 2, 2026
View in Markdown

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 used by default is the one specified when creating the CLI profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also specify a different folder for any command using --folder-name or --folder-id.

If you access a resource by its name, the search will be limited to the default folder. If you access a resource by its ID, the search will be global, i.e., through all folders based on access permissions.

  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
© 2026 Direct Cursus Technology L.L.C.