Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change Primary Elastic Network Interface(ENI) between two EC2 Instances

Can we change Primary Elastic Network Interface from Ec2 Instance to another Ec2?

I'm able to swap the secondary ENI's between the Ec2 Instances, but not able to change the primary ENI from one Ec2 instance to the other.

Is it possible to change the primary ENI?

like image 446
srikanth Nakka Avatar asked Jul 15 '18 18:07

srikanth Nakka


People also ask

Can a ENI be attached to multiple EC2 instances?

Additional ENIs can be attached to an Amazon EC2 instance. These extra ENIs can be attached to different subnets in the same Availability Zone.

Can you detach primary Eni?

You cannot detach a primary network interface from an instance. You can create and attach additional network interfaces. The maximum number of network interfaces that you can use varies by instance type. For more information, see IP addresses per network interface per instance type.

Can Elastic IP be attached to multiple instances?

An Amazon Load Balancer helps you scale out your site by associating many EC2 instances at the same time under one web address. An Elastic IP, on the other hand, can only be associated with one EC2 instance at a time.


1 Answers

This isn't possible. The Primary ENI is locked to the instance for the lifetime of the instance, even if the instance is stopped.

Every instance in a VPC has a default network interface, called the primary network interface (eth0). You cannot detach a primary network interface from an instance.

https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-eni.html

like image 145
Michael - sqlbot Avatar answered Sep 30 '22 06:09

Michael - sqlbot