5

What advantages are there to pairing an Elastic IP (EIP) to an interface as opposed to the instance itself?

I see the point of the network interfaces - you can associate and disassociate them from/to instances on-demand without losing configuration. However, you could just as easily do the same for an Elastic IP without any kind of hindrance by disassociating it with the instance and associating it with the new one.

1234567
  • 163
  • 1
  • 10

1 Answers1

2

Network interfaces are exposed for many service you spin up within your VPC, this includes things like load balancers, databases along with normal EC2 instances.

Network interfaces can be considered the same as standalone Ethernet card in the real world. When you move a network interface between machines it can keep its public, private and mac address.

Under normal circumstances assigning an EIP to an instance, is actually just assigning an EIP to that instances primary interface. A primary interface is created automatically when creating an instance. [AWS Docs]

This does get a little more complicated when you include 'ec2-classic' mode, as these instances don't have the concept of network interfaces, as they are pre-vpc. In this mode, EIP's are attached to the instance, not the interface. More details on the differences between the 3 'vpc modes'.

One other thing to note is that you can assign multiple interfaces to the same instance, so there will be some situations where you will need to explicitly search by interface, and not instance.

KHobbits
  • 1,090
  • 7
  • 13
  • When associating the Elastic IP, it asks you to choose the instance or the interface to attach to. I figure that AWS has designed it this way on purpose, for some benefit or another. If this were the case, wouldn't AWS just strictly offer you the ability to assign it to interfaces only? – 1234567 Feb 04 '17 at 02:44
  • I think that's a mixture of two things. Firstly, the search for which interface belongs to what instance, is somewhat difficult to use. Most people don't care about the interface only the instance. Also AWS still supports 'ec2-classic', which is now mostly redundant. When using AWS in 'ec2-classic' mode, there are no network interfaces, only instances. The only time you will likely really need to use the 'network interface' option is when you attach multiple interfaces to a single instance. – KHobbits Feb 04 '17 at 02:49