Error trying to detach network interface

0

Hello all,

I get the following error when trying to detach a network interface in CLI 2.0:

An error occurred (OperationNotPermitted) when calling the DetachNetworkInterface operation: The network interface at device index 0 cannot be detached.

Tried with both force and no force, instance is stopped still not able... Any help appreciated.

eni-attach-0867e4aaa19f25409 is this interface in question.

Thanks,

posta 3 anni fa16642 visualizzazioni
2 Risposte
0

Hi jflinnergex,

Sorry to hear about the inconvenience you are facing. The primary network interface is assigned to network card index 0, which is what you are trying to detach, however you can only detach a secondary network interface. Each instance has a default network interface, called the primary network interface. You cannot detach a primary network interface from an instance, and it will only get detached or released when the instance is terminated. If you need to preserve the ENI please make sure the delete on termination flag is not selected when terminating the instance: https://docs.aws.amazon.com/cli/latest/reference/ec2/modify-network-interface-attribute.html
For more information: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-eni.html#eni-basics

I hope this helps. Let me know if you have any questions.
Warm regards,
awsamy

amz99
con risposta 3 anni fa
profile picture
ESPERTO
verificato un mese fa
0

I also faced the same issue when I wanted to remove all the resources I had created. This act was to avoid any charges for the services I wasn't using. So if your case is also similar to this then terminate the EC2 instance. With the termination of the EC2 instance-associated Network interfaces, subnets will get removed. However please cross check once on the EC2 dashboard what services are being used post termination.

con risposta 9 mesi fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande