Attach and detach ENIs using the AWS Management Console, AWS CLI, or AWS SDKs, with the ability to attach ENIs to running or stopped EC2 instances depending on the instance type and the ENI being primary or secondary.
You can attach additional ENIs to an EC2 instance during launch or while the instance is running (hot attach) for supported instance types. The primary ENI (eth0) is attached at launch and cannot be detached. Secondary ENIs can be attached to running instances of most current-generation instance types, or to stopped instances for all instance types. Detaching an ENI removes it from the instance but preserves the ENI configuration, allowing you to attach it to another instance later.
The primary network interface (eth0) cannot be detached from an instance
You cannot attach an ENI to an instance in a different Availability Zone
An ENI can only be attached to one instance at a time
Some older instance types require the instance to be stopped before attaching/detaching ENIs
Nitro-based instances support hot attach/detach of ENIs while the instance is running
An instance can have multiple ENIs, but the maximum number varies by instance type (from 2 to 15+ secondary ENIs)
When attaching an ENI, the device index must be unique and sequential
After attaching, you may need to configure the OS to recognize the new network interface (e.g., using dhclient or creating network config files)
When you attach a secondary ENI to a running instance, the operating system may not automatically detect and configure the new interface. For Linux instances, you typically need to run sudo dhclient ethN (where N is the device index) or configure the interface permanently in /etc/network/interfaces or /etc/sysconfig/network-scripts/. For Windows instances, the new interface should be detected automatically, but you may need to enable it in the Network Connections control panel.
You need to move a network interface from one EC2 instance to another to test a network configuration. What steps do you take, and what state must the source instance be in?
You attached a secondary ENI to a running instance, but the OS doesn’t show the new interface. What’s the first thing you check?
A microservice pod on an EC2 instance lost network connectivity after a deployment. The logs show the ENI was detached and reattached during a scaling event — what could have gone wrong, and how would you fix it?
Your team uses multiple ENIs to isolate traffic types (e.g., public vs private). One instance suddenly can’t reach its database — you notice the ENI assigned to the private subnet is missing. How do you troubleshoot this?
You’re designing a high-throughput data ingestion service that needs to handle 10K+ concurrent connections. How would you use multiple ENIs to scale network performance, and what limits or bottlenecks should you monitor?
Your application uses ENI mobility for zero-downtime deployments, but you’ve noticed intermittent packet loss during ENI swaps. What are the possible root causes, and how would you mitigate them?
You’re migrating a legacy monolith from single-ENI to multi-ENI architecture across hundreds of instances. What are the operational risks, and how would you design a phased rollout with rollback safety?
Your organization uses ENI attachment/detachment for dynamic network segmentation in a multi-tenant environment. How do you prevent cross-tenant ENI hijacking or misconfiguration at scale, and what governance controls would you enforce?