Elastic network interface

Also known as: ENI

On this page 7

An elastic network interface (ENI) is a logical virtual network card in an Amazon Virtual Private Cloud (VPC) that gives a compute resource its private IP addresses, security groups, MAC address and connection to a subnet. In cloud networking, the ENI is the basic attachment point between a workload and the VPC: every Amazon EC2 instance has at least one, and many managed services create their own ENIs to place endpoints inside a customer network.

Because an ENI exists as an independent resource with its own identity, it can be created, configured and moved between instances in the same Availability Zone while keeping its addresses and attributes. This independence makes it a building block for failover designs, multi-homed appliances and network segmentation in Amazon Web Services.

What an elastic network interface contains

An ENI is defined by a set of network attributes that travel with it when it moves. These attributes determine how traffic reaches the interface, which traffic is allowed and how the interface appears to the guest operating system.

The table below lists the main attributes and their effect on the attached workload.

AttributeDescriptionPractical effect
Primary private IPv4 addressAssigned from the subnet range at creationStable internal address for the interface lifetime
Secondary private IPv4 addressesAdditional addresses on the same interfaceHosting several services or containers on one card
Elastic IP addressStatic public IPv4 mapped to a private addressFixed public endpoint that survives instance changes
IPv6 addressesOne or more addresses from the subnet IPv6 rangeGlobally routable connectivity without NAT
Security groupsStateful firewall rule sets bound to the ENITraffic filtering per interface, not per instance
MAC addressFixed hardware address of the interfaceSoftware licenses tied to a MAC keep working
Source/destination checkFlag that drops traffic not addressed to the ENIMust be disabled for NAT or routing appliances
Core attributes of an elastic network interface

A key point often missed is that security groups attach to the ENI, not to the instance itself. An instance with two interfaces can apply different rule sets to each, which allows separation of management and application traffic on the same host.

How ENIs attach to instances

Every EC2 instance has a primary network interface, shown as eth0 in Linux, which is created with the instance and cannot be detached. Additional ENIs, called secondary network interfaces, can be attached and detached as needed, and they keep their configuration when moved.

AWS distinguishes three attachment moments, which matter for automation and for guest operating system configuration.

ModeInstance stateTypical scenario
Hot attachInstance is runningFailover to a standby instance without a restart
Warm attachInstance is stoppedReconfiguring an appliance during maintenance
Cold attachInstance is being launchedTemplates that always create a multi-homed host
Attachment modes for secondary interfaces

Two constraints govern every attachment. An ENI belongs to one subnet and therefore one Availability Zone, so it can only attach to instances in that zone. In addition, each instance type has a maximum number of interfaces and addresses per interface, which ranges from a few on small instances to dozens on large network-optimized types.

ENI types and service-managed interfaces

Not every ENI is created by a person. Many AWS services create requester-managed interfaces in customer subnets so that their endpoints receive private addresses and obey VPC routing and security groups. Recognizing these interfaces prevents accidental deletion attempts and explains why subnets sometimes run out of addresses.

KindCreated byPurpose
Standard ENIUser or launch templateGeneral instance networking
Requester-managed ENIServices such as NAT gateways, VPC endpoints and LambdaPlacing a managed endpoint inside the VPC
Trunk ENIAmazon ECS with interface trunkingCarrying many branch interfaces for awsvpc tasks
Elastic Fabric AdapterUser on supported instance typesLow-latency, OS-bypass traffic for high-performance computing
Common kinds of elastic network interfaces

Container platforms illustrate the scale effect. The Amazon VPC CNI plugin for Kubernetes assigns VPC addresses to pods through secondary addresses or prefix delegation, in which whole /28 IPv4 prefixes are attached to an ENI, greatly increasing pod density per node.

The Elastic Network Adapter, often abbreviated ENA, is a different concept: it is the driver and virtual hardware for enhanced networking, while the ENI is the logical interface that carries addresses and policies.

Design patterns that rely on ENIs

The movable nature of an ENI enables several well-established architecture patterns in cloud networking. Each pattern uses the fact that addresses, MAC address and security groups stay with the interface.

  • Low-budget failover: a secondary ENI with a known address moves from a failed instance to a standby, so clients keep using the same IP.
  • Management network separation: one interface serves application traffic while a second interface in a restricted subnet carries administrative access.
  • Network and security appliances: firewalls and routers use several ENIs in different subnets, with source/destination checking disabled.
  • License stability: software licensed to a MAC address keeps working when the interface moves to replacement hardware.

For observability, VPC flow logs record traffic per ENI, so the interface is also the unit of network monitoring and forensic analysis.

Limitations and common mistakes

Most problems with ENIs come from address capacity, zone boundaries and routing assumptions. The following table connects typical symptoms with their causes and remedies.

SymptomCauseFix
Pods or tasks fail to startSubnet or per-instance address limit reachedLarger subnets, prefix delegation or bigger instance types
Second interface receives no reply trafficGuest operating system routes all replies via eth0Configure policy-based routing in the guest
Appliance drops forwarded packetsSource/destination check still enabledDisable the check on the appliance interfaces
Interface cannot attach to a new instanceInstance is in another Availability ZoneCreate a new ENI in the target zone
Frequent ENI problems and their fixes

Another misconception is that a second ENI doubles network bandwidth. Bandwidth is set by the instance type, so additional interfaces add segmentation and addresses, not throughput. Multiple ENIs also do not provide cross-zone high availability, which still requires load balancers or DNS-based failover.

The simple explanation

An elastic network interface is like a network card for a virtual server, except that it exists only in software. It holds the address other machines use to reach the server and the rules about who may connect.

Because it is separate from the server, it can be unplugged and plugged into another server in the same data center area, taking its address and rules along. The key takeaway is that the network identity belongs to the interface, so moving the interface moves the identity.

How it is used in practice

A logistics company runs a legacy order-processing application on a single EC2 instance in one Availability Zone. Partner systems connect to a fixed private IP address that is hard-coded in their configurations, and the software license is bound to a MAC address.

The operations team creates a secondary ENI with the address 10.20.1.50, attaches it to the active instance and keeps a stopped standby instance in the same subnet. A health check script detects failure, detaches the interface and hot attaches it to the standby, which is then started. A separate interface in a management subnet allows administrator access through a bastion host with stricter security group rules.

During a real hardware failure, partner connections recover in about two minutes without any configuration change on their side, and the license remains valid because the MAC address moved with the interface.