VIF and ENI compared
The two acronyms are easy to confuse and describe entirely different things. An ENI is a network card for an EC2 instance. A VIF is closer to a virtual cable between an on-premises network and AWS.
Elastic Network Interface (ENI)
Section titled “Elastic Network Interface (ENI)”- A virtual network card for resources inside a VPC.
- Lives in one subnet, and therefore in one Availability Zone.
- Operates at the instance level.
- Carries private IPv4 addresses, optionally a public address and Elastic IPs, IPv6 addresses, a MAC address, security groups and a source/destination check flag.
- Can be detached from one instance and attached to another, which is the basis of a cheap failover pattern.
Used for attaching multiple interfaces to an instance, building management networks, running network and security appliances, and giving an instance several IP addresses.
Virtual interface (VIF)
Section titled “Virtual interface (VIF)”- A configuration object on a Direct Connect connection — a VLAN with a BGP session.
- Operates at the connection level, between AWS and your network.
- Carries a VLAN tag, a BGP ASN and BGP peering addresses.
- Attaches to a virtual private gateway, or to a Direct Connect gateway.
Used for private connectivity to VPCs (private VIF), access to AWS public endpoints (public VIF), and connection to a transit gateway (transit VIF).
Where each sits on the path
Section titled “Where each sits on the path”On-premises → VIF → Direct Connect → VPC → ENI → EC2 instanceThe VIF is how traffic enters AWS. The ENI is where it arrives.