What is an ENI?
An ENI encapsulates network configuration so you can decouple networking from an instance’s lifecycle. Typical use cases:- Preserve private IPs and security groups when replacing instances
- Move a public IP between instances by attaching an EIP to the ENI
- Add additional NICs to instances to separate traffic or host multiple services
Create a network interface (console)
Steps to create an ENI from the EC2 console:- Open EC2 -> Network Interfaces -> Create network interface.
- Add a description (for example, “My EC2 interface”), choose a subnet, and decide whether to auto-assign a private IP or specify one manually.
- Assign the security group(s) you want applied to the ENI (for example,
Web SG). - Create the network interface.

Associate an Elastic IP with an ENI
You can associate an Elastic IP (EIP) directly to an ENI. When an EIP is bound to an ENI, the public IP follows the ENI — move the ENI to another instance in the same AZ and the public IP moves with it.
Launch an instance and attach an existing ENI
When launching a new EC2 instance you normally create a default network interface (device index 0). Instead of creating a new ENI, you can attach an existing one during launch:- In the Launch Instance wizard, open Network settings -> Advanced Network Configuration.
- By default, device index 0 is shown. Choose the existing ENI by its ID if you want the instance to use that ENI’s configuration.
- Note: if you select an existing ENI at launch, you do not choose security groups in the launch dialog — the ENI’s security groups are used.



Add a second (secondary) ENI to a running instance
You can attach additional ENIs to a running instance, provided:- The instance type supports multiple ENIs.
- The ENI is in the same Availability Zone (AZ) as the instance.
ENIs must be in the same Availability Zone as the instance you attach them to. Subnets must be within that AZ.


Check instance limits for the number of ENIs and secondary private IPs per ENI for your instance type. See the AWS ENI limits in the EC2 documentation: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-eni.html
Example SSH session
If an ENI has an Elastic IP associated, you can SSH using that public address:ip addr to verify all attached ENIs and their private IPs:
Move ENIs between instances
You can detach a secondary ENI from one instance and attach it to another instance in the same AZ. The new instance inherits the ENI’s:- private IP
- associated Elastic IP (if any)
- security groups
You cannot detach the primary network interface (device index 0) from an instance. Only secondary ENIs can be detached and moved between instances while running. Plan primary/secondary ENI usage accordingly.

Quick reference table
Summary
- ENIs encapsulate subnet, private IP(s), and security groups as a separate resource.
- ENIs must be in the same Availability Zone as the instance to attach.
- Only secondary ENIs can be detached and moved between instances (primary ENI restrictions apply).
- Elastic IPs can be associated with ENIs so the public IP travels with the interface.
- Using ENIs decouples network configuration from instance lifecycle and simplifies moving IPs/security settings across hosts.
Links and references
- Elastic IP addresses — AWS EC2 User Guide
- ENIs and using network interfaces — AWS EC2 User Guide
- Enhanced Networking (ENA) — AWS EC2 User Guide