Detaching and Deleting a Secondary VNIC

Detach and delete a specified secondary VNIC.

You can't delete a Compute instance’s primary VNIC. When you terminate a Compute instance, all attached VNICs (primary and secondary) are automatically detached and deleted.

Note

If the VNIC has a private IP that's the target of a route rule, deleting the VNIC causes all traffic to the private IP to be dropped.
    1. Confirm you're viewing the compartment that contains the Compute instance you're interested in.
    2. Open the navigation menu and click Compute. Under Compute, click Instances.
    3. Click the name of the instance to view its details.
    4. Under Resources, click Attached VNICs.
      The primary VNIC and any secondary VNICs attached to the instance are displayed.
    5. For the VNIC you want to delete, click the Actions menu (Actions Menu), and then click Delete VNIC.
    6. Confirm when prompted.

      It takes typically a few seconds before the VNIC is deleted.

    If the secondary VNIC is on a Linux instance: use the oci-network-config utility to update the OS configuration required for secondary VNICs on instances that run Oracle Linux.

  • Use the oci iam domain get command and required parameters to detach and delete a specified secondary VNIC:

    oci compute instance detach-vnic --compartment-id ocid --vnic-id ocid ... [OPTIONS]

    For a complete list of parameters and values for CLI commands, see the CLI Command Reference.

  • Run the DetachVnic operation to detach and delete a specified secondary VNIC.