Elastic Network Interfaces quick reference and cheat sheet

AWS ENI @ Freshers.in
Elastic Network Interfaces – ENIs are virtual network cards you can attach to your EC2 instances. They are used to enable network connectivity for your instances, and having more than one of them connected to your instance allows it to communicate on two different subnets.
  1. An elastic network interface is a logical networking component in a VPC that represents a virtual network card.
  2. A network interface can include the following attributes:
    1. A primary private IPv4 address from the IPv4 address range of your VPC.
    2. One or more secondary private IPv4 addresses from the IPv4 address range of your VPC.
    3. One Elastic IP address (IPv4) per private IPv4 address.
    4. One public IPv4 address.
    5. One or more IPv6 addresses.
    6. One or more security groups.
    7. A MAC address.
    8. A source/destination check flag.
    9. A description.
  3. You can create and configure network interfaces in your account and attach them to instances in your VPC.
  4. Each instance has a default network interface, called the primary network interface.
  5. eth0 is the primary network interface which cannot be moved or detached.
  6. You cannot detach a primary network interface from an instance.
  7. By default, eth0 is the only Elastic Network Interface created with an EC2 instance when launched.
  8. You can add additional interfaces to EC2 instances
  9. An ENI is bound to an AZ.
  10. You can specify which subnet/AZ you want the ENI to be added in.
  11. You can specify which IP address within the subnet to configure or leave it be auto-assigned.
  12. You can only add one extra ENI when launching but more can be attached later.
  13. ENIs can be ‘hot attached‘ to running instances.
  14. ENIs can be ‘warm-attached‘ when the instance is stopped.
  15. ENIs can be ‘cold-attached‘ when the instance is launched.
  16. If you add a second interface AWS will not assign a public IP address to eth0 (you would need to add an Elastic IP).
  17. Default interfaces are terminated with instance termination.
  18. Manually added interfaces are not terminated by default.
  19. You can change the termination behavior.
  20. Termination behavior : You can set the termination behavior for a network interface that’s attached to an instance. You can specify whether the network interface should be automatically deleted when you terminate the instance to which it’s attached.
  21. You can create a network interface in a subnet. You can’t move the network interface to another subnet after it’s created. You must attach a network interface to an instance in the same Availability Zone.
  22. A secondary ENI can be added to an instance. While primary ENIs cannot be detached from an instance,
    secondary ENIs can be detached and attached to a different instance.
  23. Elastic Network Interfaces Best Practices
    1. Elastic Network Interfaces can be attached to an instance when it’s running (hot attach), when it’s stopped (warm attach), or when the instance is being launched (cold attach).
    2. Primary (eth0) interface can’t be detached
    3. Secondary (ethN) Elastic Network Interfaces can be detached when the instance is running or stopped.
    4. ENI in one subnet can be attached to an instance in another subnet, but the same AZ and same VPC
  24. You can change the security group membership of an ENI.
  25. You can attach an instance to tow different subnets within a VPC by using two ENIs.
Author: user

Leave a Reply