AWS, AWS Interview Question, AWS Network

Is aws ec2 instance private ip static or dynamic?

A private IPv4 address is an IP address that’s not reachable over the Internet. You can use private IPv4 addresses for communication between instances in the same VPC.

When an instance is launched, aws allocate a primary private IPv4 address for the instance from selected or from default subnet and vpc.

An instance receives a primary private IP address from the IPv4 address range of the subnet.

If you don’t specify a primary private IP address when you launch the instance, amazon select an available IP address in the subnet’s IPv4 range for you.

Each instance has a default network interface (eth0) that is assigned the primary private IPv4 address.

The private IP address assigned to elastic network interfaces are static.

A private IPv4 address, regardless of whether it is a primary or secondary address, remains associated with the network interface when the instance is stopped and started, or hibernated and started, and is released when the instance is terminated.

The private IP address stays assigned to the network interface until it is deleted. The instance’s primary network interface cannot be removed; it stays assigned to the instance until the instance is deleted. It is not possible to remove or change the private IP address of the primary network interface, but it is possible to add more private IP addresses to the network interface.

You can also specify additional private IPv4 addresses, known as secondary private IPv4 addresses. Unlike primary private IP addresses, secondary private IP addresses can be reassigned from one instance to another.


Leave a Reply