Score:0

How AWS Elastic Network Interfaces actually work?

br flag

I have a couple of questions regarding ENIs:

  1. Why I can't change auto-assigned private IP address on default ENI?

  2. What if I change the IP on eth0 inside the system manually? Will it work, or the interface will be ruined?

My goal is to understand these moments to understand how ENIs work and why it differs from the behavior of physical network adapters. I wanna dig a little bit deeper under the hood of ENIs.

Oscar De León avatar
la flag
Are they in the same AZ?
Konstantin  avatar
br flag
Hi Oscar, yes they are in the same AZ.
Konstantin  avatar
br flag
Update: I've found out that actually the subnets was in the different AZs. AZ names so similar and I've confused you. Sorry. I've deleted 3rd question.
Score:0
ar flag

Why I can't change auto-assigned private IP address on default ENI?

Once an EC2 instance is launched, it's assigned a private IP address at boot time. An instance's private IP address will never change during the lifetime of that instance. As per AWS, when an instance is launched in EC2-Classic, it is automatically assigned a public IP address to the instance from the EC2-Classic public IPv4 address pool. This behavior cannot be modified.

For more details please refer : https://docs.rightscale.com/faq/clouds/aws/Can_the_public_or_private_IP_addresses_change_on_an_EC2_instance.html

What if I change the IP on eth0 inside the system manually? Will it work, or the interface will be ruined?

You can't manually disassociate the public IP address from your instance after launch. Instead, it's automatically released in certain cases, after which you cannot reuse it.

For more details please refer link below https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-instance-addressing.html

Konstantin  avatar
br flag
I've already read about that. But my goal is to understand why I can't change private primary IP on the default ENI and what will be if I do so inside operating system of an instance.
Score:0
de flag
  1. Why I can't change auto-assigned private IP address on default ENI?

The primary ENI, cannot be changed. I assume that AWS uses the primary interface for a NAT purpose. However, if you attach another ENI you can change the IP address inside of a guess OS.

  1. What if I change the IP on eth0 inside the system manually? Will it work, or the interface will be ruined?

If you change it, you will interrupt the connection to an instance and the only way to fix the problem is to reboot the instance. The IP and MAC assignment is done a layer higher than the guest OS (check the link above).

This is not a secret that AWS uses Xen as a hypervisor. The ENI employ a driver which is called "netfront" [at the guest OS side] and "netback" [at the hypervisor side]. If you want to delve a bit deeper under the hood of ENIs, you need to study this documentation https://wiki.xenproject.org/wiki/Xen_Networking and https://wiki.xenproject.org/wiki/Xen_Project_Software_Overview

I hope, I have shed some light on the topic.

Konstantin  avatar
br flag
Awesome! That's all I wanted to know! Thank you very much. Unfortunately, I can't mark you answer as the solution because of my low reputation.
de flag
Great! I am glad that I could help. Regarding marking my answer, I see two options: 1. You will do it after you reach a high reputation. 2. I hope another member with an appropriate reputation level will do it after he or she read my answer.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.